Skip to content
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

Failed to send data to Bearer Cloud. Unable to calculate Metadata. exit status 128 #1196

Closed
cfabianski opened this issue Aug 21, 2023 · 4 comments · Fixed by #1197
Closed
Labels
bug Something isn't working

Comments

@cfabianski
Copy link
Collaborator

cfabianski commented Aug 21, 2023

Description & Reproduction

When performing a scan with an API key we receive the following error
Failed to send data to Bearer Cloud. Unable to calculate Metadata. exit status 128

Error is happening when a repository has a local git HEAD but no origin/HEAD
This is breaking getDefaultBranch() in saas.go

@cfabianski cfabianski added the bug Something isn't working label Aug 21, 2023
@gmontard
Copy link
Contributor

Can we add a nice warning message as a CLI output with indication on what to do for the user @cfabianski ?

@cfabianski
Copy link
Collaborator Author

cfabianski commented Aug 21, 2023

Can we add a nice warning message as a CLI output with indication on what to do for the user @cfabianski ?

@gmontard We have a message (debug) for this but maybe debug isn't enough

log.Debug().Msg("Couldn't extract the default branch of this repository please set 'DEFAULT_BRANCH' environment variable.")

🤔

@gmontard
Copy link
Contributor

Message LGTM

Though, don't you always have a default branch set with Git? And if not, is there a particular reason or a git command to use to make it so that we can advise the user to look into also? The env variable here sounds a bit hackish to me, especially if you're supposed to have a default branch setup.

@cfabianski
Copy link
Collaborator Author

origin/HEAD is always defined if you successfully cloned the repository.
You can end up with a missing origin/HEAD if you initialize a repo locally but didn't push it anywhere. That would explain it. In any cases, I will update the log level to make the message available directly without having to use --debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants