ood-ansible
ood-ansible copied to clipboard
Building from src fails on Ubuntu Focal 20.04
Running the ansible-playbook with 'install_from_src: true' on Ubuntu Focal 20.04 results in the playbook failing when it comes to compiling the source.
This is the build.out file:
PASSENGER_APP_ENV=production /tmp/ood-build/ondemand/apps/shell/bin/setup PASSENGER_APP_ENV=production /tmp/ood-build/ondemand/apps/files/bin/setup cd /tmp/ood-build/ondemand/apps/activejobs bin/bundle install --jobs 4 --retry 2 --without doc cd /tmp/ood-build/ondemand/apps/files rm -rf node_modules npm install --production --prefix tmp yarn
== Building Files App ==
== Installing dependencies == cd /tmp/ood-build/ondemand/apps/shell rm -rf node_modules npm install --production --prefix tmp yarn
== Building Shell App ==
== Installing dependencies ==
/usr/lib/ruby/2.7.0/rubygems.rb:930: warning: FILE in eval may not return location in binding; use Binding#source_location instead
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/rubygems_integration.rb:501: warning: in eval' Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running gem install bundler`.
Fetching gem metadata from https://rubygems.org/.npm WARN saveError ENOENT: no such file or directory, open '/tmp/ood-build/ondemand/apps/files/tmp/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/tmp/ood-build/ondemand/apps/files/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.
npm WARN saveError ENOENT: no such file or directory, open '/tmp/ood-build/ondemand/apps/shell/tmp/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/tmp/ood-build/ondemand/apps/shell/tmp/package.json' npm WARN tmp No description npm WARN tmp No repository field. npm WARN tmp No README data npm WARN tmp No license field.
.+ [email protected] added 1 package and audited 1 package in 1.009s found 0 vulnerabilities
tmp/node_modules/yarn/bin/yarn --production install --flat --cache-folder /root/.cache/yarn/ood-shell-app
- [email protected] added 1 package and audited 1 package in 1.139s found 0 vulnerabilities
tmp/node_modules/yarn/bin/yarn --production install --cache-folder /root/.cache/yarn/ood-files-app .yarn install v1.22.4 [1/4] Resolving packages... warning Lockfile has incorrect entry for "[email protected]". Ignoring it. .yarn install v1.22.4 [2/4] Fetching packages... .[3/4] Linking dependencies... [1/4] Resolving packages... .warning Resolution field "[email protected]" is incompatible with requested version "[email protected]" warning Resolution field "[email protected]" is incompatible with requested version "ponse@~1.4.1" warning Resolution field "[email protected]" is incompatible with requested version "ponse@~1.4.1" warning Resolution field "[email protected]" is incompatible with requested version "ponse@~1.4.1" warning Resolution field "[email protected]" is incompatible with requested version "ponse@^1.4.1" warning Resolution field "[email protected]" is incompatible with requested version "ponse@^1.6.0" warning Resolution field "[email protected]" is incompatible with requested version "ponse@~1.4.1" .[2/4] Fetching packages... .[4/4] Building fresh packages... ..error /tmp/ood-build/ondemand/apps/shell/node_modules/node-pty: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: /tmp/ood-build/ondemand/apps/shell/node_modules/node-pty Output: events.js:174 throw er; // Unhandled 'error' event ^
Error: spawn node-gyp ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
/usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/file_utils.rb:67:in block in create_shell_runner': Command failed with status (1): [tmp/node_modules/yarn/bin/yarn --productio...] (RuntimeError) from /usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/file_utils.rb:57:in sh'
from /tmp/ood-build/ondemand/apps/shell/bin/setup:20:in block in <main>' from /usr/lib/ruby/2.7.0/fileutils.rb:139:in chdir'
from /usr/lib/ruby/2.7.0/fileutils.rb:139:in cd' from /usr/share/rubygems-integration/all/gems/rake-13.0.1/lib/rake/file_utils_ext.rb:35:in chdir'
from /tmp/ood-build/ondemand/apps/shell/bin/setup:11:in <main>' rake aborted! Command failed with status (1): [PASSENGER_APP_ENV=production /tmp/ood-buil...] /tmp/ood-build/ondemand/Rakefile:103:in block (3 levels) in <top (required)>'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => build => build:all => build:shell
(See full trace by running task with --trace)
--- ERROR REPORT TEMPLATE -------------------------------------------------------
-
What did you do?
I ran the command
bin/bundle install --jobs 4 --retry 2 --without doc -
What did you expect to happen?
I expected Bundler to...
-
What happened instead?
Instead, what happened was...
Error details
SignalException: SIGHUP
/usr/lib/ruby/2.7.0/net/protocol.rb:217:in `wait_readable'
/usr/lib/ruby/2.7.0/net/protocol.rb:217:in `rbuf_fill'
/usr/lib/ruby/2.7.0/net/protocol.rb:191:in `readuntil'
/usr/lib/ruby/2.7.0/net/protocol.rb:201:in `readline'
/usr/lib/ruby/2.7.0/net/http/response.rb:42:in `read_status_line'
/usr/lib/ruby/2.7.0/net/http/response.rb:31:in `read_new'
/usr/lib/ruby/2.7.0/net/http.rb:1528:in `block in transport_request'
/usr/lib/ruby/2.7.0/net/http.rb:1519:in `catch'
/usr/lib/ruby/2.7.0/net/http.rb:1519:in `transport_request'
/usr/lib/ruby/2.7.0/net/http.rb:1492:in `request'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/vendor/net/http/persistent.rb:999:in `request'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/downloader.rb:48:in `request'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/downloader.rb:16:in `fetch'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:56:in `block in unmarshalled_dep_gems'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:55:in `each'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:55:in `each_slice'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:55:in `unmarshalled_dep_gems'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:49:in `dependency_specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:31:in `block in specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/retry.rb:39:in `run'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/retry.rb:29:in `attempt'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:30:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher/dependency.rb:35:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher.rb:128:in `block in specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher.rb:127:in `each'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher.rb:127:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher.rb:112:in `block in specs_with_retry'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/retry.rb:39:in `run'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/retry.rb:29:in `attempt'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/fetcher.rb:111:in `specs_with_retry'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/source/rubygems.rb:355:in `block (2 levels) in remote_specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/source/rubygems.rb:353:in `each'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/source/rubygems.rb:353:in `block in remote_specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/index.rb:10:in `build'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/source/rubygems.rb:336:in `remote_specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/source/rubygems.rb:83:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/lazy_specification.rb:61:in `__materialize__'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/spec_set.rb:91:in `block in materialize'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/spec_set.rb:88:in `map!'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/spec_set.rb:88:in `materialize'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/definition.rb:174:in `specs'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/definition.rb:162:in `resolve_remotely!'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/installer.rb:225:in `resolve_if_need'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/installer.rb:78:in `run'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/installer.rb:24:in `install'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/cli/install.rb:71:in `run'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/cli.rb:189:in `install'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/var/lib/gems/2.7.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
bin/bundle:3:in `load'
bin/bundle:3:in `<main>'
Environment
Bundler 1.13.7 Rubygems 3.1.2 Ruby 2.7.0p0 (2019-12-25 revision 647ee6f091eafcce70ffb75ddf7e121e192ab217) [x86_64-linux-gnu] GEM_HOME /var/lib/gems/2.7.0 GEM_PATH /var/lib/gems/2.7.0:/root/.gem/ruby/2.7.0:/usr/lib/ruby/gems/2.7.0:/usr/share/rubygems-integration/2.7.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0 Git 2.25.1
Bundler settings
retry Set for your local app (/tmp/ood-build/ondemand/apps/activejobs/.bundle/config): 2 jobs Set for your local app (/tmp/ood-build/ondemand/apps/activejobs/.bundle/config): 4 without Set for your local app (/tmp/ood-build/ondemand/apps/activejobs/.bundle/config): "doc" gemfile Set via BUNDLE_GEMFILE: "/tmp/ood-build/ondemand/apps/activejobs/Gemfile" --- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error: https://github.com/bundler/bundler/search?q=SIGHUP&type=Issues
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/bundler/bundler/issues/new
Hi! Thanks for the ticket.
There was an issue with the version of nodejs on Ubuntu systems. How did these tasks complete? Where they skipped? They should have executed for you, updated the nodejs repository to be the correct version and then you should have installed nodejs 10.
https://github.com/OSC/ood-ansible/blob/b00441abd3c6c263de448fc3286a6bcf651adf60/tasks/deps.yml#L9-L24
The source compile still fails in the same spot as my original build.log. The ansible task failed.
TASK [ondemand : build the project (this will take some time)] ******************************************************************************************* fatal: [gamgee.it.deakin.edu.au]: FAILED! => {"changed": true, "cmd": "rake build -mj$(nproc) > build.out 2>&1", "delta": "0:00:28.373718", "end": "2020-08-20 16:53:43.966676", "msg": "non-zero return code", "rc": 1, "start": "2020-08-20 16:53:15.592958", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
nodejs --version v10.19.0
The source compile still fails in the same spot as my original build.log. The ansible task failed.
TASK [ondemand : build the project (this will take some time)] ******************************************************************************************* fatal: [gamgee.it.deakin.edu.au]: FAILED! => {"changed": true, "cmd": "rake build -mj$(nproc) > build.out 2>&1", "delta": "0:00:28.373718", "end": "2020-08-20 16:53:43.966676", "msg": "non-zero return code", "rc": 1, "start": "2020-08-20 16:53:15.592958", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
nodejs --version v10.19.0
Hey sorry for the delay. The root of our issues is the node version it's finding is not high enough. I can't replicate on a new Ubuntu instance in GCP or in a container.
One hint I think is that I have no nodejs only node. This is true in both a container and on a real VM.
You see here, the npm in my $PATH (/usr/bin/npm, which uses #!/usr/bin/env node shebang) identifies node version 10.
jeffo_ci@test:/tmp/ood-build/ondemand$ npm version
{ npm: '6.14.8',
ares: '1.15.0',
brotli: '1.0.7',
cldr: '35.1',
http_parser: '2.9.3',
icu: '64.2',
modules: '64',
napi: '7',
nghttp2: '1.41.0',
node: '10.23.0',
openssl: '1.1.1g',
tz: '2019c',
unicode: '12.1',
uv: '1.34.2',
v8: '6.8.275.32-node.59',
zlib: '1.2.11' }
You may need to purge your node environment or find out where this nodejs is coming from.
Hi,
it is maybe too late but I encountered a similar issue than @rruge61 with rake build -mj$(nproc) > build.out 2>&1 failing, trying to run the ansible playbook on a Ubuntu 18.04 in a VM.
Logging on the machine, and looking at the build.out file which is located in /tmp/ood-build/ondemand/build.out, it was indeed indicated that bundler was not at the right version and the failure even mentionned the fix in the log :
sudo gem install bundler:2.1.4
which solved the issue on my side and the rake build then succeeded.
Make sure that ood_source_version: "v1.8.19" is set otherwise it'll try to build the master which isn't released yet and has some undocumented features (like our upgrade to bundler 2).
I've just submitted #89 for the same.
:facepalm: of course v1.8.19 now fails because of mimemagic dependencies that don't exist anymore.
OK - 1.8.19 can't be built anymore because that dependency no longer exists. ood_source_version: "update-rails-1.8" should work for you until we get that patch released.
The role isn't quite up to date yet with all the configurations that are currently in master, so there may be some other issue you have when you build a 2.0+ but still have 1.8 configurations.
For anyone with the same bundler error you can now use ood_source_version: "release_1.8" until we release 1.8.20 because https://github.com/OSC/ondemand/pull/1028 was merged into it.
The default source version is now the tag ood_source_version: "v1.8.20" for anyone reading these intermediate comments.
@rruge61 Re-reading the initial ticket I see the command it fails on. And I found that installing nodejs provides the following system installed npm package /usr/lib/node_modules/npm/node_modules/node-gyp.
So I would check if that's the actual directory you're installing node packages in. In a ubuntu:20.04 container this seems to work for me. Do you have an NODE or NPM related environment variables set?
If you do install node packages into some non standard place, you may need to set NODE_PATH to this location.
OR simply system install node-gyp with sudo npm install -g node-gyp to install it globally.
OK last comment for a while I promise.
This also may have something to do with the version of python you're running. I've seen other comments when I google Error: spawn node-gyp ENOENT about setting the npm config to something similar to this npm config set python /usr/bin/python3.
The output of node-gyp.js configure for my container is below (with some lines removed for brevity). It could be that you're missing some dependency here.
root@b8f225463d52:/tmp# /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [ '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
...
Not sure if related, but also on a new Ubuntu Focal and 'install_from_src: true' I got:
TASK [osc.open_ondemand : init the passenger src directory] ************************************************************************************************************************************************** fatal: [x]: FAILED! => {"changed": false, "msg": "There was an issue creating /tmp/ood-build/passenger-src as requested: [Errno 13] Permission denied: b'/tmp/ood-build/passenger-src'", "path": "/tmp/ood-build/passenger-src"}
@Juanjdurillo I opened a new ticket #109 as it seems like your issue is slightly different.