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

The images build fails due to Filebeat template branch #1054

Closed
3 of 4 tasks
davidcr01 opened this issue Oct 13, 2023 · 3 comments · Fixed by #1056
Closed
3 of 4 tasks

The images build fails due to Filebeat template branch #1054

davidcr01 opened this issue Oct 13, 2023 · 3 comments · Fixed by #1056
Assignees
Labels

Comments

@davidcr01
Copy link
Contributor

davidcr01 commented Oct 13, 2023

Description

In https://github.com/wazuh/wazuh-docker/actions/runs/6505873486/job/17670330050?pr=1053 it has been observed that the image building fails. The error is reported in other task:

#7 https://raw.githubusercontent.com/wazuh/wazuh//extensions/elasticsearch/7.x/wazuh-template.json
#7 ERROR: invalid response status 404

It seems that the Filebeat template branch is empy.

Reproducing locally, the same error is generated:

sudo bash build-docker-images/build-images.sh
+ '[' '' ']'
+ curl --output /dev/null --silent --head --fail https://github.com/wazuh/wazuh/tree/v4.7.0
+ curl --output /dev/null --silent --head --fail https://github.com/wazuh/wazuh/tree/4.7.0
+ FILEBEAT_TEMPLATE_BRANCH=4.7.0
+ set +x
[+] Building 7.4s (12/77)                                                              
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build definition from Dockerfile  0.0s
 => => transferring dockerfile: 3.66kB                                            0.0s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load .dockerignore                     0.0s
 => => transferring context: 2B                                                   0.0s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load metadata for docker.io/library/u  0.7s
 => [wazuh/wazuh-manager:4.7.0 internal] load build definition from Dockerfile    0.0s
 => => transferring dockerfile: 2.09kB                                            0.0s
 => [wazuh/wazuh-manager:4.7.0 internal] load .dockerignore                       0.0s
 => => transferring context: 2B                                                   0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build definition from Dockerfile    0.0s
 => => transferring dockerfile: 2.38kB                                            0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load .dockerignore                       0.0s
 => => transferring context: 2B                                                   0.0s
 => CANCELED [wazuh/wazuh-dashboard:4.7.0  1/17] FROM docker.io/library/ubuntu:f  6.7s
 => => resolve docker.io/library/ubuntu:focal@sha256:59f5f8b43ebcd48f0cad95b1657  0.0s
 => => sha256:59f5f8b43ebcd48f0cad95b16570b17e67bcedf8455394011d 1.13kB / 1.13kB  0.0s
 => => sha256:218bb51abbd1864df8be26166f847547b3851a89999ca7bfceb85c 424B / 424B  0.0s
 => => sha256:bf40b7bc7a11b43785755d3c5f23dee03b08e988b327a2f10b 2.30kB / 2.30kB  0.0s
 => => sha256:96d54c3075c9eeaed5561fd620828fd6bb5d80ecae7cb25f 18.87MB / 27.51MB  6.7s
 => [wazuh/wazuh-manager:4.7.0 internal] load build context                       0.0s
 => => transferring context: 791B                                                 0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build context                       0.0s
 => => transferring context: 349B                                                 0.0s
 => [wazuh/wazuh-manager:4.7.0] https://raw.githubusercontent.com/wazuh/wazuh/4.  0.3s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                     0.0s
 => => transferring context: 358B                                                 0.0s
canceled
 ✘  ~/Wazuh/docker   4.7.0 ±  sudo bash build-docker-images/build-images.sh
