goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.57k stars 472 forks source link

dgoss failing #588

Closed thatsk closed 4 years ago

thatsk commented 4 years ago
root@test: ~# ./install.sh
Downloading https://github.com/aelsabbahy/goss/releases/download/v0.3.11/goss-linux-amd64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   627  100   627    0     0   1256      0 --:--:-- --:--:-- --:--:--  1256
100 10.0M  100 10.0M    0     0  6326k      0  0:00:01  0:00:01 --:--:-- 33.6M
Goss v0.3.11 has been installed to /usr/local/bin/goss
goss --version
goss version v0.3.11
Downloading https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dgoss/dgoss
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4289  100  4289    0     0  10578      0 --:--:-- --:--:-- --:--:-- 10590
dgoss master has been installed to /usr/local/bin/dgoss
root@test: ~# dgoss run --name=envoy-proxy --net=host -v /var/log/platform-api-gateway:/var/log/platform-api-gateway platform-api-gateway-envoy:1.11.2-7a12f37-201911122315.481eb2e
INFO: Starting docker container
INFO: Container ID: 32e3e44c
INFO: Sleeping for 0.2
INFO: Container health
INFO: Running Tests
Error: file error: open /goss/goss.yaml: no such file or directory
INFO: Deleting container
BeamerIsHere commented 4 years ago

Hey @thatsk you have to be in the same folder which has goss.yaml script. If you don't have a script create one using `dgoss edit .

BeamerIsHere commented 4 years ago

example :

goss a file /var/log/nginx/access.log /var/log/nginx/error.log goss a process nginx goss a port 80 goss a package nginx goss a http http://localhost exit

aelsabbahy commented 4 years ago

Changed this to label "question". I assume @BeamerIsHere is correct and you're just missing a goss.yaml file.

If that's not the issue feel free to comment on here and we can reopen/discuss further.

phagemann commented 4 years ago

Hello everybody,

im experiencing exact the same issue. Using Gitlab-CI with docker in docker: The Gitlabrunner fails with the following message.

$ ls -al
total 59160
drwxrwxrwx    1 root     root           326 Jul  2 23:01 .
drwxrwxrwx    1 root     root            68 Jul  2 10:55 ..
drwxrwxrwx    1 root     root           100 Jul  2 23:01 .git
-rw-rw-rw-    1 root     root            44 Jul  2 10:55 .gitignore
-rw-rw-rw-    1 root     root          3798 Jul  2 23:01 .gitlab-ci.yml
-rw-rw-rw-    1 root     root           925 Jul  2 10:55 README.md
-rw-r--r--    1 root     root             8 Jul  2 23:00 VERSIONTAG.txt
drwxrwxrwx    1 root     root           198 Jul  2 16:19 backend
-rw-r--r--    1 root     root      59620352 Jul  2 23:01 backend.tar
-rw-rw-rw-    1 root     root           613 Jul  2 10:55 config.py
-rw-rw-rw-    1 root     root           170 Jul  2 10:55 docker-compose.prod.yml
-rw-rw-rw-    1 root     root           655 Jul  2 10:55 docker-compose.yml
-rw-rw-rw-    1 root     root          2074 Jul  2 10:55 goss.yaml
drwxrwxrwx    1 root     root           278 Jul  2 13:19 interface
-rw-rw-rw-    1 root     root           107 Jul  2 10:55 wsgi.py
$ dgoss run $CI_REGISTRY_IMAGE/backend:$CI_COMMIT_REF_NAME
INFO: Starting docker container
INFO: Container ID: 712c8ae5
INFO: Sleeping for 0.2
INFO: Container health
INFO: Running Tests
sh: 1: /goss/goss: not found
INFO: Deleting container

The Dockerimage used is docker:19.03.11. The script to execute shown below.

script:
        - apk add bash curl
        - curl -L https://github.com/aelsabbahy/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
        - curl -L https://github.com/aelsabbahy/goss/releases/latest/download/dgoss -o /usr/local/bin/dgoss
        - chmod +rx /usr/local/bin/goss /usr/local/bin/dgoss
        - docker load -i backend.tar
        - ls -al
        - dgoss run $CI_REGISTRY_IMAGE/backend:$CI_COMMIT_REF_NAME

The goss.yaml file exists in the current directory. Running dgoss local works just fine.

Any ideas whats causing the fail inside Docker?

aelsabbahy commented 4 years ago

@wir3shark see this comment, let me know if it resolves the issue:

https://github.com/aelsabbahy/goss/issues/305#issuecomment-353122840

phagemann commented 4 years ago

It worked. Thanks for the fast respond.