Hello,
Over the last 2 days when issuing commands (even the most trivial like heroku --version), the cli takes a lot of time to start processing the command. This gist contains a sample from the running node process when in "frozen" state
OS: MacOS Sierra (10.12.6)
cli version: heroku-cli/6.16.3-4239951 (darwin-x64) node-v9.9.0
I tried to uninstall and reinstall the cli from scratch but the issue remains.
Thanks,
Kostas
Some users have reported that they have netrc files with millions of empty lines in them causing this to happen.
@jdxcode thanks a million man! You truly saved my day 馃
to add a bit more information: we have no idea what caused the files to have so many empty lines or if it was even our CLI that caused it to happen. We refactored the netrc parser and the new logic doesn't perform as well (but in general netrc files shouldn't be big enough for that to be a problem鈥攚e didn't realize there were files with millions of empty lines).
All except one netrc file we found were completely empty aside from whitespace, so we put this patch in to skip files that are entirely whitespace: https://github.com/jdxcode/node-netrc-parser/pull/12
If anyone is experiencing this happening more than once after fixing the file, let me know because there might be a bug in the parser we haven't found.
Otherwise, there is more we could do to make the parsing logic more resilient to files with tons of empty lines. I'd rather not add the complexity though if this is a one-off issue that doesn't reappear.
This is appearing to return for some users so I'm working on a better fix that won't require a manual step. In the meantime, just delete the netrc or the empty lines in it and it should fix it.
Fwiw, my lines are not empty: they're repeating, hundreds of thousands of times! I erased it and the problem went away, at least for now.
rm ~/.netrc did the trick, thanks!
My ~/.netrc file had milions of lines like:
machine api.heroku.com
...
machine git.heroku.com
All the same. Removing it resolved the issue.
apologies for this everyone, we've had these netrc changes in the codebase for a few months now but just started rolling it out to more bits of the codebase. It's obviously got a major issue for some of you so I'm working on a fix and plan to have it released today. I may also see about rolling back these netrc changes but because they're in transitive dependencies that's a lot easier said than done.
the fix is rolling out now and will be part of 6.16.7. You may need to run heroku login once for it to work. It will clean up the mess in the netrc file of all the duplicates.
Hello, @jdxcode It seems like the fix is not working, i'm using heroku-cli/6.16.4 (linux-x86) node-v9.9 and encountered the same issue today.
root@user:# wc -l /root/.netrc
136668 /root/.netrc
As suggested above deleting ~/.netrc fixed the issue.
Most helpful comment
Some users have reported that they have netrc files with millions of empty lines in them causing this to happen.