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

Dockerimage - 0.86.0 "No such file or directory" #1053

Closed
wadabum opened this issue Jul 13, 2022 · 5 comments · Fixed by #1059
Closed

Dockerimage - 0.86.0 "No such file or directory" #1053

wadabum opened this issue Jul 13, 2022 · 5 comments · Fixed by #1059
Assignees

Comments

@wadabum
Copy link

wadabum commented Jul 13, 2022

Hi, the :0.86.0 docker-image appears broke
error: (Errno::ENOENT) No such file or directory - docker

Used via Gitlab-CI so dont have full details,

Notably: this "docker not found" is NOT the 'docker run' call, but coming from inside the image
(as seen on the "pull" 2 lines above working)

$ docker pull codeclimate/codeclimate
Using default tag: latest
latest: Pulling from codeclimate/codeclimate
2408cc74d12b: Pulling fs layer
4d8a1bad31d1: Pulling fs layer
...
$ docker run {{options omitted}} codeclimate/codeclimate analyze
error: (Errno::ENOENT) No such file or directory - docker

everything was working yesterday

@camillof
Copy link
Contributor

Hey there 👋 Could you please provide any extra context available? How is the CLI configured on your Gitlab-CI? Is it installed or do you perform a manual docker invocation? Are you caching files / gems by any chance on the CI?

@wadabum
Copy link
Author

wadabum commented Jul 13, 2022

Hi @camillof, and sorry, was in a hurry throwing that report in here earlier hoping for some obvious fix/rollback :/

Given nothing happened, here some more detail/repo:
(Note: fixme is used here as fast example engine, same error occurs for "any engine" or "all-engines-run", with&without devmode)

0.85.29


