lucacome/docker-image-update-checker

Workflow run failed

dontobi opened this issue ยท 30 comments

Hi

After creating this workflow, I get the following error:

Run lucacome/docker-image-update-checker@v1.1.0
  with:
    base-image: library/debian:bullseye-slim
    image: dontobi/ioBroker.docker:latest
Run result=$(base=library/debian:bullseye-slim image=dontobi/ioBroker.docker:latest /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.1.0/docker.sh)
  result=$(base=library/debian:bullseye-slim image=dontobi/ioBroker.docker:latest /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.1.0/docker.sh)
  echo "::set-output name=result::${result}"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
jq: error (at <stdin>:1): Cannot index number with string "layers"
parse error: Invalid numeric literal at line 1, column 9
parse error: Unmatched '}' at line 3, column 14
Error: Process completed with exit code 4.

Maybe you can give me a hint what is going wrong and what I would have to adjust.

Thank you.
Greetings from Germany
Tobi

Hi @dontobi

you receive that error because the name of your image is invalid (uppercase B), it should be dontobi/iobroker.docker:latest.

I guess I could add sanitization to the image name, but even the Docker client doesn't work with the wrong name:

โฏ docker pull dontobi/ioBroker.docker:latest
invalid reference format: repository name must be lowercase

I adjusted the time in the workflow and it works. Thanks for the tip, apparently I was blind. Should I close here?

Closed

Thanks, I'm working on a rewrite in typescript for this action, I'll keep this issue in mind!

After I got the workflow running on my ioBroker container with your help, I added the workflow to my 3 other containers. Unfortunately, this does not run on all three.

motioneye.rpi

Run lucacome/docker-image-update-checker@v1.1.0
Run result=$(base=library/debian:buster-slim image=dontobi/motioneye.rpi:latest /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.1.0/docker.sh)
jq: error (at <stdin>:1): Cannot iterate over null (null)
parse error: Unmatched '}' at line 3, column 14
Error: Process completed with exit code 4.

nextcloud-client.rpi

Run lucacome/docker-image-update-checker@v1.1.0
Run result=$(base=library/alpine:latest image=dontobi/nextcloud-client.rpi:latest /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.1.0/docker.sh)
jq: error (at <stdin>:1): Cannot iterate over null (null)
parse error: Unmatched '}' at line 3, column 14
Error: Process completed with exit code 4.

speedflux.rpi

Run lucacome/docker-image-update-checker@v1.1.0
Run result=$(base=library/python:3.9-slim-bullseye image=dontobi/speedflux.rpi:latest /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.1.0/docker.sh)
jq: error (at <stdin>:1): Cannot iterate over null (null)
parse error: Unmatched '}' at line 7, column 14
Error: Process completed with exit code 4.

Unfortunately, I can't see any mistake. This time I paid attention to the upper and lower case. Can you look at it again? Would it be possible to integrate error codes with hints?

reopen - see problems (one post higher)

Run lucacome/docker-image-update-checker@v1
Run result=$(base=pihole/pihole:latest image=jacklul/pihole:dev /home/runner/work/_actions/lucacome/docker-image-update-checker/v1/docker.sh)
jq: error (at <stdin>:1): Cannot iterate over null (null)
parse error: Expected value before ',' at line 1, column 10
Error: Process completed with exit code 4.

Started happening in my repo. ref

same here,
i think it is due to the fact what ever you throws at a git hub the answer is :

{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"<repo>","Action":"pull"}]}]}

so the jq line :

jq -r '.errors[0].code' <<< <DIGESTRESULT>

return

parse error: Invalid numeric literal at line 1, column 8

Manuel run work , but of course since you cant auth you hit the rate limit :) Great
so i think it is an issue on dockerhubb side

@devzwf are you using the version from main?

- name: Docker Image Update Checker id: check uses: lucacome/docker-image-update-checker@v1

edit : this cut and paste did not go well LOL
edit2 : i see for troubleshoot i use main

I think it might be definitively an issue with docker hub....
seeing more and more report

I noticed I wasn't using the latest version, and also did a pull request to update the readme.

name: Docker Image Update Checker
uses: lucacome/docker-image-update-checker@v1.1.1

Not sure if this was causing the issue of the github issues.

I noticed I wasn't using the latest version, and also did a pull request to update the readme.

name: Docker Image Update Checker

uses: lucacome/docker-image-update-checker@v1.1.1

Not sure if this was causing the issue of the github issues.

Still fails with using 1.1.1

For what is worth, I tried running the docker.sh (v1.1.1) script manually:

base='debian:stable-slim' image='aguslr/docker-airsane' /usr/bin/bash -x ./docker.sh

And I get the following extra information:

++ digestOutput='{"errors":[{"code":"MANIFEST_UNKNOWN","message":"OCI index found, but accept header does not support OCI indexes"}]}'
++ jq -r '[.layers[].digest]'
jq: error (at <stdin>:1): Cannot iterate over null (null)
+ layers_image=
+ jq '.base-.image | .!=[]'
parse error: Expected value before ',' at line 1, column 10

Using the script version from the most recent commit (a73ec56) is a bit more verbose but the error seems to be the same:

+++ digestOutput='{"errors":[{"code":"MANIFEST_UNKNOWN","message":"OCI index found, but accept header does not support OCI indexes"}]}'
+++ jq -e -r '.errors[0].code'
+++ jq -r '.errors[0].code'
++ result=MANIFEST_UNKNOWN
++ [[ MANIFEST_UNKNOWN == \U\N\A\U\T\H\O\R\I\Z\E\D ]]
++ echo MANIFEST_UNKNOWN
+ layers_image=MANIFEST_UNKNOWN
+ jq '.base-.image | .!=[]'
parse error: Invalid numeric literal at line 3, column 29

I tried adding application/vnd.oci.image.manifest.v1+json, from OCI Image Media Types, as the accepted header on the curl command to no avail.

@aguslr I've started seeing this error too and it seems to be a little bit different than the other errors reported here.
I'll try to do a fix for this one tonight, since it's the one that I can reproduce.

Added

I've opened #18 which will take care of #17 but I think it will also fix some (all?) of the errors in this thread.

I've opened #18 which will take care of #17 but I think it will also fix some (all?) of the errors in this thread.

Tested the new script in #18 manually again and it does output false and exits with code 0:

base='debian:bullseye-slim' image='nginx:latest' /usr/bin/bash -x ./docker.sh ; echo $?
Show output
++ jq -e -r '.errors[0].code'
++ jq -r '[.manifests[] | select(.platform.architecture | contains ("unknown") | not) | {digest: .digest, platform: (.platform.os +"/"+ .platform.architecture)}]'
+ manifests_image='[
  {
    "digest": "sha256:4c1c50d0ffc614f90b93b07d778028dc765548e823f676fb027f61d281ac380d",
    "platform": "linux/amd64"
  },
  {
    "digest": "sha256:c471e553f45314825603699e9b05aa947c900fcad94ae6fad8c4dfa01fc01d37",
    "platform": "linux/arm"
  },
  {
    "digest": "sha256:527ebc85cf4ff049c457374ab4f3297061407b1eefa9263efa664b20466a14fd",
    "platform": "linux/arm"
  },
  {
    "digest": "sha256:687e0e4a235ee770533f6c25fb5791b14d7b6aa603ba4ed724abbd2ed51ee11a",
    "platform": "linux/arm64"
  },
  {
    "digest": "sha256:ae32b34eeb2536cd6ce442209472becbd854de226bb253ec5721e6f9828df595",
    "platform": "linux/386"
  },
  {
    "digest": "sha256:106a0ffb03d9dc10587ef40bcc8a3898b1d8d70b8866be8fc8a7050647e3076a",
    "platform": "linux/mips64le"
  },
  {
    "digest": "sha256:2fcd9e331097b384f5452ea886b7b81d32ca9477f3cd484b850ddfe0db11a1fc",
    "platform": "linux/ppc64le"
  },
  {
    "digest": "sha256:7f6fe445c903c61e043571849c46c9d1ccde360aadc9c6f945053e530ab1e598",
    "platform": "linux/s390x"
  }
]'
+ diff=false
./docker.sh: line 105: platforms: unbound variable
++ tr , ' '
+ echo false
false
0

However, I don't know if this error is relevant:

./docker.sh: line 105: platforms: unbound variable

I wish we could test this on an image whose base image has been updated.

Edit: OK, @lucacome suggested passing the platforms variable and it works ๐Ÿ˜ƒ:

$ base='debian:bullseye-slim' image='nginx:latest' platforms='linux/amd64' /usr/bin/bash -x ./docker.sh ; echo $?
Show output
++ digestOutput='{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
   "config": {
      "mediaType": "application/vnd.docker.container.image.v1+json",
      "size": 7656,
      "digest": "sha256:a99a39d070bfd1cb60fe65c45dea3a33764dc00a9546bf8dc46cb5a11b1b50e9"
   },
   "layers": [
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 31396972,
         "digest": "sha256:8740c948ffd4c816ea7ca963f99ca52f4788baa23f228da9581a9ea2edd3fcd7"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 25470551,
         "digest": "sha256:d2c0556a17c5d136fc0387f936672d6922c0ee0c412e39f10bdb9abea3790815"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 626,
         "digest": "sha256:c8b9881f2c6a7c0a4b133402af9b73c6d7f481ac9b455f6f96e6181f12a8a78a"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 958,
         "digest": "sha256:693c3ffa8f43a3ae70d512c7add694b6c66a3d69262c4433acd3e0aa6d0d8b8b"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 772,
         "digest": "sha256:8316c5e80e6d3abc453220bd5858bb7bd5ac08d8b79a13378b500d6e70f91c1d"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 1404,
         "digest": "sha256:b2fe3577faa434a4ca212810cb5d245ab0923d078b44d17f9e26609772f655bf"
      }
   ]
}'
++ jq -e -r '.errors[0].code'
++ jq -r '[.layers[].digest]'
+ layers_image='[
  "sha256:8740c948ffd4c816ea7ca963f99ca52f4788baa23f228da9581a9ea2edd3fcd7",
  "sha256:d2c0556a17c5d136fc0387f936672d6922c0ee0c412e39f10bdb9abea3790815",
  "sha256:c8b9881f2c6a7c0a4b133402af9b73c6d7f481ac9b455f6f96e6181f12a8a78a",
  "sha256:693c3ffa8f43a3ae70d512c7add694b6c66a3d69262c4433acd3e0aa6d0d8b8b",
  "sha256:8316c5e80e6d3abc453220bd5858bb7bd5ac08d8b79a13378b500d6e70f91c1d",
  "sha256:b2fe3577faa434a4ca212810cb5d245ab0923d078b44d17f9e26609772f655bf"
]'
++ jq '.base-.image | .!=[]'
+ diff=false
+ [[ false == \t\r\u\e ]]
+ echo false
false
0

My bad! I should I've checked the actions.yml file first.

I've also manually tested other images that gave errors to other users in this very same issue.

@dontobi's images in #5 (comment):

base='library/alpine:latest' image='dontobi/nextcloud-client.rpi:latest' platforms='linux/arm64' /usr/bin/bash -x ./docker.sh
Show output
++ digestOutput='{
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "digest": "sha256:a372d4fce2ec53b11b18dacdaa88931e42a8061a07347285214c0a0694473ab6",
    "size": 4248
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:a9eaa45ef418e883481a13c7d84fa9904f2ec56789c52a87ba5a9e6483f2b74f",
      "size": 3259241
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:dd7306be7d89e917c6d1e8da096a590d31e330506ddb0155c5f1521216cd2825",
      "size": 1254
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:d648d5fb926abc4a63b75035952d8d13a58c3e9ef6eec440ecb6a51eb60c7982",
      "size": 167916106
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:59ed39457e522cbbd18fc6e6da521423b4912999c2c12ad718876cde8eb8cf75",
      "size": 956
    }
  ]
}'
++ jq -e -r '.errors[0].code'
++ jq -r '[.layers[].digest]'
+ layers_image='[
  "sha256:a9eaa45ef418e883481a13c7d84fa9904f2ec56789c52a87ba5a9e6483f2b74f",
  "sha256:dd7306be7d89e917c6d1e8da096a590d31e330506ddb0155c5f1521216cd2825",
  "sha256:d648d5fb926abc4a63b75035952d8d13a58c3e9ef6eec440ecb6a51eb60c7982",
  "sha256:59ed39457e522cbbd18fc6e6da521423b4912999c2c12ad718876cde8eb8cf75"
]'
++ jq '.base-.image | .!=[]'
+ diff=false
+ [[ false == \t\r\u\e ]]
+ echo false
false

