Fix to a small issue with updating OCI docker images


Recommended Posts

Hello,

 

I came across a small issue regarding the version status of an image that apparently was in OCI format. Unraid wasn't able to get the manifest information file because of wrong headers. As a result, checking for updates showed "Not available" instead. The docker image is the linuxGSM docker container and the fix is really simple. 

 

This is for Unraid version 6.11.5 but it will work even for older versions if you find the corresponding line in that file.

 

SSHing into the Unraid server, in file:

/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

change line 448 to this:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.index.v1+json'];

And the version check worked after that.

 

I suppose this change will be removed upon server restart but it will be nice if you can include it on the next Unraid update 😊

 

Thanks

 

Edited by m33ts4k0z
  • Like 22
  • Thanks 15
  • Upvote 1
Link to comment
  • m33ts4k0z changed the title to Fix to a small issue with updating OCI docker images
On 1/21/2023 at 11:14 AM, m33ts4k0z said:

SSHing into the Unraid server, in file:

/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

change line 448 to this:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.index.v1+json'];

And the version check worked after that.

 

Could you post what line 448 looks like prior to the above update?  I'm running 6.9.2 and I'm wanting to make sure I'm touching the correct line.  My current line 448 reads:

$reply_json = json_decode($reply, true);

 

Seems like a really radical update if that's what I'm supposed to be replacing.

 

More and more of my dockers have gone "not available" in the past week, for reasons I'm unaware of.  I'm hoping that this might fix it.  TIA

ETA: I'm also not opposed to upgrading to 6.10 or 6.11 if one or the other will resolve this.  Thx again.

Edited by kcgodwins
  • Upvote 1
Link to comment
11 minutes ago, kcgodwins said:

 

Could you post what line 448 looks like prior to the above update?  I'm running 6.9.2 and I'm wanting to make sure I'm touching the correct line.  My current line 448 reads:

$reply_json = json_decode($reply, true);

 

Seems like a really radical update if that's what I'm supposed to be replacing.

 

More and more of my dockers have gone "not available" in the past week, for reasons I'm unaware of.  I'm hoping that this might fix it.  TIA

ETA: I'm also not opposed to upgrading to 6.10 or 6.11 if one or the other will resolve this.  Thx again.

This is for Unraid version 6.11.5. the line looks the same but without the

,application/vnd.oci.image.index.v1+json'

Im not sure how this line looks like on 6.10 but if you could find:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json'];

Just append it after:

 

,application/vnd.docker.distribution.manifest.v2+json

 

Link to comment
12 minutes ago, SnugglyDino said:

I still get permission denied. It's really weird.

image.png.ea6e5d39d032132278ccd20741725cbb.png

The command you need is as follows:

nano /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

 

You can also use WinSCP if you are on Windows. Choose SCP protocol and connect to the same port as SSH.

Edited by m33ts4k0z
Link to comment
14 minutes ago, m33ts4k0z said:

The command you need is as follows:

nano /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

 

You can also use WinSCP if you are on Windows. Choose SCP protocol and connect to the same port as SSH.

Thank you. I can finally update my docker containers now!

Edited by SnugglyDino
Link to comment
On 1/21/2023 at 10:14 AM, m33ts4k0z said:

Hello,

 

I came across a small issue regarding the version status of an image that apparently was in OCI format. Unraid wasn't able to get the manifest information file because of wrong headers. As a result, checking for updates showed "Not available" instead. The docker image is the linuxGSM docker container and the fix is really simple. 

 

This is for Unraid version 6.11.5 but it will work even for older versions if you find the corresponding line in that file.

 

SSHing into the Unraid server, in file:

/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

change line 448 to this:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.index.v1+json'];

And the version check worked after that.

 

I suppose this change will be removed upon server restart but it will be nice if you can include it on the next Unraid update 😊

 

Thanks

 

 

The Unraid webgui is actually open source, since you found the solution if you are interested you can submit a PR here:

  https://github.com/limetech/webgui

 

  • Like 1
  • Upvote 3
Link to comment
On 1/21/2023 at 11:14 AM, m33ts4k0z said:

Hello,

 

I came across a small issue regarding the version status of an image that apparently was in OCI format. Unraid wasn't able to get the manifest information file because of wrong headers. As a result, checking for updates showed "Not available" instead. The docker image is the linuxGSM docker container and the fix is really simple. 

 

This is for Unraid version 6.11.5 but it will work even for older versions if you find the corresponding line in that file.

 

SSHing into the Unraid server, in file:

/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

change line 448 to this:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.index.v1+json'];

And the version check worked after that.

 

I suppose this change will be removed upon server restart but it will be nice if you can include it on the next Unraid update 😊

 

Thanks

 

 

THANK YOU!!! just the answer I was looking for!

Link to comment
On 1/23/2023 at 1:48 PM, m33ts4k0z said:

This is for Unraid version 6.11.5. the line looks the same but without the

,application/vnd.oci.image.index.v1+json'

Im not sure how this line looks like on 6.10 but if you could find:

$header = ['Accept: application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json'];

Just append it after:

 

,application/vnd.docker.distribution.manifest.v2+json

 

 

Thanks, I'll take a look at it.

 

Do you (or anyone) know why this has become an issue all of a sudden?  Just curious.

Thanks again.

Mike

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.