Docker Community Forums

Share and learn in the Docker community.

Unable to initialize upgrader: unable to determine blue/green worker agent services: both -x and -y worker node agent services exist. Is an upgrade already in progress?

I am trying to upgrade from UCP 3.3.1 to 3.3.3, but am getting this error? I have waited overnight in case there was something going on in the background, but am still getting the same error. Is there something I can do to fix this?

RHEL 7.8

[~]# docker container run --rm -it \
>        --name ucp \
>        -v /var/run/docker.sock:/var/run/docker.sock \
>        mirantis/ucp \
>        upgrade --id 1dmhdsdul6mh0tgn8sljlm0fu

INFO[0000] Your Docker daemon version 19.03.12, build f295753 (3.10.0-1127.18.2.el7.x86_64) is compatible with UCP 3.3.3 (9d7bddd)
INFO[0000] About to upgrade the UCP 3.3.1 installation on this cluster to version 3.3.3
INFO[0000] Once this operation completes, all nodes in this cluster will be upgraded.
INFO[0000] Checking required container images
INFO[0000] Running upgrader agent container …
INFO[0000] Loading UCP configuration
FATA[0000] unable to initialize upgrader: unable to determine blue/green worker agent services: both -x and -y worker node agent services exist. Is an upgrade already in progress?
FATA[0001] container ucp-upgrader exited with 1

Since you are running Docker Enterprise, I would suggest to raise a support ticket @Mirantis (the current owner of DockerEE).

I highly doubt that Mirantis is monitoring this forum.

You should remove old ucp-agent services in order to proceed with upgrade.

You probably solved this issue some time ago, but just in case I thought I’d post. I ran into this issue when upgrading to 3.3.7 today. Check for orphaned ucp-agent and ucp-agent-win services:

-bash-4.2$ sudo docker service ls | grep ucp-agent
xwb4eu3ad7z4 ucp-agent global 0/0 docker/ucp-agent:3.1.11
v8addvq2u933 ucp-agent-win global 0/0 docker/ucp-agent-win:3.1.11

We were on version 3.2.7 so these appear to be left over from a previous upgrade. Since they had 0 containers, there seemed very little risk in removing them:

sudo docker service rm xwb4eu3ad7z4
sudo docker service rm v8addvq2u933

I subsequently heard back from Mirantis support that this is definitely the correct cause and solution. I’ve asked them to update the UCP (MKE) upgrade instructions troubleshooting section with this information, but they probably won’t. Hopefully this will help the next person who lands in this thread from Google.