+ '[' '' ']'
+ curl --output /dev/null --silent --head --fail https://github.com/wazuh/wazuh/tree/v4.7.0
+ curl --output /dev/null --silent --head --fail https://github.com/wazuh/wazuh/tree/4.7.0
+ FILEBEAT_TEMPLATE_BRANCH=4.7.0
+ set +x
[+] Building 2.0s (12/77)                                                                                                                                                                                      
 => [wazuh/wazuh-manager:4.7.0 internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 2.08kB                                                                                                                                                                    0.0s
 => [wazuh/wazuh-manager:4.7.0 internal] load .dockerignore                                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                                                           0.0s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load metadata for docker.io/library/ubuntu:focal                                                                                                               1.3s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build definition from Dockerfile                                                                                                                          0.0s
 => => transferring dockerfile: 3.66kB                                                                                                                                                                    0.0s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load .dockerignore                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                           0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load .dockerignore                                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                                                           0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 2.38kB                                                                                                                                                                    0.0s
 => [wazuh/wazuh-manager:4.7.0 internal] load build context                                                                                                                                               0.0s
 => => transferring context: 791B                                                                                                                                                                         0.0s
 => [wazuh/wazuh-indexer:4.7.0 internal] load build context                                                                                                                                               0.0s
 => => transferring context: 349B                                                                                                                                                                         0.0s
 => CANCELED [wazuh/wazuh-dashboard:4.7.0 builder 1/9] FROM docker.io/library/ubuntu:focal@sha256:59f5f8b43ebcd48f0cad95b16570b17e67bcedf8455394011d0922fd4db668ad                                        0.7s
 => => resolve docker.io/library/ubuntu:focal@sha256:59f5f8b43ebcd48f0cad95b16570b17e67bcedf8455394011d0922fd4db668ad                                                                                     0.0s
 => => sha256:218bb51abbd1864df8be26166f847547b3851a89999ca7bfceb85ca9b5d2e95d 424B / 424B                                                                                                                0.0s
 => => sha256:bf40b7bc7a11b43785755d3c5f23dee03b08e988b327a2f10b22d01d5dc5259d 2.30kB / 2.30kB                                                                                                            0.0s
 => => sha256:96d54c3075c9eeaed5561fd620828fd6bb5d80ecae7cb25f9ba5f7d88ea6e15c 0B / 27.51MB                                                                                                               0.6s
 => => sha256:59f5f8b43ebcd48f0cad95b16570b17e67bcedf8455394011d0922fd4db668ad 1.13kB / 1.13kB                                                                                                            0.0s
 => ERROR [wazuh/wazuh-manager:4.7.0] https://raw.githubusercontent.com/wazuh/wazuh//extensions/elasticsearch/7.x/wazuh-template.json                                                                     0.6s
 => [wazuh/wazuh-dashboard:4.7.0 internal] load build context                                                                                                                                             0.0s
 => => transferring context: 358B                                                                                                                                                                         0.0s
------
 > [wazuh/wazuh-manager:4.7.0] https://raw.githubusercontent.com/wazuh/wazuh//extensions/elasticsearch/7.x/wazuh-template.json:
------
failed to solve: failed to load cache key: invalid response status 404

I debugged the code and the FILEBEAT_TEMPLATE_BRANCH variable contains a correct value, but in the build-docker-images/wazuh-manager/Dockerfile it is specified the following variable:

ARG TEMPLATE_VERSION=v4.7.0

And the curl command uses the FILEBEAT_TEMPLATE_BRANCH variable:

ADD https://raw.githubusercontent.com/wazuh/wazuh/$FILEBEAT_TEMPLATE_BRANCH/extensions/elasticsearch/7.x/wazuh-template.json /etc/filebeat
RUN chmod go-w /etc/filebeat/wazuh-template.json

Changing the TEMPLATE_VERSION to the FILEBEAT_TEMPLATE_BRANCH may fix the problem

Tasks

  • Investigate the error
  • Provide a fix
  • Apply the fix
  • Validate that the images are built correctly
This was referenced Oct 13, 2023
@bitnative
Copy link

When attempting to build images I am getting the following branch error:

$ build-docker-images/build-images.sh -v 4.9.0
build-docker-images/build-images.sh: 57: [: 4.9.0: unexpected operator
The indicated branch does not exist in the wazuh/wazuh repository: 4.9.0

@davidcr01
Copy link
Contributor Author

Hello @bitnative. The issue you are involved in is related to our branches and releases system. In this part of the README.md we specify that the master branch contains the latest code, and this can provoke bugs as it is a development branch right now. It exists because it is needed to work in the new versions of Wazuh.

Currently, the master branch is the numbered branch 4.9.0. Our latest tag is v4.5.3, you can check it here. https://github.com/wazuh/wazuh-docker/releases/tag/v4.5.3. The latest tag in the release title indicates it. This is the most recent and stable version of Wazuh.

Please, move to the correct branch before attempting to build the Docker images. If you want to build the images from a development branch, consider that you can get errors or bugs.

@davidcr01 davidcr01 self-assigned this Oct 16, 2023
@wazuhci wazuhci moved this to In progress in Release 4.6.0 Oct 16, 2023
@davidcr01 davidcr01 linked a pull request Oct 16, 2023 that will close this issue
@wazuhci wazuhci moved this to Pending review in Release 4.7.0 Oct 16, 2023
@wazuhci wazuhci removed this from Release 4.6.0 Oct 16, 2023
@bitnative
Copy link

bitnative commented Oct 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants