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

[BUG] `TimeOutError: Could not acquire the lock` since version 0.5.2

Open MrEbbinghaus opened this issue 1 year ago • 4 comments

Tag/version of Container Images: 0.5.2

After updating the image to 0.5.2 the mailman-core container crashes with the following log and error on startup

Found configuration file at /opt/mailman/mailman-extra.cfg
HYPERKITTY_API_KEY found, setting up HyperKitty archiver...
Directory /opt/mailman/var already exists.
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/mailman/bin/master.py", line 150, in acquire_lock_1
    lock.lock(timedelta(seconds=0.1))
File "/usr/lib/python3.12/site-packages/flufl/lock/_lockfile.py", line 380, in lock
    raise TimeOutError('Could not acquire the lock')
flufl.lock._lockfile.TimeOutError: Could not acquire the lock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/flufl/lock/_lockfile.py", line 231, in details
    lockfile, hostname, pid, random_ignored = filename.split(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 1)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/bin/master", line 8, in <module>
    sys.exit(main())
             ^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/mailman/bin/master.py", line 653, in main
    lock = acquire_lock(force)
           ^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/mailman/bin/master.py", line 176, in acquire_lock
    lock = acquire_lock_1(force)
           ^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/mailman/bin/master.py", line 156, in acquire_lock_1
    hostname, pid, tempfile = lock.details
                              ^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/flufl/lock/_lockfile.py", line 235, in details
    raise NotLockedError('Details are unavailable') from error
flufl.lock._lockfile.NotLockedError: Details are unavailable

Haven't quite figures out what is happening, but maybe this is related to https://github.com/maxking/docker-mailman/pull/718 and https://github.com/maxking/docker-mailman/issues/86.

MrEbbinghaus avatar Oct 20 '24 12:10 MrEbbinghaus

And I can't easily roll back to 0.5.1 because of a migration that gets applied between the two versions.

MrEbbinghaus avatar Oct 20 '24 12:10 MrEbbinghaus

The /opt/mailman/var directory is owned by _apt after start up. 🤔

MrEbbinghaus avatar Oct 20 '24 12:10 MrEbbinghaus

I think I agree that it is caused by #718 but I am not sure I fully understand why is that. 🤔

Can you get an older copy of the entrypoint script from 0.5.1 tag in the repo and mount it over the existing one as a workaround?

maxking avatar Oct 20 '24 13:10 maxking

@maxking I tried, with no success.

But just deleting the lock from var/locks did the trick. This should maybe be part of the entrypoint script.

MrEbbinghaus avatar Oct 20 '24 21:10 MrEbbinghaus

This issue has not been updated for more than 1year

github-actions[bot] avatar Oct 20 '25 22:10 github-actions[bot]