portainer: how to update to latest version

  • A very nice tool to look at docker logs is Dozzle amir20/dozzle

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 16GB ECC RAM.

  • A very nice tool to look at docker logs is Dozzle amir20/dozzle

    Very nice indeed! Thanks gderf .

    If you are relatively practiced using docker-compose it takes less than five minutes to deploy. Here's the GitHub page.

    Easy data backup: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV 5 (current) - Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, Wetty, & Heimdall - NanoPi M4 (v.1): backups using Rsync and Rsnapshot - Odroid XU4 (Using DietPi): PiHole - hc2, xu4, Pi 3B+, Odroid H2, and VirtualBox: Testing and playing - Mac user converting to Linux, Debian 10 KDE.

  • Just a short comment in general on KM0201 and chente in posts 37 - 40 above: This is the beauty of OMV - simple enough for a moron like me to set up a powerful and reliable server with zero command line skills, yet versatile and robust enough to carry along someone like me while I gradually learn the necessary commands to tweak and modify from the terminal.

    Easy data backup: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV 5 (current) - Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, Wetty, & Heimdall - NanoPi M4 (v.1): backups using Rsync and Rsnapshot - Odroid XU4 (Using DietPi): PiHole - hc2, xu4, Pi 3B+, Odroid H2, and VirtualBox: Testing and playing - Mac user converting to Linux, Debian 10 KDE.

  • I've tried a couple ways to update portainer and failed. Now I can't bring up portainer at all.


    1. OMV GUI -> System -> OMV-Extras -> Docker tab -> Portainer + install. After running get no errors from message box. But can no longer open portainer ("This site can't be reached. 192.168.50.27 refused to connect").
    2. Used commands from gderf post #31 RE: portainer: how to update to latest version. This generated a new container id and no obvious errors, but same error as (1). The old container id for portainer is definitely gone and there's a new one to take its place. But there's also a container with a docker generated name "romantic_dubinsky"

      CONTAINER ID NAMES
      a4fee41b4ab3e10eceecb82308af77a4a544a68af13517f177b034531607407a portainer 0d00a7baf815846212d394f571203e8e41084e448e44f267c0ac8fa618131460 romantic_dubinsky 1fe05004fb6217348a891ced3fec0c26dff4a1a06549fa27fda5a311191835bd logitechmediaserver 227e360db746180175fa379cfdbcc55426f17ac9be1f7d7021cf8d6b54068ab4 plex 017f65b04305de3aa7bb21644de15cd2584376367eb9580b8e895ae2ad7e993c Kitana 101684eb84344322ca2989985df1b92ea51499e00566a4419607f3e1e74d5175 dashmachine c84a31c43e63d7388a1958047939ee4dea745aa94abf2bcd95a9b9475d6159c6 tautulli root@omv:~/bin#

    The logs (docker logs -f portainer) show a repeated error:


    The good news is all the containers are still running. Bad news is I broke portainer.


    How best to fix this? At this point I'd be content to run the old version rather than update. Although I expect it's too late for that.


    Thanks!

    Mark M.


    EDIT: running OMV 5.6.16-1

  • markmarz a couple of questions:

    1. What machine are you running omv on?
    2. Do you have a proven backup of your operating system?

    Some of my methods are not as technical as they should be. I am more of a trial and error problem fixer, so I don’t want to go telling you to uninstall docker from the GUI and then reinstalling it, and then try to install Portainer again unless I know you have a good working and proved operating system backup. There are also some apt clean commands on the omv-extras GUI page.


    Maybe someone with a little more technical expertise will put their oar in. In the meantime you might look into OS backups.

    Easy data backup: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV 5 (current) - Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, Wetty, & Heimdall - NanoPi M4 (v.1): backups using Rsync and Rsnapshot - Odroid XU4 (Using DietPi): PiHole - hc2, xu4, Pi 3B+, Odroid H2, and VirtualBox: Testing and playing - Mac user converting to Linux, Debian 10 KDE.

  • Most likely that new container name is your portainer instance. Sounds like it it didn't remove the old container (docker rm) and since you can't have containers with the same name, it created a new one (the one with the weird name)


    You can use the button in OMV to uninstall portainer... Then use it to reinstall or just use docker-run/docker-compose as has been discussed in this thread. Also make sure you set a volume for portainer in the docker run if you go that route.

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • Thanks for your response!


    1. If I uninstall portainer from OMV GUI, will it affect the existing containers?
    2. When I reinstall portainer, will it pick up the existing container configurations? Or do I have to add them all back manually?


    I think the answer to (1) is no and (2) is have to add back manually to the newly installed portainer. The thing is, I thought gderf's post removed the old portainer (docker rm portainer). Did it just not work? Anyway, I just did the following, really just redid the sequence suggested by gderf but made double sure the existing portainer was removed.

    1. docker rm romantic_dubinsky
    2. docker stop portainer
    3. docker rm portainer
    4. docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.9.0

    Still 192.168.50.27 refused to connect. But you were right about existing portainer wasn't deleted. This time it was (no new funny named container):


    Code
    root@omv:~/bin# docker ps -a --no-trunc --format "table {{.ID}}\t{{.Names}}"
    CONTAINER ID NAMES
    d13ccc1fd66eb51bc9ac59328731087c1b379c3a49f5ed75a92489f21b6ffb2e portainer
    3a634fec2472cfd9afc3ad795c9678892c40d6b1c92ebd8ebdd58c17e2397e8a dozzle
    1fe05004fb6217348a891ced3fec0c26dff4a1a06549fa27fda5a311191835bd logitechmediaserver
    227e360db746180175fa379cfdbcc55426f17ac9be1f7d7021cf8d6b54068ab4 plex
    017f65b04305de3aa7bb21644de15cd2584376367eb9580b8e895ae2ad7e993c Kitana
    101684eb84344322ca2989985df1b92ea51499e00566a4419607f3e1e74d5175 dashmachine
    c84a31c43e63d7388a1958047939ee4dea745aa94abf2bcd95a9b9475d6159c6 tautulli
    root@omv:~/bin#


    I guess portainer is attempting to restart itself:

    Code
    root@omv:~/bin# docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    d13ccc1fd66e portainer/portainer-ce:2.9.0 "/portainer" 14 minutes ago Restarting (1) 35 seconds ago portainer
    3a634fec2472 amir20/dozzle:latest "/dozzle" About an hour ago Up About an hour 0.0.0.0:8888->8080/tcp, :::8888->8080/tcp dozzle
    1fe05004fb62 apnar/logitech-media-server:latest "/entrypoint.sh" 9 days ago Up 2 hours logitechmediaserver
    227e360db746 linuxserver/plex:latest "/init" 9 days ago Up 2 hours plex
    017f65b04305 pannal/kitana:latest "python kitana.py" 4 months ago Up 2 hours Kitana
    101684eb8434 rmountjoy/dashmachine:latest "gunicorn --bind 0.0…" 15 months ago Up 2 hours dashmachine
    c84a31c43e63 linuxserver/tautulli:latest "/init" 16 months ago Up 2 hours tautulli
    root@omv:~/bin#


    Oh, wait! Duh! I didn't make sure about the volume as you suggested. I'll get back on that, have to split now.

  • Thanks for your response!


    1. If I uninstall portainer from OMV GUI, will it affect the existing containers?
    2. When I reinstall portainer, will it pick up the existing container configurations? Or do I have to add them all back manually?

    1. No.


    2. Yes, it will pick them up so long as you did not delete the portainer data volume.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 16GB ECC RAM.

  • Thanks gderf!


    I ensured portainer wasn't running and deleted it again (stop, rm).


    Then I installed from OMV GUI dropdown with no apparent errors:



    Yet portainer still isn't available. As before, it seems to be attempting to restart:

    Code
    root@omv:~/bin# !493
    docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    d2da60dc2198 portainer/portainer-ce "/portainer" 49 seconds ago Restarting (1) 21 seconds ago portainer


    And same error repeated in log:

    Code
    docker logs -f portainer
    level=info msg="2021/10/04 20:49:01 Migrating database from version 24 to 32."
    level=info msg="2021/10/04 20:49:01 An error occurred during database migration: failed fetching environment docker id: failed getting snapshot info"
    level=info msg="2021/10/04 20:49:01 failed migration: failed fetching environment docker id: failed getting snapshot info"
    level=info msg="2021/10/04 20:49:01 Migrating database from version 24 to 32."
    level=info msg="2021/10/04 20:49:01 An error occurred during database migration: failed fetching environment docker id: failed getting snapshot info"
    level=info msg="2021/10/04 20:49:01 failed migration: failed fetching environment docker id: failed getting snapshot info"


    Any idea how to fix this?


    Thanks,

    Mark M.

  • Okay, I was able to revert back to 1.24.1. I used the instructions on this page:

    https://docs.portainer.io/v/ce-2.9/admin/upgrade/docker

    See section labeled 'Option 3: Upgrading from versions older than 1.24.1'


    Note that the section descriptions appear to be off. The above section description says it's about upgrading to 1.24.2, but the code actually installs 1.24.1.

    Code
    docker stop portainer
    docker rm portainer
    docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:1.24.1


    Now that I've successfully reverted to 1.24.1, I will play around with upgrading to 2.0.0+ using the same website. The way I read it, there will need to be an intermediate upgrade to 1.24.2 before 2.0.0+. I'll post results here.


    Thanks!

    Mark M.

  • I'm assuming you are properly mapping a data volume, rather than just using portainer_data

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • I'm using the same portainer data volume as first installed. Been working fine for years.


    The catch seems to be that you can't (or maybe just "I" can't! Hah-hah!) migrate directly from 1.24.1 to latest portainer. So for now I've reverted back to 1.24.1 and will work my way up to the latest.


  • I'm using the same portainer data volume as first installed. Been working fine for years.


    The catch seems to be that you can't (or maybe just "I" can't! Hah-hah!) migrate directly from 1.24.1 to latest portainer. So for now I've reverted back to 1.24.1 and will work my way up to the latest.


    You don't have a bind mount for it, which means container data is being stored in the container volume somewhere...


    See the difference in mine...


    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • How does it matter?

    Because if you deleted your container, when you reinstall.. there is a good chance that volume isn't going to be there. That is why you map it somewhere outside of your container with a bind mount.

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • You also appear to be installing two separate versions of Portainer. Portainer (that you have installed now).. will deprecate in 1/22. It looks like there will be no upgrades past 1.24 for the version you're running now... you would have to tag it "latest" to get it to upgrade to portainer-ce, which is what the OMV button installs, and what most of have been suggesting in this thread.


    https://hub.docker.com/r/portainer/portainer


    Quote

    This repository is deprecated. Starting from January 2022, the latest tag of this repository will point to Portainer CE 2.X. Please use portainer/portainer-ce instead.

    Docker Pulls

    NOTE, This repo, portainer/portainer is the home of Portainer v1.24.x, and is now deprecated; all new releases for Portainer 2.0 will be published in portainer/portainer-ce

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • Good points, thanks.


    Although I don't completely get what you mean by installing 2 versions of Portainer. I have 1 version: 1.24.1. I intend to upgrade through to the latest version. At that point I figured I'd use the tag 'latest'.


    Whether or not it works with the GUI is not critically important to me. OTOH I'm not wed to cli updates only. And it would be nice to know I can safely use OMV GUI.


    So can you suggest a good way to migrate my current portainer volume to a place outside the container?

  • If you delete your current portainer, you can reinstall and map your data volume in docker run, or with the docker compose I posted earlier


    All your containers will be there when you reinstall portainer... The only thing you will lose is any customizations (mainly, stacks.. they will be there but you will not be able to edit or redeploy them)

    Air Conditioners are a lot like PC's... They work great until you open Windows.


    Edited once, last by KM0201 ().

Participate now!

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