Error response from daemon conflict in docker portainer

I just did an update by these commands as user:
docker-compose pull
docker-compose up --detach

And now I cannot connect to my HA webpage. Always could before. I’m a newb so could be missing something obvious.
Possibly unrelated, since I’ve seen this error all along, but I’ve been getting this error (hasn’t been a problem) that I would like to resolve - one less issue. The error:

odroid@server:/opt$ docker-compose up --detach
[+] Running 0/0
⠋ Container portainer Creating 0.0s
Error response from daemon: Conflict. The container name “/portainer” is already in use by container “13eb8ce63465f3f7c42625acaabd215c73f04b75147fbebc53ddca”. You have to remove (or rename) that container to be able to reuse that name.

Any help?

docker-compose.yaml:

version: ‘3.0’

services:
portainer:
container_name: portainer
image: portainer/portainer-ce
restart: always
ports:
- “9000:9443/tcp”
environment:
- TZ=America/Anchorage
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/portainer:/data
homeassistant:
container_name: homeassistant
image: “Package home-assistant · GitHub
volumes:
- /opt/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host

zwavejs2mqtt:
container_name: zwavejs2mqtt
image: zwavejs/zwavejs2mqtt:latest
restart: always
tty: true
stop_signal: SIGINT
environment:
- SESSION_SECRET=1zbcxlnad
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
# Uncomment if you want log times and dates to match your timezone instead of UTC
# Available at List of tz database time zones - Wikipedia
#- TZ=America/New_York
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
- ‘/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/zwave’
volumes:
- /opt/z-wave-js/:/usr/src/app/store
ports:
- “8091:8091” # port for web interface
- “3000:3000” # port for Z-Wave JS websocket server
duplicati:
image: lscr.io/linuxserver/duplicati:latest
container_name: duplicati
environment:
- PUID=1000
- PGID=1000
- TZ=America/Anchorage
- CLI_ARGS= #optional
volumes:
- /opt/duplicati/config:/config
- /opt:/source
ports:
- 8200:8200
restart: unless-stopped

Ok - I managed to start HA and portainer by running docker start. Still wondering about that error though. I don’t understand what to rename.

You likely have 2 portainer containers.
docker ps -a will tell

1 Like

Thanks for the reply.

docker ps -a shows one portainer. I have portainer integrated into HA so I can view it in the web page for HA. When I go there (localhost:8123), portainer shows containers among other stuff and has one for portainer that is not selectable. All other containers are selectable. So, don’t know.

I just found another command:

docker images

which produced this:

~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer-ce latest 2b50f5a6047e 4 days ago 293MB
lscr.io/linuxserver/duplicati latest cbc5e8586ac1 7 days ago 832MB
Package home-assistant · GitHub stable 5c9a3e184c4c 8 days ago 1.67GB
zwavejs/zwavejs2mqtt latest 64b7e4e0b789 8 days ago 290MB
zwavejs/zwavejs2mqtt 20e925799dff 6 weeks ago 290MB
lscr.io/linuxserver/duplicati c4093db8ee80 4 months ago 831MB
Package home-assistant · GitHub 4fefc81bc14c 4 months ago 1.54GB
zwavejs/zwavejs2mqtt e2491e371163 4 months ago 275MB
lscr.io/linuxserver/duplicati a114f62a3bbc 4 months ago 820MB
portainer/portainer-ce cb1d1f1436da 4 months ago 284MB
lscr.io/linuxserver/duplicati 0e5e7a8b4c3c 4 months ago 820MB
Package home-assistant · GitHub 1877dba81e07 5 months ago 1.53GB
rhasspy/wyoming-whisper latest 268d18c2516f 6 months ago 420MB
rhasspy/wyoming-piper latest 9ec41d77a0ce 6 months ago 172MB
rhasspy/wyoming-openwakeword latest dbcb19db61fa 6 months ago 295MB
portainer/portainer-ce f12f1fd2694d 9 months ago 284MB

Which shows a couple of several images. Don’t know how that happened. I deleted the last portainer-ce with no ill effect. Seems I should be deleting some of the other images as well… only need one of each? The most recently updated may be the ones to keep… I don’t know.

And docker image prune fixed me up pretty good. Still had 2 portainers… but in the portainer interface “images” it labeled the image that was unused. Removed that and now all seems good.