And @jacklul's image in #5 (comment):

base='pihole/pihole:latest' image='jacklul/pihole:dev' platforms='linux/amd64' /usr/bin/bash -x ./docker.sh
Show output
++ digestOutput='{                                                                                                                                                                                                                                                                                                             
  "mediaType": "application/vnd.oci.image.manifest.v1+json",                                                                                                                                                                                                                                                                   
  "schemaVersion": 2,                                                                                                                                                                                                                                                                                                          
  "config": {                                                                                                                                                                                                                                                                                                                  
    "mediaType": "application/vnd.oci.image.config.v1+json",                                                                                                                                                                                                                                                                   
    "digest": "sha256:3ec3bc95bd841a284d95263475197f301ddb93a97ce832e3b3b72b7391c2620b",                                                                                                                                                                                                                                       
    "size": 8295                                                                                                                                                                                                                                                                                                               
  },                                                                                                                                                                                                                                                                                                                           
  "layers": [                                                                                                                                                                                                                                                                                                                  
    {                                                                                                                                                                                                                                                                                                                          
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",                                                                                                                                                                                                                                                              
      "digest": "sha256:8740c948ffd4c816ea7ca963f99ca52f4788baa23f228da9581a9ea2edd3fcd7",                                                                                                                                                                                                                                     
      "size": 31396972                                                                                                                                                                                                                                                                                                         
    },                                                                                                                                                                                                                                                                                                                         
    {                                                                                                                                                                                                                                                                                                                          
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",                                                                                                                                                                                                                                                              
      "digest": "sha256:74b2b0717c840a30f85c5423d9e0f72580ceb6c91063ce38ea39720fe10c33cd",                                                                                                                                                                                                                                     
      "size": 57099247                                                                                                                                                                                                                                                                                                         
    },                                                                                                                                                                                                                                                                                                                         
    {                                                                                                                                                                                                                                                                                                                          
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",                                                                                                                                                                                                                                                              
      "digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1",                                                                                                                                                                                                                                     
      "size": 32                                                                                                                                                                                                                                                                                                               
    },                                                                                                                                                                                                                                                                                                                         
    {                                                                                                                                                                                                                                                                                                                          
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",                                                                                                                                                                                                                                                              
      "digest": "sha256:906d52b7fb96e23bd1661e678eb05288572549cd3a1c1435ed601e78d7b0cdfe",                                                                                                                                                                                                                                     
      "size": 129                                                                                                                                                                                                                                                                                                              
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:a12f2d5afd511a6c83f456e70dfa93f723bace5fc74a203a7fd28e9d4d9404de",
      "size": 12600
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:f337f5bbd2158e1855e162cad56e0371188727f42a59a44fc1e50ed2fc7b43b4",
      "size": 722
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:3c3ecc4671630da8e1c0534dbb88b0738df0b9de3b1cf1afa1213d83e6a43ad6",
      "size": 30222072
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:5ef3501969a82601c5ef197bee0df281b2929f9c09bfe7c7b21c22cce447ecc4",
      "size": 13655
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:72b0fbba1d749215a1b2d3e5f2cee5325b9bcd029bf62ec1d3679b1b7f3e5aa1",
      "size": 13656
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:66b968e5258dc28e14f624d04fc4a5a81fc6b9d31816adb0fd11d7bc47d57093",
      "size": 21413
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:4141b47ef0fd1440da428967c07d325c66cf662a85d1c9b362192b2dbf338cd2",
      "size": 938680
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:f6c1bf7361bc24a2aad5aa45a713e35cb1a9cb706d5579bc5d2b4c5c6a994501",
      "size": 19886
    }
  ]
}'
++ jq -e -r '.errors[0].code'
++ jq -r '[.layers[].digest]'
+ layers_image='[
  "sha256:8740c948ffd4c816ea7ca963f99ca52f4788baa23f228da9581a9ea2edd3fcd7",
  "sha256:74b2b0717c840a30f85c5423d9e0f72580ceb6c91063ce38ea39720fe10c33cd",
  "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1",
  "sha256:906d52b7fb96e23bd1661e678eb05288572549cd3a1c1435ed601e78d7b0cdfe",
  "sha256:a12f2d5afd511a6c83f456e70dfa93f723bace5fc74a203a7fd28e9d4d9404de",
  "sha256:f337f5bbd2158e1855e162cad56e0371188727f42a59a44fc1e50ed2fc7b43b4",
  "sha256:3c3ecc4671630da8e1c0534dbb88b0738df0b9de3b1cf1afa1213d83e6a43ad6",
  "sha256:5ef3501969a82601c5ef197bee0df281b2929f9c09bfe7c7b21c22cce447ecc4",
  "sha256:72b0fbba1d749215a1b2d3e5f2cee5325b9bcd029bf62ec1d3679b1b7f3e5aa1",
  "sha256:66b968e5258dc28e14f624d04fc4a5a81fc6b9d31816adb0fd11d7bc47d57093",
  "sha256:4141b47ef0fd1440da428967c07d325c66cf662a85d1c9b362192b2dbf338cd2",
  "sha256:f6c1bf7361bc24a2aad5aa45a713e35cb1a9cb706d5579bc5d2b4c5c6a994501"
]'
++ jq '.base-.image | .!=[]'
+ diff=false
+ [[ false == \t\r\u\e ]]
+ echo false
false