$ engineName=fixme; time docker run --rm --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc --env CODECLIMATE_DEBUG=1 codeclimate/codeclimate:0.85.29 analyze --dev -e ${engineName}
Unable to find image 'codeclimate/codeclimate:0.85.29' locally
0.85.29: Pulling from codeclimate/codeclimate
cbdbe7a5bc2a: Already exists
5943cc9922f1: Pull complete
f2bb036df66f: Pull complete
d36ef4240c6f: Pull complete
48c7814cb2b0: Pull complete
dd1edc72205b: Pull complete
4ea9d1f57a58: Pull complete
d97ef889d652: Pull complete
817787d45ba7: Pull complete
d3c587c05e7d: Pull complete
Digest: sha256:75b11bbf608ec03ae8ff9a1c0976de19465dc77d0aca300092198ca2fca57faf
Status: Downloaded newer image for codeclimate/codeclimate:0.85.29
WARNING: A new version (v0.86.0) is available. Upgrade instructions are available at: https://github.com/codeclimate/codeclimate#packages
I, [2022-07-13T23:07:49.228520 #1]  INFO -- : starting engine fixme
D, [2022-07-13T23:07:49.543529 #1] DEBUG -- : /config.json content: {"enabled"=>true, "channel"=>"stable", "include_paths"=>["Dummyfile", ......], "debug"=>"1"}
D, [2022-07-13T23:07:49.561588 #1] DEBUG -- : docker run: ["docker", "run", "--name", "cc-engines-fixme-stable-a76ad428-b6bc-4057-9316-848d9aa59c34", "--cap-drop", "all", "--label", "com.codeclimate.label=315c8ed7-598c-4abf-9eb1-29366f272d19", "--log-driver", "none", "--memory-swap", "-1", "--net", "none", "--rm", "--volume", "/code/ccdemo/202207:/code:ro", "--volume", "/tmp/cc/9be5926c-f9dd-4ad7-88d7-fcb29014f82d:/config.json:ro", "--user", "9000:9000", "codeclimate/codeclimate-fixme"]
......
D, [2022-07-13T23:08:06.042173 #1] DEBUG -- : engine stdout: {"categories":["Bug Risk"],"check_name":"TODO","description":"TODO found","location":{"lines":{"begin":23,"end":23},"path":"Dummyfile"},"type":"issue"}
D, [2022-07-13T23:08:06.606871 #1] DEBUG -- : engine stdout: {"categories":["Bug Risk"],"check_name":"TODO","description":"TODO found","location":{"lines":{"begin":44,"end":44},"path":"Dummyfile"},"type":"issue"}
......
I, [2022-07-13T23:08:08.762120 #1]  INFO -- : finished engine fixme
Starting analysis

== Dummyfile (1 issue) ==
23: TODO found [fixme]
44: TODO found [fixme]

Analysis complete! Found ...... issues.

real    0m29.700s
user    0m0.000s
sys     0m0.015s

meanwhile

0.86.0


$ engineName=fixme; time docker run --rm --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc --env CODECLIMATE_DEBUG=1 codeclimate/codeclimate:0.86.0 analyze --dev -e ${engineName}
Unable to find image 'codeclimate/codeclimate:0.86.0' locally
0.86.0: Pulling from codeclimate/codeclimate
2408cc74d12b: Pull complete
4d8a1bad31d1: Pull complete
b0d5b8f74106: Pull complete
828799b1fe67: Pull complete
e6f80651b509: Pull complete
a2a458de225c: Pull complete
7ff8eb8966c4: Pull complete
f416970eac4a: Pull complete
f319747a91ed: Pull complete
0b9e7283cc05: Pull complete
Digest: sha256:aa21af04d4d9efb807be39d55083b24c3379b471653d0d3fcb84b4be6e91a253
Status: Downloaded newer image for codeclimate/codeclimate:0.86.0
I, [2022-07-13T23:09:28.808627 #1]  INFO -- : starting engine fixme
D, [2022-07-13T23:09:29.144677 #1] DEBUG -- : /config.json content: {"enabled"=>true, "channel"=>"stable", "include_paths"=>["Dummyfile", .......], "debug"=>"1"}
D, [2022-07-13T23:09:29.172751 #1] DEBUG -- : docker run: ["docker", "run", "--name", "cc-engines-fixme-stable-68de3698-791d-4d23-a382-f0290e499a6a", "--cap-drop", "all", "--label", "com.codeclimate.label=1f41ee68-9129-4ca4-9b02-001cd301e56c", "--log-driver", "none", "--memory-swap", "-1", "--net", "none", "--rm", "--volume", "/code/ccdemo/202207:/code:ro", "--volume", "/tmp/cc/3e717748-c6ae-417f-9fdc-aa769370f0a8:/config.json:ro", "--user", "9000:9000", "codeclimate/codeclimate-fixme"]
Starting analysis
error: (Errno::ENOENT) No such file or directory - docker
D, [2022-07-13T23:09:29.174640 #1] DEBUG -- : backtrace: /usr/lib/ruby/3.1.0/open3.rb:222:in `spawn'
        /usr/lib/ruby/3.1.0/open3.rb:222:in `popen_run'
        /usr/lib/ruby/3.1.0/open3.rb:103:in `popen3'
        /usr/src/app/lib/cc/analyzer/container.rb:55:in `run'
        /usr/src/app/lib/cc/analyzer/engine.rb:44:in `run'
        /usr/src/app/lib/cc/analyzer/bridge.rb:81:in `run_engine'
        /usr/src/app/lib/cc/analyzer/bridge.rb:47:in `block (2 levels) in run'
        /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:63:in `with_spinner'
        /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:41:in `block in engine_running'
        /usr/src/app/lib/cc/analyzer/formatters/formatter.rb:31:in `engine_running'
        /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:40:in `engine_running'
        /usr/src/app/lib/cc/analyzer/bridge.rb:37:in `block in run'
        /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `each'
        /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `run'
        /usr/src/app/lib/cc/cli/analyze.rb:36:in `run'
        /usr/src/app/lib/cc/cli/command.rb:73:in `execute'
        /usr/src/app/lib/cc/cli/runner.rb:25:in `run'
        /usr/src/app/lib/cc/cli/runner.rb:9:in `run'
        /usr/src/app/bin/codeclimate:12:in `<main>'

real    0m5.060s
user    0m0.000s
sys     0m0.015s

@camillof
Copy link
Contributor

Thank you @wadabum for the detailed response. Can I ask in which environment are you running this? Ubuntu / Mac / Windows..

Also, do you mind running docker build --no-cache -t codeclimate/codeclimate:0.86.0 . on this repo root folder and then run your command again and check if it works?

@wadabum
Copy link
Author

wadabum commented Jul 14, 2022

"I can´t build that..." o.O

Seems that issue roots from "going past alpine 3.14" & docker/ruby versions...
And with that, the introduction of faccessat2?
3.11.6->3.16.0 via https://github.com/codeclimate/codeclimate/pull/1051/files

https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
Also docker-library/ruby#351

What mostly shoves this issue into wont-fix i guess... :/
With the actual fix being: update your docker version.

@camillof
Copy link
Contributor

That is a deep investigation, and I appreciate it @wadabum 🙌 . Looking at the results I can deduce that your host docker version is outdated?

We need to keep our base image (alpine) the most updated possible, to avoid possible security issues. What alternatives do you have in mind?

You can always create your own docker image based on a previous alpine version, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants