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

Zero return on register error #150

Open
fdbeirao opened this issue Oct 25, 2019 · 0 comments
Open

Zero return on register error #150

fdbeirao opened this issue Oct 25, 2019 · 0 comments

Comments

@fdbeirao
Copy link

Hello,

We are observing an issue in our deployment pipeline, where iron register logs an error on the console, but still seems to return a zero status code, which leads the CI agent to believe the command was successful.

There are the logs we observe (obfuscated a few bits):

iron register --name ••••-pdf-report-systest $docker_image
[command]/bin/bash ./.tempexecution.sh
----->  Configuring client
        Project '0Fna••••O93••••2' with id='••••94e••••ca500••••5244'
----->  Registering worker '••••-pdf-report-systest'
400 Bad Request: Image 'docker.••••.••••.io/s•••e-••••_••••-dev/••••-pdf-report:0.0.1.1••33' does not exist or authentication failed. If this image is private or on a non-docker hub registry, make sure `iron docker login` worked and the registry is available. Last error: Get https://docker.••••.••••.io/v2/s•••e-••••_••••-dev/••••-pdf-report/manifests/0.0.1.1••33: http: non-successful response (status=401 body="{\"errors\":[{\"code\":\"UNAUTHORIZED\",\"message\":\"authentication required\",\"detail\":[{\"Type\":\"repository\",\"Class\":\"\",\"Name\":\"s•••e-••••_••••-dev/••••-pdf-report\",\"Action\":\"pull\"}]}]}\n")

Upon looking into the source code, and with my limited understanding of go, this line seems to be the culprit:

return

Our desired behavior would be that if the command did not execute successfully, we would obtain a non-zero return code, so the agent could detect there was an issue an fail the pipeline (giving us the power to choose whether to continue execution on errors or not).

Let me know if there is an easy workaround for this issue. I guess given the current implementation I will have to workaround it by checking the content of stdout with the success expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant