Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing persistent storage in Dockerfile / no data saved #4

Open
Paddy0174 opened this issue Mar 8, 2021 · 6 comments
Open

Missing persistent storage in Dockerfile / no data saved #4

Paddy0174 opened this issue Mar 8, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Paddy0174
Copy link

The addOn doesn't store data in a persistent storage, leading to loosing all data after a shutdown/restart.

As far as I know there should be a WORKDIR in the Dockerfile to set this up.

Reproduce:

  • install addOn
  • configure it (user, API key)
  • restart addOn
  • all data is missing including the first user
@Forceu Forceu added the bug Something isn't working label Mar 8, 2021
@Forceu
Copy link
Owner

Forceu commented Mar 8, 2021

Thank for the report! It seems that HASS requires data to be stored in the path /data, which means that the base docker image needs to be modified. I created an issue in the repo Forceu/barcodebuddy-docker#14 and will have a look at it in the next days.

@Paddy0174
Copy link
Author

Not totally sure about that, as the WORKDIR in almost all addOns (official ones) use only / and not /data? The letsencrypt and homematic addOns are the only ones with a specific notation to /usr/src.

See here: https://github.com/home-assistant/addons/search?q=WORKDIR

I'll install a changed version (just setting WORKDIR to /) in the next days and see what comes up. :) I'll report back. In the meantime I'll just do a partial snapshot only for BCB and restore if necessary.

Should I use this issue or Forceu/barcodebuddy-docker#14 to report?

Forceu added a commit that referenced this issue Mar 10, 2021
@Forceu
Copy link
Owner

Forceu commented Mar 10, 2021

No workdir has nothing to do with it, HASS only mounts the a /data volume by default. I modified the config file, can you try if it works now?

@Paddy0174
Copy link
Author

Unfortunately it doesn't seem to fix the issue.

But I have to admit I'm not sure how that worked... I didn't do anything to update the HA-addOn, but it seems it was updated automatically (I don't have the option for automatic update enabled)? Nonetheless I checked the file config.json and your changes were in there. After that I restarted the addOn (three times), it unfortunately didn't work. It still doesn't save the data. :(

@fredrikbaberg
Copy link
Contributor

fredrikbaberg commented Apr 8, 2021

Edit: re-wrote this after some new input on another addon, now much shorter.

You probably want to store files in /data and not use /config at all. If you make sure barcodebuddy.db is somewhere in /data I believe that would be enough.

@Forceu
Copy link
Owner

Forceu commented May 11, 2023

I am really sorry guys, I completely forgot about this issue, as I am not using the HA image. I linked the /config volume to /data in the current image, does this fix the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants