@jdxcode I'm still experiencing #653 . Whenever I delete ~/.local/share/heroku/client heroku works for a while, then randomly starts throwing the same error again.
Removing the directory fixes it again. For a while.
Is there anything else I should do?
heroku version says heroku-cli/6.15.13-3dce47c (darwin-x64) node-v9.3.0. I installed via the heroku installer if I'm not mistaken.
The core brew formula is still on 6.15.11 which has the bug that caused this for some users... but since you're on 13 I suppose that's less likely. Can you email me the contents of /usr/local/Cellar/heroku (if it exists) and ~/.local/share/heroku? ([email protected]). We don't store any sensitive data in these locations.
also tell me what the output of which heroku is, and if it's /usr/local/bin/heroku, what the output of ls -l /usr/local/bin/heroku is?
which heroku 👉 /usr/local/bin/heroku
ls -l 👇
lrwxr-xr-x 1 Swizec admin 35 Jan 9 14:26 /usr/local/bin/heroku -> ../Cellar/heroku/6.15.13/bin/heroku
Emailing the two folders.
the way our updater works with brew (which is how you have it installed) is a little funky and it can sometimes run older versions for a bit. Why is complicated, but I've thought through the logic and it's certainly possible that our CLI could've updated to 6.15.13 in the background with 6.15.11. The bug is part of the update logic of 6.15.11, so after it updated to 6.15.13 it may have occurred once more.
So I think you should be good now. If it ever happens again let me know. Definitely give me a tarball of that directory too.
oh and I didn't get an email, I checked spam but it's possible salesforce may have blocked it... if you do need to send it to me again, see if you can get me a dropbox link or something like that maybe
Ah, maybe the large-ish zip files got blocked.
Here as dropbox links:
https://www.dropbox.com/s/5h0bkuqwu39bm1f/local-share-heroku.zip?dl=0
https://www.dropbox.com/s/2xp6wmj8dv8okv7/usr-local-cellar-heroku.zip?dl=0
This has also happened to me twice. This time, I went to install the CLI from 'Getting Started on Heroku with Python.' However I found #653 again, and followed brew uninstall, then install. The problem persists after that process.
cross posting here from #653:
So there are 2 issues here. The ones the users had back in December/January are not the ones you guys are having now. That was affecting most users and was quickly fixed, but took a while to roll out and clear out stale code that kept making it reappear.
It's apparent that there is another issue that is causing a small number of users to have to reset their CLI weekly. I've been pulling my hair out digging through the code trying to figure out what it is but have come up short. You have no idea how much this has been on my mind. I haven't said much about it because I haven't figured anything out.
I'm not sure what it is but I think it might be something with our bash script on certain machines running symlinks. It might also be stale code that keeps getting executed on your machine.
I just pushed out a potential fix that moves one of the files from a symlink into a real file. If you update to 6.15.38, let me know if you see it happen again. It might also be a good idea to try the pkg installer as that might solve an issue with stale code being loaded.
If this is really causing you pain, just use npm install -g heroku-cli and that will never autoupdate.
In any case, with this new change, if I get a new traceback after this happens on version 6.15.38+, it will give me more information on what the root cause. So please keep me informed but hopefully this will resolve the issue.
This is still happening on MacOS.
$ heroku
module.js:557
throw err;
^
Error: Cannot find module '@cli-engine/engine'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/skyace/.local/share/heroku/client/bin/heroku.js:2:15)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
It surprised me because it was working properly literally an hour ago and now it doesn't - I haven't been doing anything brew or heroku related in the last hour so it must have autoupdated itself.
$ brew info heroku
heroku: stable 6.16.3 (bottled), HEAD
/usr/local/Cellar/heroku/6.15.39 (11,004 files, 39.4MB)
Poured from bottle on 2018-03-26 at 10:53:03
/usr/local/Cellar/heroku/6.16.3 (10,998 files, 38.6MB) *
Built from source on 2018-03-29 at 11:45:11
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/heroku.rb
It shows two versions, but it uses the latest one properly (and older was 6.15.39 which should include the fix from .38 anyway):
$ which heroku
/usr/local/bin/heroku
$ ls -l /usr/local/bin/ | grep heroku
lrwxr-xr-x 1 skyace admin 34 29 mar 11:45 heroku -> ../Cellar/heroku/6.16.3/bin/heroku
From ~/Library/Caches/heroku/error.log:
Error: Update CLI with `brew upgrade heroku`
at Errors.error (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/cli-ux/lib/errors.js:62:23)
at Errors.warn (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/cli-ux/lib/errors.js:95:14)
at action.pause (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/cli-ux/lib/index.js:59:32)
at SimpleAction.pause (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/cli-ux/lib/action/base.js:100:21)
at CLI.warn (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/cli-ux/lib/index.js:58:21)
at Update.<anonymous> (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/@cli-engine/engine/lib/commands/update.js:28:34)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/node_modules/tslib/tslib.js:104:62)
at <anonymous>
[2018-03-29T11:44:40+02:00] ▸ Update CLI with `brew upgrade heroku`[2018-03-29T11:44:40+02:00] Upgrading homebrew formula...
(cut out to the latest since it also has a bunch of errors of me fatfingering wrong commands, but this error repeats a few times in there)
From ~/Library/Caches/heroku/autoupdate.log:
[2018-03-29T07:59:38+02:00] starting `/usr/local/Cellar/heroku/6.15.39/libexec/lib/node_modules/heroku-cli/bin/run update --autoupdate` from /usr/local/bin/heroku
waiting until 2018-03-29T06:59:38.000Z to update
(...) bunch of repeated waiting lines, not really interesting
waiting until 2018-03-29T09:43:41.000Z to update
time to update
▸ Update CLI with `brew upgrade heroku`
Upgrading homebrew formula...Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, caskroom/cask).
==> New Formulae
qsoas
==> Updated Formulae
cabal-install
chakra
chronograf
couchdb
dcm2niix
dwdiff
etcd
flow
fluent-bit
freeciv
freeling
gosu
harfbuzz
hfstospell
icu4c
knot-resolver
libcdr
libfreehand
libhdhomerun
liblcf
libmspub
libphonenumber
librdkafka
libtensorflow
libvisio
mapnik
memcached
mimic
mpd
multimarkdown
node
node@8
nodeenv
pazpar2
php
planck
pyenv
ruby
ruby-build
[email protected]
[email protected]
sile
stdman
tarantool
tectonic
terragrunt
widelands
yaz
zebra
zorba
==> Renamed Formulae
php71 -> [email protected]
==> Upgrading 1 outdated package, with result:
heroku/brew/heroku 6.16.3
==> Upgrading heroku/brew/heroku
==> Downloading https://cli-assets.heroku.com/homebrew/heroku-6.16.3.tar.xz
==> Not running post_install as we're building a bottle
You can run it manually using `brew postinstall heroku/brew/heroku`
🍺 /usr/local/Cellar/heroku/6.16.3: 10,998 files, 38.6MB, built in 10 seconds
done
Edit:
Removing ~/.local/share/heroku/client indeed fixes it, I have it zipped if you want it.
I'm fairly sure at this point what's been happening for everyone is somewhere on the machine that bad release from January being run by the autoupdater. It was only out for a couple hours, but it caused a lot of problems as it keeps sneaking back in. My "fix" isn't really a fix I don't think, but it does make it certain that the path ~/.local/share/heroku/client/bin/heroku.js:2:15 is no longer used by the current CLI. If the CLI is referencing that—the only explanation is old code.
Run these steps if you're having trouble and it should delete any place where the CLI might've been installed or dropped config:
Uninstall:
$ rm -rf ~/.local/share/heroku
$ rm -rf /usr/local/heroku
$ rm -rf /usr/local/Cellar/heroku
$ rm -rf /usr/local/lib/heroku
$ rm -fr ~/Library/Caches/heroku
$ rm -fr ~/.heroku # may not exist
$ rm -fr ~/.config/heroku # may not exist
$ brew uninstall --force heroku # remove all previous downloaded versions
$ gem uninstall heroku # may return nothing (very old cli)
Re-install (notice the tap name):
$ brew install heroku/brew/heroku
Allright, done all this, hopefully it won't come back again. Thanks!
Most helpful comment
I'm fairly sure at this point what's been happening for everyone is somewhere on the machine that bad release from January being run by the autoupdater. It was only out for a couple hours, but it caused a lot of problems as it keeps sneaking back in. My "fix" isn't really a fix I don't think, but it does make it certain that the path
~/.local/share/heroku/client/bin/heroku.js:2:15is no longer used by the current CLI. If the CLI is referencing that—the only explanation is old code.Run these steps if you're having trouble and it should delete any place where the CLI might've been installed or dropped config:
Uninstall:
Re-install (notice the tap name):