meteorhacks / meteord

MeteorD - Docker Runtime for Meteor Apps for Production Deployments
https://registry.hub.docker.com/u/meteorhacks/meteord/
MIT License
438 stars 371 forks source link

meteorhacks:npm issue #89

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi,

I deploy my meteor application as a Docker container and my Dockerfile looks like this:

Dockerfile

FROM meteorhacks/meteord:onbuild

Everything works perfect but as soon as I add npm to my app ...

npm for meteor

meteor add meteorhacks:npm

... the log shows the following error message (the log is upside down) upon deployment.

Do you know what's going on here and how I can fix that?

Error log

2016-04-03T08:46:47.456Z: The command '/bin/sh -c bash $METEORD_DIR/on_build.sh' returned a non-zero code: 8
2016-04-03T08:46:47.456Z: Deploy failed
2016-04-03T08:46:47.456Z: Error while building Docker. Aborting. Please check the documentation about Docker configuration
2016-04-03T08:46:46.495Z: Waiting for deploy file...
2016-04-03T08:46:46.494Z: PROCTITLE proctitle=2F7573722F62696E2F646F636B6572006461656D6F6E002D480066643A2F2F
2016-04-03T08:46:46.493Z: SYSCALL arch=c000003e syscall=44 success=yes exit=32 a0=e a1=c820e9e9e0 a2=20 a3=0 items=0 ppid=1 pid=378 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="docker" exe="/usr/x86_64-pc-linux-gnu/bin/docker" subj=kernel key=(null)
2016-04-03T08:46:46.492Z: ANOM_PROMISCUOUS dev=veth1e9a371 prom=0 old_prom=256 auid=4294967295 uid=0 gid=0 ses=4294967295
2016-04-03T08:46:46.489Z:    at Command.main.registerCommand._.extend.name [as func] (/tools/cli/commands.js:789:12)
2016-04-03T08:46:46.489Z:    at /tools/cli/main.js:1408:23
2016-04-03T08:46:46.488Z:    at Object.capture (/tools/utils/buildmessage.js:252:19)
2016-04-03T08:46:46.488Z:    at Object.main.captureAndExit (/tools/cli/main.js:279:29)
2016-04-03T08:46:46.488Z:    at buildCommand (/tools/cli/commands.js:835:8)
2016-04-03T08:46:46.487Z:    at /tools/utils/buildmessage.js:253:23
2016-04-03T08:46:46.487Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.487Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.486Z:    at /tools/utils/buildmessage.js:264:29
2016-04-03T08:46:46.486Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.486Z:    at /tools/utils/buildmessage.js:262:18
2016-04-03T08:46:46.485Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.485Z:    at /tools/utils/buildmessage.js:271:13
2016-04-03T08:46:46.484Z:    at /tools/cli/commands.js:836:20
2016-04-03T08:46:46.480Z:    at ProjectContext.prepareProjectForBuild (/tools/project-context.js:259:13)
2016-04-03T08:46:46.479Z:    at Function.run (/tools/tool-env/profile.js:489:12)
2016-04-03T08:46:46.479Z:    at /tools/project-context.js:260:12
2016-04-03T08:46:46.477Z:    at ProjectContext._completeStagesThrough (/tools/project-context.js:268:18)
2016-04-03T08:46:46.476Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.476Z:    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
2016-04-03T08:46:46.475Z:    at /tools/utils/buildmessage.js:350:23
2016-04-03T08:46:46.475Z:    at /tools/utils/buildmessage.js:352:34
2016-04-03T08:46:46.475Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.474Z:    at /tools/utils/buildmessage.js:359:18
2016-04-03T08:46:46.474Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.473Z:    at /tools/project-context.js:278:9
2016-04-03T08:46:46.471Z:    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
2016-04-03T08:46:46.471Z:    at ProjectContext._.extend._buildLocalPackages (/tools/project-context.js:757:18)
2016-04-03T08:46:46.470Z:    at /tools/utils/buildmessage.js:350:23
2016-04-03T08:46:46.470Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.469Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.468Z:    at /tools/utils/buildmessage.js:352:34
2016-04-03T08:46:46.466Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.465Z:    at /tools/utils/buildmessage.js:359:18
2016-04-03T08:46:46.462Z:    at /tools/project-context.js:758:25
2016-04-03T08:46:46.462Z:    at [object Object].buildLocalPackages (/tools/isobuild/isopack-cache.js:74:24)
2016-04-03T08:46:46.461Z:    at [object Object].eachPackage (/tools/packaging/package-map.js:49:7)
2016-04-03T08:46:46.460Z:    at /tools/packaging/package-map.js:57:7
2016-04-03T08:46:46.460Z:    at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.3.0_3.fc5itk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
2016-04-03T08:46:46.460Z:    at /tools/isobuild/isopack-cache.js:75:14
2016-04-03T08:46:46.459Z:    at Isopack._.extend.saveToPath (/tools/isobuild/isopack.js:1641:7)
2016-04-03T08:46:46.459Z:    at /tools/isobuild/isopack-cache.js:323:23
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:352:34
2016-04-03T08:46:46.459Z:    at [object Object]._loadLocalPackage (/tools/isobuild/isopack-cache.js:260:18)
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:350:23
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at /tools/isobuild/isopack-cache.js:194:16
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:350:23
2016-04-03T08:46:46.459Z:    at Function.time (/tools/tool-env/profile.js:305:10)
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:352:34
2016-04-03T08:46:46.459Z:    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:359:18
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at /tools/isobuild/isopack-cache.js:193:17
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at [object Object]._ensurePackageLoaded (/tools/isobuild/isopack-cache.js:184:20)
2016-04-03T08:46:46.459Z:    at [object Object].withValue (/tools/utils/fiber-helpers.js:89:14)
2016-04-03T08:46:46.459Z:    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
2016-04-03T08:46:46.459Z:    at /tools/utils/buildmessage.js:359:18
2016-04-03T08:46:46.174Z:    at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.3.0_3.fc5itk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
2016-04-03T08:46:46.174Z:    at Array.forEach (native)
2016-04-03T08:46:46.174Z:    at _.each.builder.copyDirectory.from (/tools/isobuild/isopack.js:1372:11)
2016-04-03T08:46:46.174Z:    at /tools/isobuild/isopack.js:1263:9
2016-04-03T08:46:46.173Z:      throw error;
2016-04-03T08:46:46.173Z:    at /tools/isobuild/isopack.js:1400:27
2016-04-03T08:46:46.173Z:    at Builder.writeToGeneratedFilename (/tools/isobuild/builder.js:382:10)
2016-04-03T08:46:46.173Z: /root/.meteor/packages/meteor-tool/.1.3.0_3.fc5itk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:116
2016-04-03T08:46:46.173Z:    at Builder.write (/tools/isobuild/builder.js:251:13)
2016-04-03T08:46:46.173Z: 
2016-04-03T08:46:46.173Z: Error: Builder can not write without either data or a file path or a symlink path: os/packages/packages.json
2016-04-03T08:46:46.173Z:    at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.3.0_3.fc5itk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
2016-04-03T08:46:46.173Z:            ^
2016-04-03T08:46:46.173Z:    at Array.forEach (native)
jacobdr commented 8 years ago

I saw this issue previously. The easiest solution is to remove the meteorhacks:npm (and meteorhacks:npm-container I think...) if you have those as dependencies, and just use the native ES2016 module loading capabilities of Meteor.

So any packages you have in packages.json should end up in a standard nodejs package.json file at the root level of your application.

Example: meteor remove react meteor npm install --save react/react

ghost commented 8 years ago

Okay, I'll try that. Thanks.