Is your docker also corrupt after a reboot? (OMV5, Pi4) This might fix it!

  • Hi guys,


    I just did a fresh, clean install of OMV5 on Raspberry Pi 4 with a WD external USB3 Hard Drive as storage. Everything works perfectly, as a charm!
    Only issue I had, was that after a reboot, Docker became corrupt and running docker or docker-compose commands failed with weird errors about network, or layers not existing.
    I think it has something to do with the docker data moved to the USB3 HD, and that the data was not available at the time of Docker init. So, to fix it, I delayed the docker initialization with 30 sec:

    Note, the only important line to change is line 14, the actual delay. You also might want to increase line 28, the StartLimitInterval. I chose 300 sec.


    Now, everything works as expected. After a reboot, Docker is usable without manual restart, and it also restarts your containers properly (given you have set the proper restart policies in the containers).

  • Was having the same issue with normal hdd (no usb) and OMV on PC. Emby in docker/portainer was restarting from scratch like there were no Config folder when rebooting OMV.

    Your solution fixed the problem.

    Thanks for sharing. :thumbup:

  • Hi,


    I just registered to say Thank you (you saved many hours) and to suggest this is integrated into the FAQ. I will also try to fill an issue in the docker-gui repo to suggest including this change as an option.

  • I have the same problem.

    I'm a novice in a linux environment, so I apologize in advance for probably trivial questions.


    1) In my docker.service file I don't have the ExecStartPre line; needs to be added? Is it normal that it's not there?


    2) When I try to edit the docker.service file through Putty, I am warned that the file is not writable, so I can't save the changes.


    Thanks

    openmediavault 5.5.0-1

    Raspberry Pi 4 Model B 4GB RAM + MicroSD 32GB Samsung UHS-I

    FANTEC QB-35US3-6G Usb 3.0 Box Case + 1TB HDD + 2TB HDD + 4TB HDD

    • Official Post

    sudo systemctl edit docker.service is the proper way to add overrides/changes...

    omv 7.4.10-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.14 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Probably you are not logged in as "root".

    Add a "sudo" to the line to edit the file with root-super-power.


    sudo nano /lib/systemd/system/docker.service

    of course :D



    I did it!

    I have attempted a reboot and everything seems to be ok!


    Thanks

    openmediavault 5.5.0-1

    Raspberry Pi 4 Model B 4GB RAM + MicroSD 32GB Samsung UHS-I

    FANTEC QB-35US3-6G Usb 3.0 Box Case + 1TB HDD + 2TB HDD + 4TB HDD

  • sudo systemctl edit docker.service is the proper way to add overrides/changes...

    so when doing this, I get a blank file. I add the following and save and close.

    Code
    ExecStartPre=/bin/sleep 30
    StartLimitInterval=300s

    After I save the docker.service file in systemd does not get modified. Is this expected behaviour?

    • Official Post

    Is this expected behaviour?

    Yes. When you create the override file, it is a file created in /etc/systemd/system/docker.service.d/ instead of altering the package supplied unit file. The commands in this file will override the the normal unit file. So, you should edit and put:


    [Service]

    ExecStartPre=/bin/sleep 30

    StartLimitInterval=300s

    omv 7.4.10-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.14 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Yes. When you create the override file, it is a file created in /etc/systemd/system/docker.service.d/ instead of altering the package supplied unit file. The commands in this file will override the the normal unit file. So, you should edit and put:


    [Service]

    ExecStartPre=/bin/sleep 30

    StartLimitInterval=300s

    Is this solution will prevent to have this changes to be overwrite at each OMV upgrade?

    Is it the file openmediavault-docker-gui.conf to be modified?

  • I do not know if it is related although Docker is running properly at Docker storage /srv/dev-disk-by-label-WD_10TB_1/docker

    I am unable to start portainer something went wrong trying to pull and start portainer ... Done.?

    EDIT

    Actually I had to change the port from 8000 to 8500 since an other container was using it (cloudcommander)

    • Official Post

    Is this solution will prevent to have this changes to be overwrite at each OMV upgrade?

    Yes.


    Is it the file openmediavault-docker-gui.conf to be modified?

    No.

    omv 7.4.10-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.14 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • In /etc/systemd/system/docker.service.d/ I got 3 files openmediavault.conf: openmediavault-docker-gui.conf: waitLocalFs.conf

    where should I put the mod ?

    also why not implement it definitely in a future revision of OMV?

    • Official Post

    In /etc/systemd/system/docker.service.d/ I got 3 files openmediavault.conf: openmediavault-docker-gui.conf: waitLocalFs.conf

    where should I put the mod ?

    omv-extras writes the waitLocalFs.conf. So, I wouldn't change that one. And instead of delay, delete all of the files in /etc/systemd/system/docker.service.d/ and try the following (as root):


    Code
    cat <<EOF > /etc/systemd/system/docker.service.d/waitAllMounts.conf
    [Unit]
    After=local-fs.target $(systemctl list-units --type=mount | grep /srv | awk '{ print $1 }' | tr '\n' ' ')
    EOF

    If that works, I will change omv-extras to use that code.

    omv 7.4.10-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.14 | compose 7.2.14 | k8s 7.3.1-1 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!