Async + accessing collection leads to fiber error. Help appreciated, Example added


I´m facing an error I cannot understand and solve.

To describe my problem a bit, I´m using async to execute a number of tasks sequentially

  1. Configuration stuff, database access
  2. Git checkout (nodegit)
  3. Moving the checked out repo to another folder
  4. Doing some database access again This is where the fiber error occurs=( ( Collection.findOne… )

For what I understand, I need to use fibers whenever I´m making calls to external programs. Nodegit however is an npm package and it works without any flaws which is what I´ve expected.

Accessing collections does not have anything todo with external calls at all, so how can this error occur?

I would really really appreciate any help/hint/solution whatever, it´s driving me nuts.

I´ve attached an example project which demonstrates the problem. Running and clicking on the button will execute the tasks.


You need to add .meteor and node_modules folder to git repository.
If you are having this problem with an application you cloned from git, probably you are missing something under node_modules.

Hi baris, I´ve commited both directories now

Weird… It shows it in the commits but they are not in the repository. :confused:
Did you commit empty folders ?
Or are they in gitignore ?

Yeah right, I had problems with Webstorm, did it via bash now and it worked.

Away from my computer right now, but you should maybe check this article out:

It looks at addressing fiber errors in async server code.

Thank you, I already know that article. Maybe my title is a bit misleading because I´m not using the new async of ES6 but I´m using async.js in order to execute my tasks sequentially.

I think the problem might be, that one task executes the callback in another context, but I have no clue how I can implement fibers together with async.js