ryanj / origin-s2i-nodejs

A basic Source to Image builder for OpenShift Origin, with runtime binaries from Nodejs.org
https://hub.docker.com/r/ryanj/centos7-s2i-nodejs/
Apache License 2.0
20 stars 30 forks source link

PhantonJS failed to install #8

Closed rafabene closed 8 years ago

rafabene commented 8 years ago

It may need to include bzip in the builder image since phantomjs fails to install after downloading it.

It complains that the bzip was not found in the path

rafabene commented 8 years ago

These are the error messages:

PhantomJS not found on PATH Download already available at /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 Verified checksum of previously downloaded file Extracting tar contents (via spawned process) E0421 16:45:26.557213 1 util.go:91] Error extracting archive E0421 16:45:26.588128 1 util.go:91] Phantom installation failed { [Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 E0421 16:45:26.588352 1 util.go:91] tar (child): bzip2: Cannot exec: No such file or directory E0421 16:45:26.588367 1 util.go:91] tar (child): Error is not recoverable: exiting now E0421 16:45:26.588378 1 util.go:91] tar: Child returned status 2 E0421 16:45:26.588387 1 util.go:91] tar: Error is not recoverable: exiting now E0421 16:45:26.588396 1 util.go:91] ] E0421 16:45:26.588406 1 util.go:91] killed: false, E0421 16:45:26.588415 1 util.go:91] code: 2, E0421 16:45:26.588424 1 util.go:91] signal: null, E0421 16:45:26.588435 1 util.go:91] cmd: 'tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 E0421 16:45:26.588445 1 util.go:91] tar (child): bzip2: Cannot exec: No such file or directory E0421 16:45:26.588454 1 util.go:91] tar (child): Error is not recoverable: exiting now E0421 16:45:26.588463 1 util.go:91] tar: Child returned status 2 E0421 16:45:26.588472 1 util.go:91] tar: Error is not recoverable: exiting now

ryanj commented 8 years ago

@rafabene Let me know if the latest build provides a fix

rafabene commented 8 years ago

Yey! Now the installation of patternfly doesn't break any more. Anyway I still see a message complaining about bower. I'm not sure if we should provide that or not. Here is the log:

E0422 11:15:42.322620 1 util.go:91] npm info lifecycle phantomjs@1.9.20~install: phantomjs@1.9.20 2589 > phantomjs@1.9.20 install /opt/app-root/src/node_modules/patternfly/node_modules/bootstrap-treeview/node_modules/phantomjs 2590 > node install.js 2591
2592 PhantomJS not found on PATH 2593 Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2 2594 Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 2595 Receiving... 2596
2597 Received 12854K total. 2598 Extracting tar contents (via spawned process) 2599 Removing /opt/app-root/src/node_modules/patternfly/node_modules/bootstrap-treeview/node_modules/phantomjs/lib/phantom 2600 Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1461338147654/phantomjs-1.9.8-linux-x86_64 -> /opt/app-root/src/node_modules/patternfly/node_modules/bootstrap-treeview/node_modules/phantomjs/lib/phantom 2601 Writing location.js file 2602 Done. Phantomjs binary available at /opt/app-root/src/node_modules/patternfly/node_modules/bootstrap-treeview/node_modules/phantomjs/lib/phantom/bin/phantomjs 2603 E0422 11:15:52.905197 1 util.go:91] npm info lifecycle bootstrap-treeview@1.2.0~install: bootstrap-treeview@1.2.0 2604
2605 > bootstrap-treeview@1.2.0 install /opt/app-root/src/node_modules/patternfly/node_modules/bootstrap-treeview 2606 > bower install 2607
2608 E0422 11:15:52.982460 1 util.go:91] sh: bower: command not found 2609 E0422 11:15:52.982502 1 util.go:91] npm info lifecycle bootstrap-treeview@1.2.0~install: Failed to exec install script 2610 E0422 11:15:52.982513 1 util.go:91] npm WARN install:bootstrap-treeview@1.2.0 bootstrap-treeview@1.2.0 install: bower install 2611 E0422 11:15:52.982533 1 util.go:91] npm WARN install:bootstrap-treeview@1.2.0 spawn ENOENT 2612 E0422 11:15:52.982545 1 util.go:91] npm info lifecycle bindings@1.2.1~install: bindings@1.2.1 2613 E0422 11:15:52.982551 1 util.go:91] npm info lifecycle nan@2.2.1~install: nan@2.2.1 2614 E0422 11:15:52.982566 1 util.go:91] npm info lifecycle contextify@0.1.15~install: contextify@0.1.15

ryanj commented 8 years ago

Here is the error I'm getting from npm install bower (inside a built container):

fatal: unable to look up current user in the passwd file: no such user

I think this is due to our randomization of the runtime UID. We may need to add something to the passwd file to ensure this dependency expectation will be fulfillable.

I'll open a new issue for this https://github.com/openshift/s2i-base/issues/91

Thanks for testing, @rafabene!

ryanj commented 8 years ago

As a workaround you can npm install bower locally, then commit your node_modules folder. If it's already available in the repo, npm install should skip over it.

rafabene commented 8 years ago

Thanks @ryanj 👍 for fixing it and for the feedback.