Skip to content

Random "database is locked" errors in metadata processor #8243

@cenodis

Description

@cenodis

Running gallery-dl with a metadata processor against a large set of accounts in quick succession (such as with -i) will sometimes cause the postprocessor to fail when trying to open its archive database. It always occurs at the start of a new account and causes the process to block for multiple seconds.

Example error:

[postprocessor.metadata][warning] Failed to open metadata archive at '<REDACTED>/meta-archive/{instance}.sqlite3' (OperationalError: database is locked)

Config excerpt:

"postprocessors": [
{
    "name": "metadata",
    "event": "post",
    "mode": "json",
    "filename": "{id}.json",
    "skip": false,
    "archive": "<REDACTED>/meta-archive/{instance}.sqlite3",
    "archive-pragma": ["locking_mode=EXCLUSIVE", "journal_mode=WAL", "synchronous=NORMAL"],
    "archive-prefix": "{instance}",
    "archive-format": "{id}",
    ...
},
...
}]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions