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

Error when deploying to Modulus only #143

Closed
GatorDigital-HQ opened this issue Sep 4, 2015 · 26 comments
Closed

Error when deploying to Modulus only #143

GatorDigital-HQ opened this issue Sep 4, 2015 · 26 comments

Comments

@GatorDigital-HQ
Copy link

I get the error below only when deploying to the Modulus server. Works fine on my server and when deploying to the Meteor server.

/mnt/app/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot read property 'done' of null
at /mnt/app/node_modules/mongodb/lib/mongodb/auth/mongodb_scram.js:165:17
at /mnt/app/node_modules/mongodb/lib/mongodb/db.js:1194:16
at /mnt/app/node_modules/mongodb/lib/mongodb/db.js:1903:9
at Server.Base._callHandler (/mnt/app/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at /mnt/app/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
at [object Object].MongoReply.parseBody (/mnt/app/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object]. (/mnt/app/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
at [object Object].emit (events.js:95:17)
at [object Object]. (/mnt/app/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)

@fiveisprime
Copy link
Collaborator

Thanks for the report.

This seems like a great chance to test out the demeteorizer beta, which uses
meteor's build tool.

Try this out and see how it works out for you.

$ npm install -g demeteorizer@next
$ cd /path/to/project/
$ demeteorizer
$ modulus deploy .demeteorized/bundle -m

That will generate a bundle that's much more similar to what would be running on
Meteor's servers. Hopefully that solves the issue. :) The -m option is incredibly
important so be sure you include that.

@GatorDigital-HQ
Copy link
Author

All of your steps worked fine without throwing any errors. But still get this in the app log on Modulus. The odd thing is that this code had been working fine on Modulus before. I shut it down for a few months and now get this when deploying;

Found package.json: ./programs/server/package.json
Start script specified in package.json: node ../../main
Initializing Node.js 0.10.36
Now using node v0.10.36
Running command: npm start

[email protected] start /mnt/app/programs/server
node ../../main

/mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot read property 'done' of null
at /mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/auth/mongodb_scram.js:165:17
at /mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1194:16
at /mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1903:9
at Server.Base._callHandler (/mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at /mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
at [object Object].MongoReply.parseBody (/mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object]. (/mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
at [object Object].emit (events.js:95:17)
at [object Object]. (/mnt/app/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)

npm ERR! [email protected] start: node ../../main
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ../../main
npm ERR! You can get their info via:
npm ERR! npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-48-generic
npm ERR! command "/mnt/home/.nvm/v0.10.36/bin/node" "/mnt/home/.nvm/v0.10.36/bin/npm" "start"
npm ERR! cwd /mnt/app/programs/server
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/app/programs/server/npm-debug.log
npm ERR! not ok code 0

@fiveisprime
Copy link
Collaborator

I'm not sure how to help from this point. :/

This is something that I've seen before with Meteor projects that comes and goes
without any sort of indication of what's actually wrong. For most people, an
update of packages fixes this, but for others just deploying a bunch of times
eventually works.

@GatorDigital-HQ
Copy link
Author

I have everything that I'm using updated and over the past three days I'd say that I've already tried the many times approach.

@fiveisprime
Copy link
Collaborator

Check this out: meteor/meteor#4148

@GatorDigital-HQ
Copy link
Author

I've seen that one already. My user name has always been - harleyhar

It is a bit odd though that my error is thrown from that exact same location?

I found this one that says it fixed it but never mentions how to do the upgrade or how to tell if you already have it.

https://jira.mongodb.org/browse/NODE-382

@fiveisprime
Copy link
Collaborator

Looks like that is fixed in 1.4.34, which is weird because 1.1.0.3 is the latest..

@AndreasGalster
Copy link

Not sure where to post issues for the beta, there doesn't seem to be a public branch. I'm using the RC-12 of 1.2 by the way.

fs.js:887
return binding.unlink(pathModule._makeLong(path));
^
Error: EPERM, operation not permitted 'C:\Pigments.demeteorized\bundle\programs\server\package.json'
at Error (native)
at Object.fs.unlinkSync (fs.js:887:18)
at module.exports (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\update-package.js:34:6
)
at C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer.js:12:5
at ChildProcess. (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\build.js:40:
5)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

@sjmcdowall
Copy link
Contributor

What was your current WD when you ran the demeteorizer command and what command options did you use?

The path C:\Pigments.demeteorized\bundle\ looks rather .. odd..

Also — when did you get the error? From the demeteorizer or the modulus deploy? And what was the command lines for the latter?

On Sep 8, 2015, at 9:39 AM, AndreasGalster [email protected] wrote:

Not sure where to post issues for the beta, there doesn't seem to be a public branch. I'm using the RC-12 of 1.2 by the way.

fs.js:887
return binding.unlink(pathModule._makeLong(path));
^
Error: EPERM, operation not permitted 'C:\Pigments.demeteorized\bundle\programs\server\package.json'
at Error (native)
at Object.fs.unlinkSync (fs.js:887:18)
at module.exports (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\update-package.js:34:6
)
at C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer.js:12:5
at ChildProcess. (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\build.js:40:
5)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)


Reply to this email directly or view it on GitHub #143 (comment).

@fiveisprime
Copy link
Collaborator

That sucks. For some reason, the bundle output is readonly. I was able to
get around that in 1.1, but maybe they broke that in 1.2. :(

@sjmcdowall
Copy link
Contributor

Actually, this is not a 1.2 issue.. I am having the same issue (I just tried it) on my 1.1.0.3 app with the @next version on Windows 7.

I tried looking at the permissions but the output directory seems to disappear if there is an error? At least I can’t even see c:\deploy\RTViewer on the file-system ..

I also note that you no longer output where the Destination Path is going to be upon start up .. that is sort of good information to know in case it’s wrong and you can kill it before it goes too far.. :)

$ demeteorizer -o c:/deploy/RTViewer
Demeteorizing application...

fs.js:772
return binding.unlink(pathModule._makeLong(path));
^
Error: EPERM, operation not permitted 'c:\deploy\RTViewer\bundle\programs\server\package.json'
at Object.fs.unlinkSync (fs.js:772:18)
at module.exports (c:\Users\Steven McDowall\AppData\Roaming\npm\node_modules\demeteorizer\lib\update-package.js:34:
)
at c:\Users\Steven McDowall\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer.js:12:5
at ChildProcess. (c:\Users\Steven McDowall\AppData\Roaming\npm\node_modules\demeteorizer\lib\build.js:40
5)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

Steven McDowall@VM-WIN7-64 ~/work/galaxy/rts/sources/RTViewer (master)
$

@sjmcdowall
Copy link
Contributor

I may have been too hasty on the deletion of the folder -- I was looking in the wrong place. :) If I have a chance I'll take a look at the permissions, etc. once I get my latest version deployed using the old version.

@AndreasGalster
Copy link

I just did demeteorizer, which demeteorizes and bundles stuff up but apparently it misses some really crucial stuff. Sorry, what's WD?

From the modulus logs:
Found package.json: ./C/Pigments/.demeteorized/bundle/programs/server/package.json
WARNING: Main file not specified in package.json.
WARNING: Looking for common main file names: index.js, app.js, server.js, main.js.
ERROR: No main or start script found. There is no application to run.
Found package.json: ./C/Pigments/.demeteorized/bundle/programs/server/package.json
WARNING: Main file not specified in package.json.
WARNING: Looking for common main file names: index.js, app.js, server.js, main.js.
ERROR: No main or start script found. There is no application to run.
Found package.json: ./C/Pigments/.demeteorized/bundle/programs/server/package.json
WARNING: Main file not specified in package.json.
WARNING: Looking for common main file names: index.js, app.js, server.js, main.js.
ERROR: No main or start script found. There is no application to run.
Found package.json: ./C/Pigments/.demeteorized/bundle/programs/server/package.json
WARNING: Main file not specified in package.json.
WARNING: Looking for common main file names: index.js, app.js, server.js, main.js.
ERROR: No main or start script found. There is no application to run.

I have a feeling the actual deploy with modulus deploy .demeteorized/bundle -m would work.

@fiveisprime
Copy link
Collaborator

I have a feeling the actual deploy with modulus deploy .demeteorized/bundle -m would work.

That's important. :)

It's also important that package.json is allowed to be updated. The errors
there are related to not being able to write the file. Demeteorizer adds both
and main file and start script as part of its process.

@AndreasGalster
Copy link

So what can I do to solve this? I really need to launch an MVP tomorrow (8 hours from now preferably). Is something wrong on my end? Can I fix it with a hack? Should I wait for a solution?

@fiveisprime
Copy link
Collaborator

Use the latest version of demeteorizer rather than the beta. The bundle that
generated with the old bundle command doesn't have permissions issues and
should allow you to make it through no problem.

@sjmcdowall
Copy link
Contributor

So are there any nice calls that allows us to change the permissions before we try the unlink -- ??

Also, since it's an unlink -- is the PERM error on the file or the directory containing the file?

@fiveisprime
Copy link
Collaborator

What version of node are you on?

The unlink works as expected on OSX and when I tested on Windows; however, node
did have a bug with how permissions were treated pre-0.12. I tested on 0.12.. so
this may be related.

@sjmcdowall
Copy link
Contributor

Ah -- I am on V 10.0.36 because, as far as I know -- that's still the only node version Meteor officially supports... ??

@fiveisprime
Copy link
Collaborator

Yeah, that's correct. Damn.

@fiveisprime
Copy link
Collaborator

Related: nodejs/node-v0.x-archive#3006

@sjmcdowall
Copy link
Contributor

Fixed in PR # 144 (or whatever it's called) -- this is the EPERM error .. not the original problem..

@AndreasGalster
Copy link

Actually I tried the beta because I got errors with the stable version as well, probably due to the RC :P. Anyway, I don't know I guess I'll deploy on a meteor testserver for now x_x

From the old demeteorizer without setting any demeteorizer parameters. I guess it doesn't work with RCs because bundling is no longer supported in favor of build?

PS C:\Pigments> demeteorizer
Input: C:\Pigments
Output: C:\Pigments.demeteorized
Determining Meteor version...
Meteor version: 1.2-rc.12
Warning: failed to parse version '1.2-rc.x'.
Bundling Meteor App...
This command has been deprecated in favor of 'meteor build', which allows
you to build for multiple platforms and outputs a directory instead of a
single tarball. See 'meteor help build' for more information.

WARNING: The output directory is under your source tree.
meteor bundle generation complete.
Finding dependencies...
C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer.js:345
if (/example|sample|test/g.test(name.toLowerCase())) {
^
TypeError: Cannot read property 'toLowerCase' of undefined
at Demeteorizer.filterDep (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer.j
s:345:39)
at Demeteorizer. (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer
.js:271:33)
at Array.forEach (native)
at Demeteorizer.findDependenciesInFolder (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib
\demeteorizer.js:231:26)
at Demeteorizer. (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer
.js:250:14)
at Array.forEach (native)
at Demeteorizer.findDependenciesInFolder (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib
\demeteorizer.js:231:26)
at Demeteorizer. (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib\demeteorizer
.js:250:14)
at Array.forEach (native)
at Demeteorizer.findDependenciesInFolder (C:\Users\Andreas Galster\AppData\Roaming\npm\node_modules\demeteorizer\lib
\demeteorizer.js:231:26)

@fiveisprime
Copy link
Collaborator

@AndreasGalster #144 should solve this for you. :)

@fiveisprime
Copy link
Collaborator

@next is updated with the fixes for Windows. Update, try again, and let us
know if it's still borked.

@GatorDigital-HQ
Copy link
Author

This was a combination of issues.
#1 It wasn't liking my Mongo credentials that I set in the environment variable
#2 I had something, that I never found, in my code updates that it also didn't like.

So I reverted back to the version before I did any edits and created a new mongo db collection. It's too bad that I have to do two days of edits all over again but at least it's getting deployed now.

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

No branches or pull requests

4 participants