They both seem to work so I'd say that #18 fixes this issue too. ๐Ÿ‘

Thanks for taking the time to test it @aguslr !

I'll merge #18 and start testing it with lucacome/docker-image-update-checker@main in my workflows.

I've published https://github.com/lucacome/docker-image-update-checker/releases/tag/v1.2.0 let me know if you're still seeing errors

@lucacome i am confirming that fix the issue
Great job
thanks

Same issue here!
I've tried @main but it still returned a jq: error (at <stdin>:170): Cannot iterate over null (null)
ref

@Potat0000, your images seem to give a different error:

base='caddy:latest' image='potat0000/caddy:latest' platforms='linux/amd64' /usr/bin/bash -x ./docker.sh
++ jq -e -r '.errors[0].code'
++ jq -r '[.manifests[] | select(.platform.architecture | contains ("unknown") | not) | {digest: .digest, platform: (.platform.os +"/"+ .platform.architecture)}]'
jq: error (at <stdin>:170): Cannot iterate over null (null)
+ manifests_image=

This morning an other error show up

Run lucacome/docker-image-update-checker@v1.2.0
Run result=$(base=pihole/pihole:latest image=devzwf/pihole-dot-doh:latest platforms=linux/amd[6](https://github.com/devzwf/pihole-dot-doh/actions/runs/4025251534/jobs/6918236624#step:2:7)4 /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.2.0/docker.sh)
  result=$(base=pihole/pihole:latest image=devzwf/pihole-dot-doh:latest platforms=linux/amd64 /home/runner/work/_actions/lucacome/docker-image-update-checker/v1.2.0/docker.sh)
  echo "result=${result}" >>$GITHUB_OUTPUT
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
jq: error (at <stdin>:24[8](https://github.com/devzwf/pihole-dot-doh/actions/runs/4025251534/jobs/6918236624#step:2:9)): Cannot iterate over null (null)
Error: Process completed with exit code 5.

seems like @Potat0000 's error

@Potat0000 @devzwf I just tested the images from my previous comments and they work without any error, so this seems to be an entirely new issue.

@Potat0000 @devzwf I just tested the images from my previous comments and they work without any error, so this seems to be an entirely new issue.

Fine! So should I open a new issue or just keep using it since it still a "Workflow run failed" situation :)

@Potat0000, that's up to @lucacome, of course. I just wanted to reiterate that #18 did fix some of the errors that users encountered in this issue. ๐Ÿ˜ƒ

@devzwf If you could open a new issue that'd be great. I also just added an option for enabling debug in #21 so maybe you can give that a try from @main?

I'm going to close this one for now.

I've opened another issue #22 to track my new issue.