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).

  • 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.x

    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 + 1TB HDD

  • 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.x

    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 + 1TB 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?

  • 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 5.5.9 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    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)

  • 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 5.5.9 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    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 ?

    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 5.5.9 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.6
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    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!