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

docker-compose broken #1191

Closed
wuast94 opened this issue Jan 19, 2024 · 13 comments
Closed

docker-compose broken #1191

wuast94 opened this issue Jan 19, 2024 · 13 comments
Assignees

Comments

@wuast94
Copy link

wuast94 commented Jan 19, 2024

  1. why using dots in names? maybe im not aware of something but to my knogledge using dots in service names was always a point of trouble. if i try to start the containers i get:
docker compose up -d
38 error(s) decoding:

* 'services[wazuh.dashboard].depends_on' expected a map, got 'slice'
* 'services[wazuh.dashboard].networks' expected a map, got 'slice'
* 'services[wazuh.dashboard].volumes[0]' expected a map, got 'string'

…
* 'services[wazuh.manager].volumes[8]' expected a map, got 'string'
* 'services[wazuh.manager].volumes[9]' expected a map, got 'string'

removing the dots from the service names is a quick fix

  1. why there is no env variable to change the indexer url for the dashboard container? i can set it in the manager container but not in the dashboard container

  2. why there is a 4.9.0 tag if the latest single node compose and on docker hub the latest tag is 4.7.2?

maybe i miss something but i am not able to get this thing up and running :/

@Drag-NDrop
Copy link

I'm having some problems to. I wondered about the 3rd. question to. How come there's such a jump?

@rauldpm rauldpm self-assigned this Jan 22, 2024
@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

Hello @wuast94

  1. why using dots in names? maybe im not aware of something but to my knogledge using dots in service names was always a point of trouble. if i try to start the containers i get:

Are you doing the deployment in a particular environment? Like SWARM for example? Have you made changes to the files?

  1. why there is no env variable to change the indexer url for the dashboard container? i can set it in the manager container but not in the dashboard container

In principle, there is no environment: section in wazuh-indexer since there is not (or has not been planned) to add anything in said section


Before continuing with question 3, I think they are very good observations, so I would ask you to open an issue for each of them as REQUEST so that the team can evaluate them and add them if deemed appropriate (I could create them myself, but I would prefer that you remain as the author)


  1. why there is a 4.9.0 tag if the latest single node compose and on docker hub the latest tag is 4.7.2?

Also, cc @Drag-NDrop

Where did you see a v4.9.0 tag reference? Currently, we do not have any tags with this version created (see image, note that Alpha tags are for release testing tags). Could it be that you are looking at the master branch? The master branch corresponds to the latest version in current development, which at the moment is 4.9.0, if this is so, it would make sense for you to see that reference since the code is prepared for the version of the branch

Note that the latest Docker Hub tag is v4.7.2 as it is the latest productive version (note that future versions can appear too if they are related to a release testing process, such as 4.8.0-alpha)

image


maybe i miss something but i am not able to get this thing up and running :/

I think, from what we talked about here: #1190, that you look at the code changes referring to the branches/tags, if what you want is to do a deployment, I recommend that you follow the Wazuh documentation, which will guide you from cloning the repository in the last production tag, to certain processes such as the upgrade process

@wuast94
Copy link
Author

wuast94 commented Jan 22, 2024

to 1 and 2 i already created a pull request: #1192

  1. Are you doing the deployment in a particular environment? Like SWARM for example? Have you made changes to the files?

no, just Docker version 24.0.7, build afdd53b4e3 , maybee its because i use a newer docker version and not the old one where compose was an extra installation.

  1. In principle, there is no environment: section in wazuh-indexer since there is not (or has not been planned) to add anything in said section

well there are, look at the docker compose in this repo: https://github.com/wazuh/wazuh-docker/blob/43ecb7f623cf1a9f3625f556de3075f5ef2caac4/single-node/docker-compose.yml
wazuh.manager has INDEXER_URL
wazuh.dashboard has WAZUH_API_URL but no INDEXER_URL, so i can change api url but not the indexer url which i can change in the manger. the indexer url is hardcoded in the dashboard container

  1. Where did you see a v4.9.0 tag reference?

in the docker compose i linked under point 2

i can open a new issue, but 1. and 2. are already fixed if my PR gets accepted. if i should open a new issue for point 3 i will open one 😊

@rauldpm rauldpm linked a pull request Jan 22, 2024 that will close this issue
@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

Thanks! I linked the PR with this issue, I will notify the @wazuh/cicd team so they can review it

no, just Docker version 24.0.7, build afdd53b4e3 , maybee its because i use a newer docker version and not the old one where compose was an extra installation.

Can you tell me your SO so I can do some tests with that Docker version?


wazuh.dashboard has WAZUH_API_URL but no INDEXER_URL, so i can change api url but not the indexer url which i can change in the manger. the indexer url is hardcoded in the dashboard container

Ah sorry, I understand now, yes, you are right, if the wazuh-manager uses the INDEXER_URL in the environment section, the wazuh-dashboard should specify it too, please open an issue about this as it could need internal code changes

Note

