docker-mbsync icon indicating copy to clipboard operation
docker-mbsync copied to clipboard

Container fails to restart until it is recreated

Open compeek opened this issue 3 years ago • 1 comments

I use Docker Compose to run this mbsync container automatically.

However, after one of the recent updates, I noticed that the container errors out and won't start after I restart my computer. I think it probably happens anytime you stop the container and try to start it again actually.

The only fix is to delete the container and recreate it (docker-compose up -d --force-recreate).

It looks like the problem is that it's trying to add a user group that it already created the first time it ran. I'm guessing it would have the same problem with the user as well if it got that far.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00_bootstrap.sh: executing...
[cont-init.d] 00_bootstrap.sh: exited 0.
[cont-init.d] 00_settimezone.sh: executing...
[cont-init.d] 00_settimezone.sh: exited 0.
[cont-init.d] 10-adduser.sh: executing...
addgroup: group 'abc' in use
[cont-init.d] 10-adduser.sh: exited 1.

I noticed you recently changed the commands used to create the group and user in [10-adduser.sh](https://github.com/JakeWharton/docker-mbsync/blob/trunk/root/etc/cont-init.d/10-adduser.sh), so I suspect the old commands were more tolerant of the group/user already existing and the new ones aren't.

compeek avatar May 11 '22 15:05 compeek

@JakeWharton Don't mean to bug you, but any chance you could take a look at this? It's making the container difficult to use because I have to forcefully recreate it every time I restart my computer. I believe it should be a simple fix since I think I identified the problem above, and it just needs a check not to recreate the same user.

Thank you for creating this Docker image, by the way. It's been a huge help for me with backing up my email.

compeek avatar Jul 07 '22 19:07 compeek

Sorry this container is more of a self-service setup. I don't really have time to maintain anything here but my own personal usage. I will very happily accept contributions, though!

JakeWharton avatar Feb 21 '23 02:02 JakeWharton

No problem. I fixed this a while ago in a fork, so I'll submit a PR!

compeek avatar Feb 21 '23 05:02 compeek