Skip to main content

Troubleshooting

Updating Images/Containers

In order to update an image, you can use a few different methods. If you don't have access to the CLI and wanted to use a GUI, then portainer is your best bet.

Using Portainer

  1. Login to Portainer and select your stack

    portainer step 1
  2. Click on Your container you want to update and go to its details screen

    portainer step 2
  3. Click "Recreate"

    portainer step 3
  4. Ensure that the option to "re-pull image" is toggled on. This will pull the latest image and recreate the container for you.

    portainer step 4

Update Using the CLI

Do the following command to pull the latest image:

docker compose pull

Then spin up your environment again (either with the startup script) or docker compose

./scripts/startup.sh jellyfin

OR (all containers not behind a profile)

docker compose up -d

OR (individual container)

docker compose up <CONTAINER_NAME> -d

OR (with profile flag)

docker compose --profile jellyfin up -d

No Connection to the container?

Usually you can connect internally on your home network, but when you start to try to expose things to the outside world, the containers are not accessible on the host system.

Commonly on Linux systems, there is a firewall installed that blocks things (UFW). It is not safe to disable this, but some do that. ufw disable. But if you would like to keep it enabled, there is a docker extended version for ufw that will read your containers and allow connections to those interfaces exposed for you. This very well may solve your problems and lots of headaches.

  • ufw-docker(Github)
    • Example sudo ufw-docker allow jellyfin - this would look at your running jellyfin containers and allow those ports through your firewall so you can hit it from outside your host network or machine.
    • Then you would do sudo ufw-docker install to commit any new entries to the ufw table
Pro Tip!

I created a little bash script to run as a cron after my system reboots in the event that the docker daemon assigns my containers a new IP Address. This could affect their ability to be allowed through the firewall.

fixUfwDockerPermissions.sh----

#!/bin/bash
echo "Cleaning Up UFW Docker permissons"
ufw-docker allow dashy
ufw-docker allow emby
ufw-docker allow jellyfin
ufw-docker allow plex
ufw-docker allow sonarr
ufw-docker allow radarr
ufw-docker allow komga
ufw-docker allow prowlarr
ufw-docker allow portainer
ufw-docker allow jellyseerr
ufw-docker allow pihole
ufw-docker allow heimdall

echo "Trying to clean up home automation if they exist"
ufw-docker allow homeassistant
ufw-docker allow zwavejs
ufw-docker allow zigbee2mqtt

echo "Applying rules"
ufw-docker install
echo "Exiting gracefully"
exit 0

MacOS has something similar in System Preferences, but if you are a CLI person, then you can view this help article.

Another common problem would be if you are using network_mode: host - this basically removes any exposed custom ports from your docker compose file. Check that you are referring to the default exposed ports or exposing them on another container that is not network_mode: host - you will want the container you are wanting to be network_mode: bridge or just remove that key and bridge is the default.

Transmission Behind a VPN Connection - No External Access

I have yet to get this work with a true external connection via ddns or with my public IP address. Instead, I have had luck setting up my router VPN and using OpenVPN Connect on my smartphone to access Transmission as if I was on my LAN at home, even when I am away. It was super easy to setup with my router, if you have a way to setup an openvpn connection to your server, then go for it. I will try to add a VPN server that is accessible via this docker setup, but for now you are on your own.

Sonarr/Radarr/*Arr Migration from Windows to Unix (docker)

I found this very useful because I migrated my setup from windows to Linux (debian). This is painful because of how Windows does it's \ between its filepaths. Linux uses / so this migration helped a lot. This is quite old but still very helpful.

Migrating Sonarr and Radarr from Windows 10 to unRAID - This proved to be useful in my docker setup which runs on a Ubuntu 22.04 host machine.

Docker Errors and Can't ever completely come up

Docker Compose won't down the containers:

docker down error

Docker Compose won't start the containers for some reason:

docker start error

Currently the only fix I have gotten to work is to completely wipe out the docker installation and start over to solve the above error if a restart, teardown, and startup fresh doesn't work. Read below for more info

Information
  • This may very well be due to the apparmor installed with ubuntu as a security measure. AppArmor is part of snapd baked into Ubuntu. See here for more info around snapd and AppArmor.
  • This can cause containers to fail to start/stop due to the app armor profile not being setup properly. If you are comfortable setting up an app-armor profile, you can do that, or disable it.
  • To disable apparmor, follow these steps:
# Check status:
sudo aa-status

# Shutdown and prevent it from restarting:
sudo aa-disable

# Unload AppArmor profiles:
sudo aa-teardown

# Check status:
sudo aa-status

# You should now be able to stop/kill containers. A restart may be required to complete this step.
  • Next, if that doesn't work then uninstall apparmor Not Recommended, but as a last resort you can do this
sudo apt-get remove apparmor apparmor-utils -y

After you run that command above, you may need to Reinstall Docker anyway. So follow the Uninstall Docker steps below and re-install.

  • If none of this works, then proceed with uninstalling docker and reinstalling it.
  • More information about AppArmor Security can be found here

Completely Uninstall Docker (Linux - Ubuntu)

WARNING
  • This is needed sometimes if the docker network sock or the containers fail to start.
  • This will not modify the data at rest, but it will remove all data related to the docker installation and daemon.
  • This is destructive but only on the host system and only related to docker itself. Not related to your data for your containers.
    • That is stored in ${DEFAULT_CONTAINER_DATA_LOCATION}/** for the most part if you use the default installation.
#!/bin/bash
sudo apt-get purge -y docker-engine docker docker.io docker-ce
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
sudo umount /var/lib/docker/
sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
sudo rm -rf /usr/bin/docker-compose

Reinstall Docker Daemon on the Host Machine (Linux - Ubuntu)

Since this could change, please see the Docker Documentation for the official installation steps to get back up and going. This will walk you through:

  • Adding a new PPA repository for apt to install from
  • Adding docker-ce and other utilities to the CLI in a server

After executing the install above, be sure to look at the Post Installation Steps to execute docker commands as a non-root user without sudo

Docker Quick Commands

  • Delete All Containers (if they are stopped)

    docker rm $(docker ps -a -q)
    • Delete individual container
    docker rm <containerId>
  • Delete all docker images (if they are unused)

    docker rmi $(docker images -q)
  • Delete all Volumes

    docker volume rm $(docker volume ls -q)

    Emby Restore From Backup

    Emby Server restores can be tricky - when you do have to do it, you need to edit the /config/data/library.db file - this file causes the image to not spin up properly as it becomes corrupt in the restoring process. Copy this file over manually after the restore completes.

Stop the emby container first!

# stop emby container
docker compose stop emby

# make a backup of your library.db and copy the new one in from your backups directory
sudo mv ~/path/to/.containers/Emby/data/library.db ~/path/to/.containers/Emby/data/library.db.bak && \
sudo cp /media/Synology/Backups/SomeEmbyBackup04-01-2024/library.db ~/path/to/.containers/Emby/data/