casperklein / homeassistant-addons

Home Assistant Add-on Repository
23 stars 3 forks source link

Media (images) gone after add-on restart/update #11

Closed Fred2024 closed 1 year ago

Fred2024 commented 1 year ago

Add-on name Netbox

Describe the bug Media (images) gone after add-on update

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Device Types'
  2. Click on 'Device Types'
  3. Click on a device
  4. Click on 'edit'
  5. Upload an image
  6. Upgrade add-on and you will see the media folder is empty and the images are gone.

Expected behavior The images should be migrated to the new volume

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Is it possible to keep the images while updating the add-on? Now with every update they are gone.

Thanks Fred.

casperklein commented 1 year ago

Now with every update they are gone.

Is this a newly introduced regression / did this every work at some point?

I am wondering if the images are also lost, when you stop/start the addon.

Fred2024 commented 1 year ago

Hi Casper,

This never worked since I started using the add-on. (at least 10 versions back) I was hoping it would get solved but it didn't so now I finally posted it here. The images are not lost when you restart the add-on. Only after an update.

I think it might be because it doesn't have a persistent volume? And the volume gets replaced with an update? But I'm not sure if this is correct.

In the original docker compose file from netbox https://github.com/netbox-community/netbox-docker/blob/release/docker-compose.yml I see the following volumes. volumes:

I don't see them here https://github.com/casperklein/homeassistant-addons/blob/master/netbox/config.json

But my knowledge of docker is also limited so I might not understand things correctly.

Fred.

casperklein commented 1 year ago

The images are not lost when you restart the add-on. Only after an update.

I cannot confirm this. I did a quick test and the image vanished after restarting the addon. This makes sense to me, because updating the addon and restarting the addon, both actions destroy the container and start a new one.

casperklein commented 1 year ago

Fixed in version 3.4.5.1 👍

Fred2024 commented 1 year ago

Thanks Casper for the fast response. I just updated to 3.4.5.1 this removed the images again. But I believe that normal. On the next update from 3.4.5.1 it should be ok.

casperklein commented 1 year ago

Version 3.4.6 has just been released. Please check if your problem is solved.

Fred2024 commented 1 year ago

I can confirm this works perfect now. All images are still there after the update.

Thank you