I just found a bug in the master branch, this should be referring to 4.9 instead of 4.8, I will create an issue

https://github.com/wazuh/wazuh-docker/blob/master/build-docker-images/wazuh-dashboard/config/config.sh#L12-L13


in the docker compose i linked under point 2

The docker-compose file that you are referring to belongs to the master branch, which has the Wazuh 4.9.0 version, there is no tag in GitHub or DockerHub because it is not a productive version and it is not in a release testing stage

If you check the Blame feature, you will see commits referring to the 4.9.0 version bump, so please, use the v4.7.2 tag instead

https://github.com/wazuh/wazuh-docker/blame/v4.7.2/single-node/docker-compose.yml

@wuast94
Copy link
Author

wuast94 commented Jan 22, 2024

im running on arch, but that shouldnt matter, the docker version should be the same on all OS

ah ok, so i have to specify the latest tag and cant use the master branch for the latest release, understood that 😊

@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

im running on arch, but that shouldnt matter, the docker version should be the same on all OS

Not really, it depends on whether it is updated or not, for example, I am using version 23.0.4 on PopOS!

╰─➤ docker --version
Docker version 23.0.4, build f480fb1

In either case, I'm going to try in case that system or version has something in particular.


ah ok, so i have to specify the latest tag and cant use the master branch for the latest release, understood that

Yes, that is why I am referring to the Wazuh documentation, as it states the tag that should be cloned

image

Right now, Wazuh follows this scheme

  • v4.7.2 -> Latest Wazuh productive version
  • 4.8.0 branch -> Newest patch (and minor) in development (currently in Beta 1)
  • v4.8.0-alpha2 tag -> Latest 4.8.0 tag in release testing stage
  • master branch -> Latest Wazuh version

If a new Wazuh version appears (like 4.10.0), then:

  • The master branch will change to a MAJOR.MINOR.PATCH branch -> 4.9.0 branch
  • The master branch will be bumped to 4.10.0 (but the branch name will be master, not 4.10.0)

That is why I always refer to the Wazuh documentation, as it will state the latest productive version so that there is no confusion

@wuast94
Copy link
Author

wuast94 commented Jan 22, 2024

Docker version 24.0.7, build afdd53b4e3 on standard arch linux.

ok versioning is clear now, a bit confusing but more because the most projects handle this different but now i know and can handle it 😊

thanks for the help 😊

@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

I deployed an Arch Linux vagrant box and I have not been able to reproduce your problem with the service nomenclature

Arch Linux deployment output
[root@archlinux vagrant]# cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
[root@archlinux single-node]# docker --version
Docker version 24.0.7, build afdd53b4e3
[root@archlinux single-node]# docker-compose -f generate-indexer-certs.yml run --rm generator
[+] Creating 1/0
 ✔ Network single-node_default  Created                                                                                                                                                                                                                                                                                 0.0s 
[+] Running 5/5
 ✔ generator 4 layers [⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                                                                                                                                     5.2s 
   ✔ edaedc954fb5 Pull complete                                                                                                                                                                                                                                                                                         0.9s 
   ✔ 573f4d11a520 Pull complete                                                                                                                                                                                                                                                                                         1.7s 
   ✔ 8f200922197d Pull complete                                                                                                                                                                                                                                                                                         0.8s 
   ✔ 55a86de68c5c Pull complete                                                                                                                                                                                                                                                                                         1.4s 
The tool to create the certificates exists in the in Packages bucket
22/01/2024 18:04:25 INFO: Admin certificates created.
22/01/2024 18:04:25 INFO: Wazuh indexer certificates created.
22/01/2024 18:04:25 INFO: Wazuh server certificates created.
22/01/2024 18:04:25 INFO: Wazuh dashboard certificates created.
Moving created certificates to the destination directory
Changing certificate permissions
Setting UID indexer and dashboard
Setting UID for wazuh manager and worker

image

image

From what I have been able to check, a Docker deployment in Arch Linux seems to be correct, can you try to deploy it from scratch (if possible), maybe the wazuh-docker changes affected the deployment when using the master branch.

@Drag-NDrop
Copy link

Hello!
Still doing my homework, just a quick chip-in - i saw the 4.9 images on Docker hub.

Also, I'm using Docker Desktop for Windows.

If you get it working - could i trouble you for a working deployment guide?

@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

Hi @Drag-NDrop, where did you see the 4.9 images? Can you share the URLs?

@Drag-NDrop
Copy link

It was automatically pulled when i ran the Single-node dockercompose in the repository.

Would you like me to try and do that again?

@rauldpm
Copy link
Member

rauldpm commented Jan 22, 2024

Please run a git branch command in the cloned repository and tell me the output

@rauldpm
Copy link
Member

rauldpm commented Feb 16, 2024

Issue closed due to inactivity

@rauldpm rauldpm closed this as completed Feb 16, 2024
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

Successfully merging a pull request may close this issue.

3 participants