Skip to content

fix(database): add UPTIME_KUMA_SQLITE_SINGLE_CONNECTION#7312

Open
louislam wants to merge 2 commits intomasterfrom
dev-sqlite
Open

fix(database): add UPTIME_KUMA_SQLITE_SINGLE_CONNECTION#7312
louislam wants to merge 2 commits intomasterfrom
dev-sqlite

Conversation

@louislam
Copy link
Copy Markdown
Owner

Summary

Please follow this checklist to avoid unnecessary back and forth (click to expand)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

Screenshots for Visual Changes

  • UI Modifications: Highlight any changes made to the user interface.
  • Before & After: Include screenshots or comparisons (if applicable).
Event Before After
UP Before After
DOWN Before After
Certificate-expiry Before After
Testing Before After

Copilot AI review requested due to automatic review settings April 24, 2026 16:11
@louislam louislam added this to the 2.3.0 milestone Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in environment variable to force SQLite to use a single Knex pool connection, intended to mitigate SQLITE_BUSY: database is locked issues reported on some Raspberry Pi/SD-card setups.

Changes:

  • Introduces UPTIME_KUMA_SQLITE_SINGLE_CONNECTION to switch SQLite pool config from { min: 0, max: 20 } to { min: 1, max: 1 }.
  • Refactors SQLite pool configuration to use a shared poolConfig object and spread it into the Knex pool config.

Comment thread server/database.js Outdated
Comment thread server/database.js
Comment thread server/database.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan.. grumpf

@louislam
Copy link
Copy Markdown
Owner Author

Indeed, but I think it is the only solution for Pi users for now. I wish we could find an universal solution with this env var.

@CommanderStorm
Copy link
Copy Markdown
Collaborator

I don't think that supporting EMMC is reasonable tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLITE_BUSY: database is locked errors

3 participants