wazuh / wazuh-docker

Wazuh - Docker containers
https://wazuh.com
Other
665 stars 384 forks source link

cp: -r not specified; omitting directory '/config/certs.yml' #905

Open Nonesence999 opened 1 year ago

Nonesence999 commented 1 year ago

I am tryng to install Wazuh on docker but it doesn't work even tho I followed the instructions and checked that the files are present : The docker is the windows desktop version whit a debian dev environements to run/install wazuh.

# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  wazuh-docker
# cd wazuh-docker
# ls
CHANGELOG.md  LICENSE  README.md  VERSION  build-docker-images  indexer-certs-creator  multi-node  single-node
# cd single-node
# ls
README.md  config  docker-compose.yml  generate-indexer-certs.yml
# docker-compose -f generate-indexer-certs.yml run --rm generator
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 26847  100 26847    0     0   117k      0 --:--:-- --:--:-- --:--:--  117k
Cert tool exists in Packages bucket
cp: -r not specified; omitting directory '/config/certs.yml'
24/07/2023 13:38:52 ERROR: No configuration file found.
# cd config
# ls
certs.yml  wazuh_cluster  wazuh_dashboard  wazuh_indexer
# 

How can I fix the issue ?

lightheaded commented 1 year ago

I'm having the same issue:

# docker-compose -f generate-indexer-certs.yml run --rm generator
Creating wazuh_generator_run ... done
The tool to create the certificates exists in the in Packages bucket
cp: -r not specified; omitting directory '/config/certs.yml'
19/08/2023 11:08:22 ERROR: No configuration file found.
ERROR: 1

# ll config/
total 32K
drwxrwx--- 4 admin administrators 4.0K 2023-08-19 14:03 ./
drwxrwx--- 3 admin administrators 4.0K 2023-08-19 14:08 ../
drwxr-xr-x 2 admin administrators 4.0K 2023-08-19 14:03 certs.yml/
drwxr-xr-x 2 admin administrators 4.0K 2023-08-19 14:03 wazuh_indexer_ssl_certs/

For some reason the certs.yml is a directory..

shiizeen commented 10 months ago

Hi, same issue here ! Anyone resolve this since August ?

Katovitcom commented 9 months ago

To solve, first search the cert.yml of single-node:

find / -name certs.yml | grep single-node Then, change the file generate-indexer-certs.yml

(in my case):

volumes:
    - /root/wazuh/wazuh-docker/single-node/config/certs.yml:/config/certs.yml
Rovel commented 3 months ago

Hi I found a similar issue and is related what user is creating and running the wazuh docker compose commands, if is the root all runs good if not this errors start appearing related to cert permissions and folder permissions

The cert generation create some certs for root but in the docs there is no mention if root is needed advised etc, to make a clean install on a ubuntu for example, first go sudo su then go to root home folder, then clone the repo, generate the certs and compose up

I would suggest changing the cert generation to fully address this to allow other users or a docker rootless install, but adding this info in the current docs is good, and if any help needed just ping me

MKindshofer commented 1 week ago

The documentation states:

Then enter into the single-node directory to execute all the commands described below within this directory.

The problem occurs when the command does not find the config file but generates it as a directory