# Surge.sh deployment broken?

**URL:** <https://travis-ci.community/t/surge-sh-deployment-broken/4471>\
**Category:** Deployment\
**Tags:** deployment\
**Created:** [July 31, 2019, 3:20pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471 "2019-07-31T15:20:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [July 31, 2019, 3:20pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/1 "2019-07-31T15:20:34Z")

</div>

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

```auto
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:

```auto
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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 31, 2019, 3:32pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/2 "2019-07-31T15:32:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [August 1, 2019, 8:45am UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/3 "2019-08-01T08:45:29Z")

</div>

Sure!  
Here is a correctly configured build for which the surge deployment fails silently: [https://travis-ci.org/Protelis/Protelis-Parser/jobs/562988802](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](https://travis-ci.org/Protelis/Protelis-Parser/jobs/565998803)

Thanks

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 1, 2019, 1:00pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/4 "2019-08-01T13:00:11Z")

</div>

Somehow it is not installing the `surge` package; compare [https://travis-ci.org/Protelis/Protelis-Parser/jobs/536150675#L837](https://travis-ci.org/Protelis/Protelis-Parser/jobs/536150675#L837) and [https://travis-ci.org/Protelis/Protelis-Parser/jobs/562988802#L681](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](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?

---

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [August 1, 2019, 1:13pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/5 "2019-08-01T13:13:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 1, 2019, 1:18pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/6 "2019-08-01T13:18:51Z")

</div>

> [@DanySK](#):
>
> Is there any debug output that I can print `after_success` that may be of help?

`which surge` would help.

---

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [August 6, 2019, 12:03pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/7 "2019-08-06T12:03:03Z")

</div>

Here it is, version with manually installed surge:  
[https://travis-ci.org/Protelis/Protelis-Parser/jobs/568321940](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](https://travis-ci.org/Protelis/Protelis-Parser/jobs/568322772)

Only the former has surge installed according to `which` output.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 6, 2019, 12:36pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/8 "2019-08-06T12:36:11Z")

</div>

Here’s another hypothesis: you are using [`language: bash` on Xenial](https://travis-ci.org/Protelis/Protelis-Parser/jobs/568322772/config), 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.

---

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [August 6, 2019, 12:41pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/9 "2019-08-06T12:41:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [November 22, 2019, 6:46pm UTC](https://travis-ci.community/t/surge-sh-deployment-broken/4471/10 "2019-11-22T18:46:46Z")

</div>

> [@BanzaiMan](#):
>
> Here’s another hypothesis: you are using [`language: bash` on Xenial](https://travis-ci.org/Protelis/Protelis-Parser/jobs/568322772/config), and this image _may_ (needs confirmation) not have a Node.js runtime that enables the surge package to be installed.

Confirmed that. Compare build system info for Xenial [with `language: shell`](https://travis-ci.org/Protelis/Protelis-Parser/jobs/568322772#L109) vs [`language: generic`](https://travis-ci.org/native-api/test_travis/jobs/603144061#L135).

However, in `language: generic`, `surge` is still unavailable on `PATH`, [even if I activate a Node.js installation](https://travis-ci.org/native-api/Protelis-Parser/jobs/615662051), and I don’t see it installed anywhere in `dpl v1` source.
