Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since Meteor 2.11 - Exception in setTimeout callback: TypeError: fs.remove is not a function #870

Closed
Gobliins opened this issue Apr 28, 2023 · 9 comments · Fixed by #871
Closed
Assignees
Labels

Comments

@Gobliins
Copy link

Gobliins commented Apr 28, 2023

Hello,

after upgrading to Meteor 2.11 / Mongo 6, I get the mentioned error.

My Code, Serverside:

function loadFile() {
  ...
  return new Promise((resolve, reject) => {
    Files.load(loadUrl, options,
      (loadError, fileRef) => {
        if (loadError) {
          return reject({error: loadError});
        } else {
          return resolve({error: false, fileRef});
        }
      }, true);
  });
}

When i call this function with await, it never resolves nor rejects.
When using .then(), i get the described error:

Exception in setTimeout callback: TypeError: fs.remove is not a function
at onEnd (packages/ostrio:files/server.js:1433:18) 
at packages/ostrio:files/server.js:1480:13
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1329:12)
at packages/meteor.js:587:25
at runWithEnvironment (packages/meteor.js:1417:24)

On Meteor 2.10 it was working ok.

Is there an update needed or has something changed with Promises in Node 14 / Meteor 2.11?

Edit:
Removed the promise code and worked with callbacks, but still hangs on Files.load().

@dr-dimitru dr-dimitru added the bug label Apr 28, 2023
@dr-dimitru dr-dimitru self-assigned this Apr 28, 2023
@dr-dimitru
Copy link
Member

@Gobliins confirmed as a bug, thank you; will follow up with fix shortly

@Gobliins
Copy link
Author

Thx. If you need more info, just say. I just tested downgrading to Meteor 2.10. Code works as expected. It is running during Meteor startup BTW.

dr-dimitru added a commit that referenced this issue Apr 28, 2023
Thanks to  @Gobliins for reporting
dr-dimitru added a commit that referenced this issue Apr 28, 2023
__Major changes:__

- no

__Changes:__

- 👨‍🔧 Fixed #870, thanks to @Gobliins
- 🤝 Compatibility with `meteor@2.11.0`
@dr-dimitru dr-dimitru mentioned this issue Apr 28, 2023
dr-dimitru added a commit that referenced this issue Apr 28, 2023
📦 v2.3.3

__Major changes:__

- no

__Changes:__

- 👨‍🔧 Fixed #870, thanks to @Gobliins
- 🤝 Compatibility with `meteor@2.11.0`
@dr-dimitru
Copy link
Member

@Gobliins thank you for the report, fix should be available in v2.3.3; Please, upgrade to the latest package version. Let us know if issue is solved on your end

@Gobliins
Copy link
Author

@dr-dimitru Thx for the fix. The error is not happening anymore. Unfortunately storing files is still not working in 2.11. No Entries inside the DB. On Filesystem I'm getting only 1KB files with plain text content: 503 - Service unavailable.
However I'm not sure if this is a problem of meteor-files or the old CFS Packages retrieving the files.
We're currently migrating away from CFS.

@dr-dimitru
Copy link
Member

@Gobliins

Unfortunately storing files is still not working in 2.11. No Entries inside the DB. On Filesystem I'm getting only 1KB files with plain text content: 503 - Service unavailable.
However I'm not sure if this is a problem of meteor-files or the old CFS Packages retrieving the files.
We're currently migrating away from CFS.

Difficult to tell without errors and logs, try {debug: true} mode for further investigation

@dr-dimitru
Copy link
Member

@Gobliins have you figured it out?

@Gobliins
Copy link
Author

Gobliins commented May 2, 2023

Hey, I was on a break / weekend. Today I'm back on it. But I think it's a problem of the old Collection-FS, since I get a timeout during the Files.load() method. My Guess is, that there's a problem with the download URL also happens since Meteor 2.11.

@Gobliins
Copy link
Author

@dr-dimitru A little late but just wanted to tell you safe, it's not a problem of meteor-files :)

@dr-dimitru
Copy link
Member

@Gobliins all good, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants