Meteor-CollectionFS
Meteor-CollectionFS copied to clipboard
Cant upload images in production
Image upload works fine in local/dev environment but compiled/in production i receive this error when I try to upload an image:
/bundle/programs/server/npm/node_modules/meteor/cfs_gridfs/node_modules/mongodb/lib/mongodb/connection/base.js:246 throw message; ^
Error: Error storing uploaded file to TempStore: Can't get executor for query { "files_id": "5a07798f6ce25b0800871962", "n": { "$gte": 0 } }
at EventEmitter.
I'm having the same problem, would love any advice!
I did not determine the source of the problem, but it seems it was related to the configuration of the mongo server. I use nodechef, and was encountering this issue while using mlab databases with default configuration. The moment I pointed my installation to the default nodechef databases instead image upload worked with no additional configuration required at all.
Same here using heroku and the mlab add-on. Will try a different configuration.
What fixed the problem for me was I ran "db.cfs.images.filerecord.ensureIndex({ files_id : 1, n : 1 })" for all my collections related uploading images
This didn't work for me.
Then I have deleted the db, set up a new mLab. But the images still won't upload. This seems to be in line with @conciousweb.
I actually attempted the suggestion @jenniewerner mentioned first as well, and it did not fix the issue for me either. @jenniewerner are you hosting your databases also with mLab?
I think it may be time for me to give a go at ostrio:files, and S3 integration for persistent files.
+1, how to solve?
The problem disappeared on its own when I left mlab and hosted my database on nodechef where my instance was also located. Cant say for certain what the actual issue was
thanks, for your reply.
I tried to build meteor build.. and run my app on Local PC (I don't work).
But I work fine on meteor run in development mode