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

Authorization error when building the RPM package #354

Open
rauldpm opened this issue Oct 14, 2024 · 2 comments · May be fixed by #411
Open

Authorization error when building the RPM package #354

rauldpm opened this issue Oct 14, 2024 · 2 comments · May be fixed by #411
Assignees
Labels
level/task Task issue request/operational Operational request type/bug Bug issue

Comments

@rauldpm
Copy link
Member

rauldpm commented Oct 14, 2024

Describe the bug

The RPM package generation workflow fails with the following error, this error did not occur 3h ago

Failed: https://github.com/wazuh/wazuh-dashboard/actions/runs/11332275609/job/31514595189
Success: https://github.com/wazuh/wazuh-dashboard/actions/runs/11329940903

#2 ERROR: failed to authorize: failed to fetch oauth token: unexpected status from POST request to https://auth.docker.io/token: 502 Bad Gateway
...
 Dockerfile:4
--------------------
   2 |     
   3 |     RUN mkdir -p /tmp
   4 | >>> FROM centos
   5 |     ARG PACKAGE
   6 |     RUN cd /etc/yum.repos.d/
--------------------
ERROR: failed to solve: centos: failed to resolve source metadata for docker.io/library/centos:latest: failed to authorize: failed to fetch oauth token: unexpected status from POST request to https://auth.docker.io/token: 502 Bad Gateway
Unable to find image 'wazuh-dashboard:latest' locally
docker: Error response from daemon: pull access denied for wazuh-dashboard, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Error response from daemon: No such container: wazuh-dashboard
Error response from daemon: No such container: wazuh-dashboard
metadata version is correct: 
metadata package is correct: 
ERROR: /etc/wazuh-dashboard/opensearch_dashboards.yml does not exist
Error response from daemon: No such container: wazuh-dashboard
Error response from daemon: No such image: wazuh-dashboard:latest
Error: Process completed with exit code 1.

Apparently, the error is produced by Docker, as not all builds fail, we should improve the failed workflow stage with a retry in case we have a 502 code

To Reproduce
Steps to reproduce the behavior:

  1. Launch the https://github.com/wazuh/wazuh-dashboard/actions/runs/11332275609/job/31514595189 workflow for the v4.10.0-alpha2 tag

Expected behavior
The package is created and uploaded successfully

OpenSearch Version
Related to v4.10.0-alpha2

Dashboards Version
v4.10.0-alpha2

Plugins
Default

Screenshots
Not applicable

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser and version [e.g. 22]

Additional context

@wazuhci wazuhci moved this to Triage in Release 4.10.0 Oct 14, 2024
@rauldpm rauldpm removed this from Release 4.10.0 Oct 14, 2024
@yenienserrano yenienserrano self-assigned this Nov 7, 2024
@yenienserrano
Copy link
Member

I could see the actions do not have an option to retry, I found this action that can be used, duplicate the step and put a conditional that is for failure and error, or see if you can do something else.

https://github.com/marketplace/actions/retry-step

@yenienserrano
Copy link
Member

I was testing commands to retry when it fails, and I came up with a loop that when it passes it finishes but when it fails it tries again, but the script if it fails closes the execution.

for i in 1 2 3 4 5; do \
          bash ./build-packages.sh \
            -v 5.0.0 \
            -r 1 --rpm  \
            -a file://<path> \
            -s file://<path> \
            -b file://<path>  \
            -rp file://<path>  \
            && break || sleep 15; done;

@asteriscos asteriscos added request/operational Operational request and removed untriaged labels Nov 11, 2024
@yenienserrano yenienserrano linked a pull request Nov 11, 2024 that will close this issue
7 tasks
@yenienserrano yenienserrano linked a pull request Nov 12, 2024 that will close this issue
7 tasks
@yenienserrano yenienserrano linked a pull request Nov 12, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue request/operational Operational request type/bug Bug issue
Projects
None yet
3 participants