crytic / slither-action

GNU Affero General Public License v3.0
127 stars 19 forks source link

0.3.0 new version fails with foundry #52

Closed 0xTimepunk closed 1 year ago

0xTimepunk commented 1 year ago

I am getting the following error with the action

2023-02-21T18:31:22.7183076Z ##[command]/usr/bin/docker run --name c928ea09da8ed41b1917f8507a4e6d0f1_0f890e --label 49859c --workdir /github/workspace --rm -e "INPUT_SLITHER-ARGS" -e "INPUT_SARIF" -e "INPUT_FAIL-ON" -e "INPUT_SOLC-VERSION" -e "INPUT_NODE-VERSION" -e "INPUT_TARGET" -e "INPUT_SLITHER-CONFIG" -e "INPUT_SLITHER-VERSION" -e "INPUT_IGNORE-COMPILE" -e "INPUT_INTERNAL-GITHUB-WORKSPACE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/super-vaults/super-vaults":"/github/workspace" 49859c:928ea09da8ed41b1917f8507a4e6d0f1  "." "" "" "results.sarif" ""
2023-02-21T18:31:27.3475130Z Collecting wheel
2023-02-21T18:31:27.3944041Z   Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
2023-02-21T18:31:27.4291414Z Installing collected packages: wheel
2023-02-21T18:31:27.4637954Z Successfully installed wheel-0.38.4
2023-02-21T18:31:27.9842533Z Collecting slither-analyzer
2023-02-21T18:31:28.0320868Z   Downloading slither_analyzer-0.9.2-py3-none-any.whl (636 kB)
2023-02-21T18:31:28.0696130Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 636.3/636.3 KB 18.4 MB/s eta 0:00:00
2023-02-21T18:31:28.1297157Z Collecting packaging
2023-02-21T18:31:28.1403585Z   Downloading packaging-23.0-py3-none-any.whl (42 kB)
2023-02-21T18:31:28.1429909Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 KB 194.4 MB/s eta 0:00:00
2023-02-21T18:31:28.3823322Z Collecting pycryptodome>=3.4.6
2023-02-21T18:31:28.3952723Z   Downloading pycryptodome-3.17-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
2023-02-21T18:31:28.4128288Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 139.6 MB/s eta 0:00:00
2023-02-21T18:31:28.4479784Z Collecting crytic-compile>=0.3.0
2023-02-21T18:31:28.4599675Z   Downloading crytic_compile-0.3.0-py3-none-any.whl (91 kB)
2023-02-21T18:31:28.4628135Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91.4/91.4 KB 252.2 MB/s eta 0:00:00
2023-02-21T18:31:28.4958845Z Collecting prettytable>=0.7.2
2023-02-21T18:31:28.5077393Z   Downloading prettytable-3.6.0-py3-none-any.whl (27 kB)
2023-02-21T18:31:28.5708235Z Collecting cbor2
2023-02-21T18:31:28.5832126Z   Downloading cbor2-5.4.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (223 kB)
2023-02-21T18:31:28.5867216Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 223.1/223.1 KB 277.3 MB/s eta 0:00:00
2023-02-21T18:31:28.6175618Z Collecting wcwidth
2023-02-21T18:31:28.6285493Z   Downloading wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
2023-02-21T18:31:28.6976203Z Installing collected packages: wcwidth, pycryptodome, prettytable, packaging, cbor2, crytic-compile, slither-analyzer
2023-02-21T18:31:29.8607997Z Successfully installed cbor2-5.4.6 crytic-compile-0.3.0 packaging-23.0 prettytable-3.6.0 pycryptodome-3.17 slither-analyzer-0.9.2 wcwidth-0.2.6
2023-02-21T18:31:29.9222411Z [-] SOLCVER was not set; guessing.
2023-02-21T18:31:29.9723716Z [-] Guessed 0.8.14.
2023-02-21T18:31:30.9342355Z Installing '0.8.14'...
2023-02-21T18:31:30.9347446Z Version '0.8.14' installed.
2023-02-21T18:31:31.0904508Z Switched global version to 0.8.14
2023-02-21T18:31:31.1013259Z [-] NODEVER was not set, using the latest version.
2023-02-21T18:31:31.6468941Z => Downloading nvm from git to '/github/home/.nvm'
2023-02-21T18:31:31.6471460Z 
2023-02-21T18:31:31.6901339Z Cloning into '/github/home/.nvm'...
2023-02-21T18:31:33.4587464Z => * (HEAD detached at FETCH_HEAD)
2023-02-21T18:31:33.4587714Z   master
2023-02-21T18:31:33.4608791Z => Compressing and cleaning up git repository
2023-02-21T18:31:33.4705429Z 
2023-02-21T18:31:33.4760982Z => Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
2023-02-21T18:31:33.4761553Z => Create one of them and run this script again
2023-02-21T18:31:33.4762961Z    OR
2023-02-21T18:31:33.4763841Z => Append the following lines to the correct file yourself:
2023-02-21T18:31:33.4764229Z 
2023-02-21T18:31:33.4765009Z export NVM_DIR="$HOME/.nvm"
2023-02-21T18:31:33.4765505Z [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
2023-02-21T18:31:33.4765684Z 
2023-02-21T18:31:33.5287561Z => Close and reopen your terminal to start using nvm or run the following to use it now:
2023-02-21T18:31:33.5287815Z 
2023-02-21T18:31:33.5287910Z export NVM_DIR="$HOME/.nvm"
2023-02-21T18:31:33.5288430Z [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
2023-02-21T18:31:34.5977750Z Downloading and installing node v19.7.0...
2023-02-21T18:31:34.7132874Z Downloading https://nodejs.org/dist/v19.7.0/node-v19.7.0-linux-x64.tar.xz...
2023-02-21T18:31:34.8681720Z 
2023-02-21T18:31:34.9744696Z                                                                            0.0%
2023-02-21T18:31:35.0744112Z ##                                                                         3.9%
2023-02-21T18:31:35.1749553Z #########                                                                 13.4%
2023-02-21T18:31:35.2800040Z ##########################                                                36.3%
2023-02-21T18:31:35.3366846Z ###########################################################               82.2%
2023-02-21T18:31:35.3367623Z ######################################################################## 100.0%
2023-02-21T18:31:35.3544361Z Computing checksum with sha256sum
2023-02-21T18:31:35.5078867Z Checksums matched!
2023-02-21T18:31:38.3763225Z Now using node v19.7.0 (npm v9.5.0)
2023-02-21T18:31:38.6784592Z Creating default alias: default -> node (-> v19.7.0 *)
2023-02-21T18:31:38.6793451Z [-] Foundry target detected, installing foundry nightly
2023-02-21T18:31:39.4794665Z curl: (22) The requested URL returned error: 403 
2023-02-21T18:31:39.4814837Z foundryup: installing foundry (version nightly, tag nightly-)
2023-02-21T18:31:39.5132229Z foundryup: downloading latest forge and cast
2023-02-21T18:31:39.7595683Z #=#=#                                                                         
2023-02-21T18:31:39.7595937Z 
2023-02-21T18:31:39.7596047Z ######################################################################## 100.0%
2023-02-21T18:31:39.7613548Z 
2023-02-21T18:31:39.7613777Z gzip: stdin: not in gzip format
2023-02-21T18:31:39.7616534Z tar: Child returned status 1
2023-02-21T18:31:39.7616860Z tar: Error is not recoverable: exiting now
2023-02-21T18:31:39.7620911Z foundryup: downloading manpages
2023-02-21T18:31:40.0463865Z #=#=#                                                                         
2023-02-21T18:31:40.0464123Z 
2023-02-21T18:31:40.0464278Z ######################################################################## 100.0%
2023-02-21T18:31:40.0480294Z 
2023-02-21T18:31:40.0484963Z gzip: stdin: not in gzip format
2023-02-21T18:31:40.0485451Z tar: Child returned status 1
2023-02-21T18:31:40.0485738Z tar: Error is not recoverable: exiting now
2023-02-21T18:31:40.0492610Z foundryup: line 128: /opt/foundry/bin/forge: No such file or directory
2023-02-21T18:31:40.0493171Z foundryup: installed - 
2023-02-21T18:31:40.0500999Z foundryup: line 129: /opt/foundry/bin/cast: No such file or directory
2023-02-21T18:31:40.0501480Z foundryup: installed - 
2023-02-21T18:31:40.0501758Z foundryup: done
2023-02-21T18:31:40.0545112Z /entrypoint.sh: line 234: forge: command not found
2023-02-21T18:31:40.0545700Z [-] Did not find a package.json, proceeding without installing JS dependencies.
2023-02-21T18:31:40.0546355Z [-] Did not find a requirements.txt, proceeding without installing Python dependencies.
2023-02-21T18:31:40.0546838Z [-] Installing dependencies from foundry.toml
elopez commented 1 year ago

Hi @0xTimepunk! Thanks for the report. This is an issue in foundryup, which does not handle GitHub rate limiting gracefully. It is being tracked here: https://github.com/foundry-rs/foundry/issues/3942

Usually re-running the job will get it working again.

0xTimepunk commented 1 year ago

Hi @0xTimepunk! Thanks for the report. This is an issue in foundryup, which does not handle GitHub rate limiting gracefully. It is being tracked here: foundry-rs/foundry#3942

Usually re-running the job will get it working again.

Okay I see! May close this then

fedealconada commented 7 months ago

Facing this issue at the moment... Did not get resolved by re-running the action.

elopez commented 7 months ago

@fedealconada please try the 0.3.1 release and see if your issue persists, you can check #66 for further context.

fedealconada commented 7 months ago

@fedealconada please try the 0.3.1 release and see if your issue persists, you can check #66 for further context.

has been solved, ty!

fedealconada commented 6 months ago

@fedealconada please try the 0.3.1 release and see if your issue persists, you can check #66 for further context.

has been solved, ty!

we are experiencing the issue again @elopez :/

elopez commented 6 months ago

@fedealconada it seems to be working fine over here right now, but I've opened PR #71 to add some retry logic in the foundry installation process. If possible, give it a try and let me know if that's any more reliable; you can change to using: crytic/slither-action@dev-foundryup-retry on your workflow to try it out.

PS: if the repo with the issue is kinto-core, I saw you have not upgraded to 0.3.1 which has the newer foundryup, you may want to try that as well 👍

fedealconada commented 6 months ago

@fedealconada it seems to be working fine over here right now, but I've opened PR #71 to add some retry logic in the foundry installation process. If possible, give it a try and let me know if that's any more reliable; you can change to using: crytic/slither-action@dev-foundryup-retry on your workflow to try it out.

PS: if the repo with the issue is kinto-core, I saw you have not upgraded to 0.3.1 which has the newer foundryup, you may want to try that as well 👍

great, i'll try with 0.3.1 and see if it works!