New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI prints "null" and exits with error code 1 #1333
Comments
Draft pull request: #1295 |
[pdcastro] This issue has attached support thread https://jel.ly.fish/#/support-thread~17dc1bb6-a481-4b68-aa64-e961ffd4b794 |
"hello" support conversation: https://app.frontapp.com/open/cnv_1yv269v |
On macOS, in order to edit the
It will prompt you for the computer login password because the file is owned by the |
I ran into this problem and after commenting out the setupRaven() call, it emerged that the problem was due to $HOME/.balena being owned by root. It was empty anyway so I got rid of it, uncommented setupRaven() again and everything works now. |
Though I am using an older version of cli (resin-cli@8.1.0), I encountered the same error. I fixed part of the Lines 82 to 86 in 8dc4c08
// Before
require('any-promise/register/bluebird')
// After
require('any-promise') The same fixes in
|
Mine was
Then when digging around I found an empty ~/.balenarc.yml file which when deleted got me working again |
[pdcastro] This issue has attached support thread https://jel.ly.fish/#/49b14f58-7f34-40c4-95c2-f0596a1377ab |
[pdcastro] This issue has attached support thread https://jel.ly.fish/#/55a77735-863d-4e2f-90cc-034c92e05c25 |
This issue should be fixed in CLI release 11.28.14 (releases). If you still come across this issue ("prints null and exits") with CLI v11.28.14 or later, please leave a comment and we can reopen this issue (or you are also welcome to create a new issue). If you needed/wanted to get around the issue by commenting out the
|
This error is rare but can happen with any balena CLI command, any platform (Windows, Mac, Linux) and any installation type (npm dev, npm production, standalone zip, executable installer). The most recent example was issue #1331, and it is closely related to issue #1193.
It happens because of an issue / bug in the Sentry library, which is supposed to intercept errors and report them to Balena via the sentry.io platform. It seems that the Sentry library (at least the old version being used) cannot cope with certain types of errors, and then itself fails and "masks" the underlying error, resulting in "null" being printed to the console:
That's a rather frustrating error, difficult to debug. A workaround (to reveal the underlying error) is to sidestep the Sentry library by commenting out (
//
) thesetupRaven()
line in thebuild/app-common.js
file, so that it looks as follows:If the CLI was installed with the executable (native) installers, the file is located at:
C:\Program Files\balena-cli\client\build\app-common.js
/usr/local/lib/balena-cli/build/app-common.js
With the "npm installation", it depends on where Node.js was installed and whether
nvm
was used, but typical locations are:This workaround is not possible in the standalone zip packages, as the source code is bundled in the executable binary.
The first step towards a proper fix is probably to update the Sentry library being used by the CLI (#1523). Unfortunately it's not just a matter of updating a dependency version, because Sentry did a re-writing of the public API.
The text was updated successfully, but these errors were encountered: