Fixing Unraid Docker Containers After Upgrading - The Missing Label Problem
So I just upgraded my Unraid server from a very old 6.9 installation to 7.0.1, and immediately ran into a fun little problem: all my Docker containers were suddenly marked as "3rd party." Couldn't edit them, couldn't check for updates, couldn't do anything except stare at them in frustration.
The Problem
There's a similar thread documented here in the Unraid Forums which I found helpful.
Turns out, Dockerman in Unraid 7.0+ (Unraid's Docker management plugin) uses a container label net.unraid.docker.managed=dockerman to determine which containers it actually manages. My containers were created way back on an older version of Unraid, so they didn't have this label. Without it, Dockerman basically said "not my problem" and refused to touch them.
The nuclear option would be to recreate every single container from scratch, but that's tedious and error-prone when you have dozens of containers with specific configurations. I know I could reuse an existing template as well.. but it still felt like a tedious task. So I did what I normally do and implemented an overly engineered solution to a problem that I could fixed pretty quickly doing it manually.
The Solution
The good news is you can add the missing label using Docker's CLI without manually reconfiguring everything.
I started by testing this on one container first - Jackett, which is one of my torrent index containers. I wanted to make sure the whole process worked before batch-processing everything.
First, I generated the docker run command using runlike (it inspects a running container and outputs the equivalent docker run command):
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
assaflavie/runlike Jackett > /tmp/jackett_run.sh
(Note: you'll need root privileges to run docker commands in the Unraid terminal - otherwise you'll get "permission denied" errors.)
Then I reviewed what runlike generated:
cat /tmp/jackett_run.sh
This showed me the full docker run command with all the volumes, ports, environment variables - exact configuration for my Jackett container.
Next, I needed to add the missing label. I opened the file with nano:
nano /tmp/jackett_run.sh
And added --label net.unraid.docker.managed=dockerman and --detach=true right after docker run:
docker run --label net.unraid.docker.managed=dockerman --detach=true --name=Jackett ...
Then I stopped the old container, removed it, and recreated it with the new configuration:
docker stop Jackett
docker rm Jackett
bash /tmp/jackett_run.sh
Finally, I needed to make Unraid fully recognize the container. In the Docker tab, I clicked on Jackett to open its dropdown menu and selected "Force Update." This tells Unraid to add its other management labels.
After doing this, Jackett showed up properly in Unraid instead of as "3rd party." Success!
The Automated Script
Once I verified the manual process worked, I created a script to batch-process all my containers. The script loops through all running containers, generates the run command, injects the label, recreates the container, and queues a Force Update:
https://gist.github.com/ManningWorks/0f57db9c450d7b7dea741e585b31d23e
To use this, I added it to Unraid's User Scripts plugin (you can install it from Community Applications). This lets you run one-off scripts safely instead of running them directly in the Bash Shell.
If you're comfortable with scripts, this will process all your containers at once. Otherwise, the manual steps above work fine for one-off fixes.
Important Notes
- Your data is safe - This process only removes and recreates the container definitions, not your actual data in appdata or volumes
- Test on one container first - Make sure the manual steps work for your setup before running the bash script
- The Force Update step matters - Don't skip it, as it adds the additional Unraid management labels
- Back up your flash drive - Before any major changes, it's always good practice to back up your Unraid configuration
Why This Happens
Unraid made this change to better track which containers it's managing versus containers you might have created manually or through other tools. It's actually a good change for container management, but it does mean old containers need this label added retroactively.
Hopefully this saves someone else the frustration of staring at dozens of "3rd party" containers after an upgrade! If this saved you an hour, the Gist is there to share.