Cannot cleanup the deviceauth database

Hi,
I’m trying to upgrade from mender server 1.7.1 to 2.0.1 using the official 2.0 tutorial on mender website.

I created backups using the ../migration/dump-db script and with docker run -it --rm...... command.
Next, the tutorial says that I should cleanup the deviceauth db running this command:

docker-compose exec mender-device-auth /usr/bin/deviceauth maintenance --decommissioning-cleanup

but if I try to run it on my server (1.7.1 clean installation and up and running perfectly) it returns an error:

ERROR: No container found for mender-device-auth_1

Why? Am I doing something wrong?

thanks

I just had that problem. I couldn’t get the command to work with docker-compose but it did work with just docker but I had to look up the full name of the container with docker ps. I don’t know if the following is absolutely correct but it did work on my system:

docker exec menderproduction_mender-device-auth_1 /usr/bin/deviceauth maintenance --decommissioning-cleanup
1 Like

Yes, it worked, thanks.

To the mender developers: which is the right way to do this? Is this an error in the documentation?

Odd, considering the docker documentation: https://docs.docker.com/compose/reference/exec/, states that docker-compose exec is an alias for docker exec. Are you sure you did not misspell the container name the first time around?

I assume the container name was the problem as well, looking at it you initially tried running,

docker-compose exec mender-device-auth /usr/bin/deviceauth maintenance --decommissioning-cleanup

Which is what is in our docs.

And what worked was,

docker exec menderproduction_mender-device-auth_1 /usr/bin/deviceauth maintenance --decommissioning-cleanup

And I assume that running the following would have also worked,

docker-compose exec menderproduction_mender-device-auth_1 /usr/bin/deviceauth maintenance --decommissioning-cleanup

Unclear to me how stable the naming is, but probably a good idea to update docs with a note at least that you might need to lookup the name

Created PR to update the name in docs.

If i run docker-compose exec menderproduction_mender-device-auth_1 /usr/bin/deviceauth maintenance --decommissioning-cleanup

i get this error:

ERROR: No such service: menderproduction_mender-device-auth_1

How can I list docker-compose services, because if I run ‘docker-compose ps’ it returns an empty result.

the result of ./run ps is:

                 Name                                Command                  State               Ports
----------------------------------------------------------------------------------------------------------------
menderproduction_mender-api-gateway_1     /entrypoint.sh                   Up             0.0.0.0:443->443/tcp
menderproduction_mender-conductor_1       /srv/start_conductor.sh          Up             8080/tcp, 8090/tcp
menderproduction_mender-deployments_1     /entrypoint.sh --config /e ...   Up             8080/tcp
menderproduction_mender-device-auth_1     /usr/bin/deviceauth --conf ...   Up             8080/tcp
menderproduction_mender-elasticsearch_1   /docker-entrypoint.sh elas ...   Up             9200/tcp, 9300/tcp
menderproduction_mender-gui_1             /entrypoint.sh                   Up             80/tcp
menderproduction_mender-inventory_1       /usr/bin/inventory --confi ...   Up             8080/tcp
menderproduction_mender-mongo_1           docker-entrypoint.sh mongod      Up             27017/tcp
menderproduction_mender-redis_1           /redis/entrypoint.sh             Up             6379/tcp
menderproduction_mender-useradm_1         /usr/bin/useradm --config  ...   Up             8080/tcp
menderproduction_minio_1                  /usr/bin/docker-entrypoint ...   Up (healthy)   9000/tcp
menderproduction_storage-proxy_1          /usr/local/openresty/bin/o ...   Up             0.0.0.0:9000->9000/tcp