github-action-matrix-outputs-write icon indicating copy to clipboard operation
github-action-matrix-outputs-write copied to clipboard

/__t/jq/jq: Permission denied after downloading jq

Open andy-maier opened this issue 2 years ago • 1 comments

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

When using the cloudposse/github-action-matrix-outputs-read@main action in a python:3 container on ubuntu-latest, the "jq" command is downloaded and its directory put into the path. However, the downloaded "jq" command is not permitted to be executed:

Run cloudposse/github-action-matrix-outputs-read@main
Run dcarbone/[email protected]
Run _jq_bin="$(which jq)"
  
Run $GITHUB_ACTION_PATH/scripts/unixish.sh
Prep
Downloading jq
  Src: https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
  Dst: /__w/_temp/jq-linux64
  --2023-10-15 21:00:27--  https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
  Resolving github.com (github.com)... 140.82.113.3
  Connecting to github.com (github.com)|140.82.113.3|:443... connected.
  HTTP request sent, awaiting response... 301 Moved Permanently
  Location: https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 [following]
  --2023-10-15 21:00:27--  https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
  Reusing existing connection to github.com:443.
  HTTP request sent, awaiting response... 302 Found
  Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231015T210023Z&X-Amz-Expires=300&X-Amz-Signature=6feb6195b9d110d4be0799f76e2e381c3173210eb93ced457bced0c1becc4ec2&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=5101141&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream [following]
  --2023-10-15 21:00:27--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231015T210023Z&X-Amz-Expires=300&X-Amz-Signature=6feb6195b9d110d4be0799f76e2e381c3173210eb93ced457bced0c1becc4ec2&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=5101141&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream
  Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
  Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 3953824 (3.8M) [application/octet-stream]
  Saving to: ‘STDOUT’
  
       0K .......... .......... .......... .......... ..........  1% 9.07M 0s
      50K .......... .......... .......... .......... ..........  2% 9.28M 0s
     100K .......... .......... .......... .......... ..........  3% 75.9M 0s
     150K .......... .......... .......... .......... ..........  5% 41.0M 0s
     200K .......... .......... .......... .......... ..........  6% 14.5M 0s
starting download of artifact b97240eeb61bde8798445c3a1bee6ce1ab22afcdb2fc76162da088223e1f2fb1 : 6/11
Total number of files that will be downloaded: 1
starting download of artifact bfff4df7b9028ee660e7b58d64a9e6b10f77db2c7b136d419e5df897df2e577f : 7/11
Total number of files that will be downloaded: 1
starting download of artifact cd1fe3bb761ae833292c2ffc43117ae307fec08076ec5f4764071241902c1726 : 8/11
Total number of files that will be downloaded: 1
starting download of artifact d94c503bd1e3f5e13259eabf003eb8ec08a3d285fbfa520128ba25809855ea01 : 9/11
Total number of files that will be downloaded: 1
starting download of artifact ede039370d9719a6075054aa7f1d59e045d95db94ce982ac465d4cba7f398089 : 10/11
Total number of files that will be downloaded: 1
starting download of artifact f40a56632f833d2da570d3235db180dabc016e16dbb3e78ece200e490f7ae4b6 : 11/11
Total number of files that will be downloaded: 1
There were 11 artifacts downloaded
Artifact 013000256a173246685c48be3f081ed3cbb445c0399923b7c83cf0194ff8e553 was downloaded to /__w/nocaselist/nocaselist/013000256a173246685c48be3f081ed3cbb445c0399923b7c83cf0194ff8e553
Artifact 2bec8f88a51209dc0ef1ac6d01ce91f55b6d5c6c6ae39a2d509447488fc5f751 was downloaded to /__w/nocaselist/nocaselist/2bec8f88a51209dc0ef1ac6d01ce91f55b6d5c6c6ae39a2d509447488fc5f751
Artifact 71693cde4d349afe8d34a65b224c0b3be347dd524454a165ca9856f4c1046608 was downloaded to /__w/nocaselist/nocaselist/71693cde4d349afe8d34a65b224c0b3be347dd524454a165ca9856f4c1046608
Artifact 7677faf9c369236615efced6887231f50d9587c1b88c8f4de10bd7cd73c7f262 was downloaded to /__w/nocaselist/nocaselist/7677faf9c369236615efced6887231f50d9587c1b88c8f4de10bd7cd73c7f262
Artifact b6fcbca332cc00feb9f1a806d48c21b5f8410f4640ef3e1ef0d4e3e41bc21ecb was downloaded to /__w/nocaselist/nocaselist/b6fcbca332cc00feb9f1a806d48c21b5f8410f4640ef3e1ef0d4e3e41bc21ecb
Artifact b97240eeb61bde8798445c3a1bee6ce1ab22afcdb2fc76162da088223e1f2fb1 was downloaded to /__w/nocaselist/nocaselist/b97240eeb61bde8798445c3a1bee6ce1ab22afcdb2fc76162da088223e1f2fb1
Artifact bfff4df7b9028ee660e7b58d64a9e6b10f77db2c7b136d419e5df897df2e577f was downloaded to /__w/nocaselist/nocaselist/bfff4df7b9028ee660e7b58d64a9e6b10f77db2c7b136d419e5df897df2e577f
Artifact cd1fe3bb761ae833292c2ffc43117ae307fec08076ec5f4764071241902c1726 was downloaded to /__w/nocaselist/nocaselist/cd1fe3bb761ae833292c2ffc43117ae307fec08076ec5f4764071241902c1726
Artifact d94c503bd1e3f5e13259eabf003eb8ec08a3d285fbfa520128ba25809855ea01 was downloaded to /__w/nocaselist/nocaselist/d94c503bd1e3f5e13259eabf003eb8ec08a3d285fbfa520128ba25809855ea01
Artifact ede039370d9719a6075054aa7f1d59e045d95db94ce982ac465d4cba7f398089 was downloaded to /__w/nocaselist/nocaselist/ede039370d9719a6075054aa7f1d59e045d95db94ce982ac465d4cba7f398089
Artifact f40a56632f833d2da570d3235db180dabc016e16dbb3e78ece200e490f7ae4b6 was downloaded to /__w/nocaselist/nocaselist/f40a56632f833d2da570d3235db180dabc016e16dbb3e78ece200e490f7ae4b6
Artifact download has finished successfully
Run result="$(find . -name write_status -maxdepth 2 -exec cat {} \; | jq -c --slurp 'map(to_entries | map(.key as $matrix_key | .value | map_values({($matrix_key): .}))) | flatten | reduce .[] as $item ({}; . * $item)' )"
  result="$(find . -name write_status -maxdepth 2 -exec cat {} \; | jq -c --slurp 'map(to_entries | map(.key as $matrix_key | .value | map_values({($matrix_key): .}))) | flatten | reduce .[] as $item ({}; . * $item)' )"
  echo "result=${result}" >> $GITHUB_OUTPUT
  shell: bash --noprofile --norc -e -o pipefail {0}
/__w/_temp/13f6c6b9-4728-437e-bb29-2563cc40925d.sh: line 1: /__t/jq/jq: Permission denied
Error: Process completed with exit code 126.

Expected Behavior

The action should work.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Use the action in a python:3 container on ubuntu-latest

Screenshots

None, but the error can be seen here: https://github.com/pywbem/nocaselist/actions/runs/6526422703/job/17720181634

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: ubuntu-latest of Github Actions, in python:3 container

Additional Context

None

andy-maier avatar Oct 15 '23 21:10 andy-maier

@andy-maier, thanks for the bug report. I'll pay attention next week.

goruha avatar Oct 26 '23 15:10 goruha