# Cannot cleanup the deviceauth database

**URL:** https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877
**Category:** General Discussions
**Tags:** mender-server
**Created:** [July 31, 2019, 3:11pm UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877 "2019-07-31T15:11:39Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ks89](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ks89/32/86_2.png) [@Ks89](https://hub.mender.io/u/Ks89)
#### Post date: [July 31, 2019, 3:11pm UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/1 "2019-07-31T15:11:39Z")

</div>

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:

```auto
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:

```auto
ERROR: No container found for mender-device-auth_1

```

Why? Am I doing something wrong?

thanks

---

<div class="post-metadata">

### Author: ![ckelloug2](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@ckelloug2](https://hub.mender.io/u/ckelloug2)
#### Post date: [July 31, 2019, 6:15pm UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/2 "2019-07-31T18:15:03Z")

</div>

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:

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

---

<div class="post-metadata">

### Author: ![Ks89](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ks89/32/86_2.png) [@Ks89](https://hub.mender.io/u/Ks89)
#### Post date: [August 1, 2019, 7:03am UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/3 "2019-08-01T07:03:27Z")

</div>

Yes, it worked, thanks.

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

---

<div class="post-metadata">

### Author: ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)
#### Post date: [August 1, 2019, 7:10am UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/4 "2019-08-01T07:10:27Z")

</div>

Odd, considering the docker documentation: [https://docs.docker.com/compose/reference/exec/](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?

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [August 1, 2019, 7:14am UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/5 "2019-08-01T07:14:32Z")

</div>

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

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

```

Which is what is in our docs.

And what worked was,

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

```

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

```auto
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

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [August 1, 2019, 7:24am UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/6 "2019-08-01T07:24:37Z")

</div>

Created [PR](https://github.com/mendersoftware/mender-docs/pull/731) to update the name in docs.

---

<div class="post-metadata">

### Author: ![Ks89](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ks89/32/86_2.png) [@Ks89](https://hub.mender.io/u/Ks89)
#### Post date: [August 1, 2019, 8:29am UTC](https://hub.mender.io/t/cannot-cleanup-the-deviceauth-database/877/7 "2019-08-01T08:29:22Z")

</div>

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

i get this error:

```auto
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:

```auto
                 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

```
