extracted from https://github.com/meteor/meteor/pull/9274#issuecomment-351754992
Not sure if this is a task for this project or Meteor, but might be worth to be mentioned:
When I upgraded to meteor 1.6.1-beta.18, the ostrio:files package showed an error as below, something releated to FilesCollection.WebApp.connectHandlers.use, and I could not load any images from the meteor server.
Thank you @menelike , update is coming
Hello @menelike ,
Thank you for submitting this one.
Unfortunately I can not reproduce it.
I need more info on that one.
ROOT_URL and etc.debug mode"I've updated our Meteor-Files demo app, now it's in separate branch.
/cc @alexgzhou
Hi @dr-dimitru, thank your for /cc me!
I have made a small project to reproduce the issue, below is the github address, again, thank your for your great works of art~
reproduction
@alexgzhou can not reproduce, everything works well.


so odd!!! @dr-dimitru, just a monent, I will upload my error pages. I have translated some Chinese words into English on the page for your convienent. And below is my error pages:
Dropped a image, OK~

Click the Upload All button, the image flashed out when it is uploaded successfully and the error showed up both at client side and server side

@alexgzhou please update this thread with next info:
ROOT_URL and etc.debug mode"On my setup - MacOS 10.13.2 (17C88), Safari v11.0.2 and Chrome v62.0.3202.94 - everything is fine.
Could someone else confirm issue persistence on Ubuntu?
meteorBoth --inspect and --inspect-brk provided; ignoring --inspect.
[[[[[ ~/git/meteorFilesDemo ]]]]]
=> Started proxy.
=> Started MongoDB.
[34mW20171219-00:37:11.050(8)? (STDERR) [39m[35mDebugger listening on ws://127.0.0.1:9229/ed3bb7f2-8e00-4539-a94a-13303deb4802[39m
[34mW20171219-00:37:11.070(8)? (STDERR) [39m[35mFor help see https://nodejs.org/en/docs/inspector[39m
[34mW20171219-00:37:30.690(8)? (STDERR) [39m[35mDebugger attached.[39m
=> Started your app.
=> App running at: http://localhost:3000/
[34mI20171219-00:38:43.919(8)? [39mresize arg
[34mI20171219-00:38:43.921(8)? [39marg 500
[34mI20171219-00:38:44.038(8)? [39mresize arg
[34mI20171219-00:38:44.039(8)? [39marg 200
[34mW20171219-00:38:44.205(8)? (STDERR) [39m[35mError: Can't wait without a fiber[39m
[34mW20171219-00:38:44.206(8)? (STDERR) [39m[35m at Function.wait (/home/alex/.meteor/packages/meteor-tool/.1.6.1-beta.18.btjw50.l9dqs++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:159:9)[39m
[34mW20171219-00:38:44.207(8)? (STDERR) [39m[35m at Future.wait (/home/alex/.meteor/packages/meteor-tool/.1.6.1-beta.18.btjw50.l9dqs++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:448:10)[39m
[34mW20171219-00:38:44.207(8)? (STDERR) [39m[35m at SynchronousCursor._nextObject (packages/mongo/mongo_driver.js:1017:47)[39m
[34mW20171219-00:38:44.208(8)? (STDERR) [39m[35m at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1051:22)[39m
[34mW20171219-00:38:44.208(8)? (STDERR) [39m[35m at SynchronousCursor.map (packages/mongo/mongo_driver.js:1061:10)[39m
[34mW20171219-00:38:44.208(8)? (STDERR) [39m[35m at SynchronousCursor.fetch (packages/mongo/mongo_driver.js:1085:17)[39m
[34mW20171219-00:38:44.208(8)? (STDERR) [39m[35m at Cursor.(anonymous function) [as fetch] (packages/mongo/mongo_driver.js:875:44)[39m
[34mW20171219-00:38:44.209(8)? (STDERR) [39m[35m at MongoConnection.findOne (packages/mongo/mongo_driver.js:782:56)[39m
[34mW20171219-00:38:44.209(8)? (STDERR) [39m[35m at Collection.findOne (packages/mongo/collection.js:354:29)[39m
[34mW20171219-00:38:44.209(8)? (STDERR) [39m[35m at FilesCollection.WebApp.connectHandlers.use (packages/ostrio:files/server.js:600:64)[39m
[34mW20171219-00:38:44.209(8)? (STDERR) [39m[35m at call (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:239:7)[39m
[34mW20171219-00:38:44.210(8)? (STDERR) [39m[35m at next (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:183:5)[39m
[34mW20171219-00:38:44.210(8)? (STDERR) [39m[35m at Cookies.WebApp.connectHandlers.use (packages/ostrio:cookies/cookies.js:433:17)[39m
[34mW20171219-00:38:44.210(8)? (STDERR) [39m[35m at call (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:239:7)[39m
[34mW20171219-00:38:44.211(8)? (STDERR) [39m[35m at next (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:183:5)[39m
[34mW20171219-00:38:44.211(8)? (STDERR) [39m[35m at Function.handle (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:186:3)[39m
[34mW20171219-00:38:44.211(8)? (STDERR) [39m[35m at handle (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:91:14)[39m
[34mW20171219-00:38:44.211(8)? (STDERR) [39m[35m at call (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:239:7)[39m
[34mW20171219-00:38:44.212(8)? (STDERR) [39m[35m at Immediate.next [as _onImmediate] (/home/alex/.meteor/packages/webapp/.1.5.0-beta161.18.1a8gfs.uhg0z++os+web.browser+web.cordova/npm/node_modules/connect/index.js:183:5)[39m
[34mW20171219-00:38:44.212(8)? (STDERR) [39m[35m at runCallback (timers.js:791:20)[39m
[34mW20171219-00:38:44.212(8)? (STDERR) [39m[35m at tryOnImmediate (timers.js:751:5)[39m
[34mW20171219-00:38:44.212(8)? (STDERR) [39m[35m at processImmediate [as _immediateCallback] (timers.js:722:5)[39m
:3000/res/resources/…ePQqmLA5m3cE6w4gz:1 GET http://localhost:3000/res/resources/ePQqmLA5m3cE6w4gz/small/ePQqmLA5m3cE6w4gz 500 (Internal Server Error)
Image (async)
setValueForAttribute @ modules.js?hash=771c…564dffc41900c:16109
setValueForProperty @ modules.js?hash=771c…564dffc41900c:16093
updateDOMProperties @ modules.js?hash=771c…564dffc41900c:18229
updateProperties$1 @ modules.js?hash=771c…564dffc41900c:18580
commitUpdate @ modules.js?hash=771c…564dffc41900c:19420
commitWork @ modules.js?hash=771c…564dffc41900c:13648
commitAllHostEffects @ modules.js?hash=771c…564dffc41900c:14309
callCallback @ modules.js?hash=771c…2564dffc41900c:4931
invokeGuardedCallbackDev @ modules.js?hash=771c…2564dffc41900c:4970
invokeGuardedCallback @ modules.js?hash=771c…2564dffc41900c:4827
commitRoot @ modules.js?hash=771c…564dffc41900c:14404
performWorkOnRoot @ modules.js?hash=771c…564dffc41900c:15406
performWork @ modules.js?hash=771c…564dffc41900c:15356
requestWork @ modules.js?hash=771c…564dffc41900c:15267
scheduleWorkImpl @ modules.js?hash=771c…564dffc41900c:15121
scheduleWork @ modules.js?hash=771c…564dffc41900c:15078
enqueueForceUpdate @ modules.js?hash=771c…564dffc41900c:10639
Component.forceUpdate @ modules.js?hash=771c…2564dffc41900c:1317
(anonymous) @ ReactMeteorData.jsx:79
Tracker.Computation._compute @ tracker.js?hash=0e8b…c26b49ee62196af:339
Tracker.Computation._recompute @ tracker.js?hash=0e8b…c26b49ee62196af:358
Tracker._runFlush @ tracker.js?hash=0e8b…c26b49ee62196af:532
onGlobalMessage @ meteor.js?hash=b0f12…71996903f947ed5:448
postMessage (async)
setImmediate @ meteor.js?hash=b0f12…71996903f947ed5:468
requireFlush @ tracker.js?hash=0e8b…c26b49ee62196af:151
Tracker.Computation.invalidate @ tracker.js?hash=0e8b…c26b49ee62196af:292
Tracker.Dependency.changed @ tracker.js?hash=0e8b…c26b49ee62196af:459
(anonymous) @ cursor.js:296
SQp.runTask @ meteor.js?hash=b0f12…71996903f947ed5:782
SQp.flush @ meteor.js?hash=b0f12…71996903f947ed5:811
SQp.drain @ meteor.js?hash=b0f12…71996903f947ed5:820
resumeObservers @ local_collection.js:306
endUpdate @ collection.js:237
store.(anonymous function) @ livedata_connection.js:310
(anonymous) @ livedata_connection.js:1228
_performWrites @ livedata_connection.js:1227
_flushBufferedWrites @ livedata_connection.js:1183
(anonymous) @ meteor.js?hash=b0f12…1996903f947ed5:1167
setTimeout (async)
_livedata_data @ livedata_connection.js:1164
onMessage @ livedata_connection.js:1679
(anonymous) @ browser.js:177
forEachCallback @ common.js:30
socket.onmessage @ browser.js:176
@dr-dimitru tried to make some tests on https://github.com/VeliovGroup/Meteor-Files-Demos/commit/83e93cbea5aec8f686d1f9eba9081331bac18998 but I can't start the project, fourseven:[email protected] throws errors. Need some time to dig into this.
=> Errors while upgrading packages:
While loading package fourseven:[email protected]:
error: Command failed: /Users/human/.meteor/packages/meteor-tool/.1.6.1-beta.18.q8l8wl.9qchq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm rebuild --update-binary
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.0/darwin-x64-57_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
Strangely the url doesn't exist: https://github.com/sass/node-sass/releases/download/v3.13.0/darwin-x64-57_binding.node, also not listed on https://github.com/sass/node-sass/releases/tag/v3.13.0
osX/10.12.6 (16G1036)/Darwin Kernel Version 16.7.0
It doesn't seem that fourseven:[email protected] is compatible to node v8 (v8.9.3) as it's not listed in the supported environments list:

@menelike do not update it, use constraint version fourseven:[email protected], older releases never worked for me
@dr-dimitru
I did not change the version of fourseven (https://github.com/VeliovGroup/Meteor-Files-Demos/blob/83e93cbea5aec8f686d1f9eba9081331bac18998/demo/.meteor/versions#L38)
Also if I set fourseven to 3.3.3 I get
Cannot download "https://github.com/sass/node-sass/releases/download/v3.3.3/darwin-x64-57_binding.node": HTTP error 404 Not Found
I'm afraid that I need another demo project to reproduce this error :(
@menelike
Could you reproduce the error using my project?
@alexgzhou Thank you very much, yes I can reproduce this problem with your project.
[[[[[ ~/WebstormProjects/meteorFilesDemo ]]]]]
=> Started proxy.
=> Started your app.
=> App running at: http://localhost:3000/
I20171219-11:00:37.029(1)? resize arg
I20171219-11:00:37.071(1)? arg 500
I20171219-11:00:37.216(1)? resize arg
I20171219-11:00:37.217(1)? arg 200
W20171219-11:00:37.378(1)? (STDERR) Error: Can't wait without a fiber
osX/10.12.6 (16G1036)/Darwin Kernel Version 16.7.0
@menelike I've double-checked meteor-files 1.6.1-beta.18 branch, all works fine. Try to set your DNS to Google public DNS.
See full log below:

Where this logs coming from, can not find those lines in a meteorFilesDemo rep?:
I20171219-11:00:37.029(1)? resize arg
I20171219-11:00:37.071(1)? arg 500
I20171219-11:00:37.216(1)? resize arg
I20171219-11:00:37.217(1)? arg 200
@dr-dimitru These logs are from a node package quickthumb which I used to generate image thumbs.
I20171219-11:00:37.029(1)? resize arg
I20171219-11:00:37.071(1)? arg 500
I20171219-11:00:37.216(1)? resize arg
I20171219-11:00:37.217(1)? arg 200
@dr-dimitru
I have fixed a minor bug in the demo project, would you kindly update your local meteorFilesDemo repository and try to drop a image then click the UPLOAD ALL button, see if any error would show up~
I have removed the quickthumb related code, so no need to install the imagemagick tool.
And you can git checkout HEAD~1 to the commit of meteor 1.6.1-beta.17 works fine and check the working one.
@alexgzhou I just updated your project to 1.6.1-beta.21 and could not see any errors anymore. It seems that is was a Meteor issue and is fixed by now. Can you confirm this?
@menelike I still have the issue. I will try to uninstall and reinstall the entire meteor env, and try it again. Do you use mac os x?
@menelike @alexgzhou please close this issue if it's solved in 1.6.1-rc.1.
@dr-dimitru I still have the issue upgraded to 1.6.1-rc.1.
Hello @alexgzhou ,
Any progress on this one?
I sill can not reproduce the issue.
@dr-dimitru I have meteor updated to 1.6.1-rc.2, and tried in Ubuntu 16.04, 17.10 and Mac OS 11, still have the issue. File upload is fine, collection records fetch is fine, I could use Collection.link(file, 'original') to get a resource url such as http://localhost:3000/res/resources/WnZMuLf83qscbjTLy/original/WnZMuLf83qscbjTLy, but when I copy the url and open it in a new tab or with postman, I got the error.
I tried to debug the at FilesCollection.WebApp.connectHandlers.use (packages/ostrio:files/server.js:600:64) file, but could not fix the issue.
I just tested https://github.com/alexgzhou/meteorFilesDemo against 1.6.1-beta.18 and 1.6.1-rc.6 and both start fine, but fail after I load the page with Error: Can't wait without a fiber.
It seems that https://github.com/VeliovGroup/Meteor-Files/blob/master/server.js#L419 is causing the trouble but I don't know why.
If I use WebApp.connectHandlers.use(Meteor.bindEnvironment((httpReq, httpResp, next) => { instead of WebApp.connectHandlers.use((httpReq, httpResp, next) => { the error is gone.
It's somehow strange that this is not reproducible on @dr-dimitru side
https://github.com/meteor/meteor-feature-requests/issues/156 might have some clues on this, but it already states that WebApp.connectHandlers.use uses Meteor.bindEnvironment internally, so the question is: Why does WebApp.connectHandlers.use(Meteor.bindEnvironment((httpReq, httpResp, next) => { work then?
@menelike thank you for update, I'm going to tun more tests and try to find out why this is happening.
I'll be glad if @mitar could take a look at this thread and give us a clue.
Why you think I could help here?
@dr-dimitru
I ran a couple of test for some hours and I can reproduce this problem with the following steps:
meteor update --release 1.6.1-beta.17meteor npm installmeteor runhttp://localhost:3000meteor update --release 1.6.1-beta.18meteor runhttp://localhost:3000Error: Can't wait without a fibermeteor update --release 1.6.1-beta.17rm -rf .meteor/versionError: Can't wait without a fiber as well.meteor runhttp://localhost:3000I think that https://github.com/meteor/meteor/commit/9a391d9b04dac40758c6f791db2b622505235aa8#diff-79c5e18978e1bfa64cbb9edb380f2920 might cause this. As soon as this is reproducible we should open an issue in Meteor.
tested on osX 10.12.6 (16G1036) - 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct 4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64
@mitar I was only hoping :) could you //cc someone from MDG?
Mb @benjamn could help to find out why behavior of WebApp.connectHandlers.use is changed?
To me, it seems like a breaking change.
@menelike thank you for reproduction steps. Going to try it tonight.
Sorry, no capacity for this right now.
I think I can fix this!
Looks like fix is arrived - https://github.com/meteor/meteor/commit/3b18863
Thank you @benjamn 👏 🎉
Happy to confirm that 1.6.1-rc.7 fixed this issue!
Great work everybody!
Most helpful comment
I think I can fix this!