greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
182 stars 73 forks source link

Command Not Found (127) #185

Closed dargmuesli closed 6 years ago

dargmuesli commented 6 years ago

Travis suddenly outputs

$ greenkeeper-lockfile-update
greenkeeper-lockfile-update: command not found
The command "greenkeeper-lockfile-update" failed and exited with 127 during .
Your build has been stopped.

Older builds that initialially worked are failing now too because of that. I received an email today saying "A GitHub App, Greenkeeper, installed on your account is requesting updated permissions." and I allowed the requested permissions ... is that related?

8eecf0d2 commented 6 years ago

I also updated permissions and all builds since then have failed.

example: https://travis-ci.org/8eecf0d2/jagwah/builds/404750958#L452

janl commented 6 years ago

@Dargmuesli @8eecf0d2 how are you installing greenkeeper-lockfile in your .travis.yml?

The permissions update is unrelated to this.

8eecf0d2 commented 6 years ago

the .travis.yml being used:

language: node_js

node_js:
  - 'stable'

before_install: yarn global add greenkeeper-lockfile@1
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
janl commented 6 years ago

@8eecf0d2 thanks! I’m not too versed with yarn on Travis myself, but this looks all proper. The command not found error is when the binaries in before_script and after_script can’t be found in PATH.

From the yarn add log, I see this line:

success Installed "greenkeeper-lockfile@1.15.1" with binaries:

which suggests to me it should have a list of binaries that the installation provided, but that list is empty, so maybe this is a yarn issue? I did a quick scan of their issue tracker, but couldn’t find anything particularly relevant (other than https://github.com/yarnpkg/yarn/issues/5267 which might suggest we need to use ./ in our bin definitions, which I’m happy to try later.

As a workaround, could you try installing greenkeeper-lockfile with npm?

In the meantime, I’ll see if I can reproduce this issue, but it might take a while.

8eecf0d2 commented 6 years ago

Looks like it's resolved by using npm: https://travis-ci.org/8eecf0d2/jagwah/builds/404785416

Thanks for the quick responses btw!

The lack of output after:

success Installed "greenkeeper-lockfile@1.15.1" with binaries:

does seems a bit odd but previous successful builds produced the same output. From what I can tell there's no differences leading up to these two builds #56 passed and #59 errored.

janl commented 6 years ago

@8eecf0d2 I agree, those runs look similar enough that they shouldn’t behave this differently. Glad to hear the npm workaround helped for now!

8eecf0d2 commented 6 years ago

well, seems like it's related to the binary, more specifically the $PATH variable not having yarn's bin directory on it.

Either way it can be resolved by adding the path:

before_install:
  - export PATH="$(yarn global bin):$PATH"
  - yarn global add greenkeeper-lockfile@1

Will debug more later on but for now it's working with yarn.

dargmuesli commented 6 years ago

Seems to be fixed with https://github.com/travis-ci/travis-build/pull/1436. Thanks for the quick fix!