Closed tehniemer closed 3 years ago
I made a change recommended by shellcheck, so maybe that's the cause.
Please remove the slash in the pause_services and resume_services functions and let me know if this helps.
pause_services,
ssh "$DOCKER_USER"@"$DOCKER_IP" docker "$DOCKER_CMD1" "\$i"
new
ssh "$DOCKER_USER"@"$DOCKER_IP" docker "$DOCKER_CMD1" "$i"
resume_services,
ssh "$DOCKER_USER"@"$DOCKER_IP" docker "$DOCKER_CMD2" "\$i"
new
ssh "$DOCKER_USER"@"$DOCKER_IP" docker "$DOCKER_CMD2" "$i"
OK, that fixed the first issue, but brought back the issue I had originally with pausing containers on a remote machine.
Pausing Containers [Thu 22 Apr 2021 12:00:03 AM CDT]
Pausing Container - Amtd
amtd
Pausing Container - Bazarr
Error response from daemon: Cannot pause container 266c43695c30f7192e20bd48fa5691f14fc1ff0e328fcb7c3038ade8c0be6f74: OCI runtime pause failed: unable to freeze: unknown
Pausing Container - Filebot
Error response from daemon: Cannot pause container fd41d0d7ab0799eaf41c2e7ce7ad32178f0b1d88e3f279be135abdc2af5e0e62: OCI runtime pause failed: unable to freeze: unknown
Pausing Container - Filerun
filerun
It seems to pause about half of the list and fail on the other half with no perceivable pattern.
In the meantime you can switch to stop, I implemented this feature thinking about you (lol).
Let me know how it goes with and without the slash.
I need to setup another host with docker and play with this.
This is the recommendation from Shellcheck, which needs the right implementation.
Try with the following, I added '
to wrap the command
ssh "$DOCKER_USER"@"$DOCKER_IP" 'docker "$DOCKER_CMD1" "$i"'
and
ssh "$DOCKER_USER"@"$DOCKER_IP" 'docker "$DOCKER_CMD2" "$i"'
EDIT Probably this does not solve the issue. As far as I understood, by sending the wrapped command, the destination server will evaluate the variable, which should not happen because the information is on the client who is running the script.
So yes, you can try the change but probably the result will be the same to the one in the first post.
I've cloned my VM and tested this scenario: the right command is without the slash. I will make the fix now.
The error you're seeing is specific to your host: the script works fine. So you can use the stop
command option or troubleshoot what's wrong on your docker server, because I can't reproduce the issue and I can pause containers over SSH just fine.
So odd, it was working well for a long time with pause, wonder what's going on with my instance...
You could to ask for help in Docker forums, but also try to manually run the same, at least to validate the case:
docker pause container1
I've found a similar issue here
I gave the most recent script a try last night and came across some new errors in the container control section. It looks like they are pausing, but it's trying a second time without an argument. These are different than the errors I was previously experiencing.