Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubring.db.lock after unclean shutdown breaks gpg related actions #30781

Open
Janhouse opened this issue Apr 30, 2024 · 3 comments
Open

pubring.db.lock after unclean shutdown breaks gpg related actions #30781

Janhouse opened this issue Apr 30, 2024 · 3 comments
Labels

Comments

@Janhouse
Copy link

Janhouse commented Apr 30, 2024

Description

Commits page loads for a very, very long time if unclean shutdown has happened before.

Reason:

Since gpg creates lock file in /var/lib/gitea/home/.gnupg/public-keys.d/ , which is on a persistent volume, unclean shutdown leaves pubring.db.lock, and after following startup gpg operations fail because of the locked database.

Proposed fix:

I would suggest checking for the gpg database lock file during container startup, and remove it if it exists.

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No, requires ability to crash the container

How are you running Gitea?

Docker compose with /var/lib/gitea persisted in volume

@JDI-Developers
Copy link

Can confirm.

Downgrading to previous version (for us that was 1.21.5) didn't resolve issue.
Removing lockfiles manually resolved the issue.

@xyhhx
Copy link

xyhhx commented May 17, 2024

fwiw i experienced this on forgejo too. a workaround that worked for me was to specify a different $GNUPGHOME, i.e.:

services:
  gitea:
    image: gitea/gitea:latest
    environment:
      GNUPGHOME: /.gnupg
# ...
    volumes:
      - ./data/gitea/gnupg:/.gnupg

@lunny
Copy link
Member

lunny commented May 21, 2024

Maybe we can have a check to delete these lock files when Gitea startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants