Surge.sh deployment broken?

Hi, all my surge deployments stopped working.
I tried to deploy by writing the script by hand, and it failed because the version of node installed by using

addons:
  apt:
    packages:
    - nodejs
    - nodejs-legacy
    - npm

Is too outdated.
I reconfigured the build to install the latest node manually and deploy with a script, and both the manual deployment and the configured deployment worked (wtf).

I hypothesised a node version issue, so I remove the by-hand deployment and left the installation of node there. Deployment fails:

e[0K$ rvm $(travis_internal_ruby) --fuzzy do ruby -S gem install dpl
Successfully installed dpl-1.10.12
1 gem installed
travis_time:end:234a0668:start=1564575634511190604,finish=1564575636208663933,duration=1697473329
e[0Ktravis_fold:end:dpl_1
e[0Ktravis_time:start:10973e9b
e[0Ktravis_fold:start:dpl.1
e[33mInstalling deploy dependenciese[0m
Successfully installed dpl-surge-1.10.12
1 gem installed
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/lib/node_modules'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-07-31T12_20_41_407Z-debug.log

travis_fold:end:dpl.1
travis_fold:start:dpl.2
e[33mPreparing deploye[0m

travis_fold:end:dpl.2
travis_fold:start:dpl.3

The only way to get this back to a working state is to manually install the latest Node.js and surge. At this point, the deployment works.

install:
        - "curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -"
        - sudo apt-get install -y nodejs
        - sudo npm install --global surge

Note: Travis seems to be getting more and more fragile. I recently spent more time debugging my Travis builds than my software.

When reporting a problem, please include the build URL so that we can help you better. Thanks.

Sure!
Here is a correctly configured build for which the surge deployment fails silently: https://travis-ci.org/Protelis/Protelis-Parser/jobs/562988802

Here is a build with the same surge configuration, but with surge manually installed, that succeeds:
https://travis-ci.org/Protelis/Protelis-Parser/jobs/565998803

Thanks

Somehow it is not installing the surge package; compare https://travis-ci.org/Protelis/Protelis-Parser/jobs/536150675#L837 and https://travis-ci.org/Protelis/Protelis-Parser/jobs/562988802#L681

I tried duplicating this error, but I could not. https://travis-ci.org/BanzaiMan/travis_production_test/builds/566461523#L199

We rely on the presence of the command surge to decide whether or not we run npm install -g surge. Does your job somehow changed to recognize this command?

Uhmm… no. It’s a plain Java + Maven build. Is there any debug output that I can print after_success that may be of help?

which surge would help.

Here it is, version with manually installed surge:
https://travis-ci.org/Protelis/Protelis-Parser/jobs/568321940

Version with no manual intervention for surge install:
https://travis-ci.org/Protelis/Protelis-Parser/jobs/568322772

Only the former has surge installed according to which output.

Here’s another hypothesis: you are using language: bash on Xenial, and this image may (needs confirmation) not have a Node.js runtime that enables the surge package to be installed. And we are silently failing.

Sounds likely. I can switch some of the builds (but not all of them) to bionic, but the build should not fail silently anyway. Can you reproduce with language: bash and xenial?

Confirmed that. Compare build system info for Xenial with language: shell vs language: generic.

However, in language: generic, surge is still unavailable on PATH, even if I activate a Node.js installation, and I don’t see it installed anywhere in dpl v1 source.