mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Password Reset via CLI does not work on Embedded MariaDB #4011
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#4011
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dragdom76 on GitHub (Feb 28, 2025).
📑 I have found these related issues/pull requests
Could not find anything related to this topic for 2.0.0-beta.1
🛡️ Security Policy
Description
When trying to run the command npm run reset-password It starts the tool but I am never prompted to provide a new password. Only happens with Embedded MariaDB. SQLite it runs as expected.
👟 Reproduction steps
docker exec -it <container name> bashnpm run reset-password👀 Expected behavior
Prompt to enter a new password and then confirm the password.
😓 Actual Behavior
The log output belows shows the repeated output.
🐻 Uptime-Kuma Version
2.0.0-beta.1
💻 Operating System and Arch
Ubuntu Desktop 24.04
🌐 Browser
Edge
🖥️ Deployment Environment
📝 Relevant log output
@ShadNex commented on GitHub (Mar 21, 2025):
In case anyone runs into the same issue and needs to reset the password, here's how I was able to reset it:
Connect to the Docker container
docker exec -it <container_name>Connect to the database
mariadb -S data/run/mariadb.sockUse the following commands to set the password to password for the admin (should be id=1)
USE kuma;UPDATE user SET password="$2y$10$IWoZl5q9Tvvp1wxROvi4hOul7XP.rfyrvm4xbm7ufVANke1nfvLIu" WHERE id=1;@happy-game commented on GitHub (Apr 20, 2025):
This issue should be caused by the creation of a database instance when
server/server.jsis started, which then occupies the Embedded MariaDB through this instance. Subsequently, whenextra/reset-password.jsis started, the Embedded MariaDB has already been occupied and locked, resulting in the failure.@sharafabacery commented on GitHub (Jan 10, 2026):
How about create an endpoint for reset password if the direct call could not reset password
and if using that method how could protect that endpoint any ideas?
my only idea is using environment variable or saving something like pin in database for that type of reset?
or could know the type of database and if it maria I make iit execute like
mariadb -S data/run/mariadb.sock USE kuma; UPDATE user SET password="$2y$10$IWoZl5q9Tvvp1wxROvi4hOul7XP.rfyrvm4xbm7ufVANke1nfvLIu" WHERE id=1;@chakflying
@chakflying commented on GitHub (Jan 10, 2026):
Yeah I think the password reset tool having the understanding that it needs to connect to the existing database instead of starting a new one should be a good solution, just need to be careful to minimize code duplication.
@CommanderStorm commented on GitHub (Jan 10, 2026):
The problem there is how do we authorize ourselves against this. Since we don't know the current password, this might be a bit hard without security issues
@sharafabacery commented on GitHub (Jan 10, 2026):
@CommanderStorm I understand the problem off endpoint for that I think of it alot could try using this approach
mariadb -S data/run/mariadb.sockAnd if will get you feedback how it's going?
@CommanderStorm commented on GitHub (Jan 10, 2026):
Using the cli does not solve this problem because the problem is that we also need to support external Mariadb and sqlite. As @chakflying hinted at, this work will need to refactor how we do the database connection logicfrom the json file into a reusable chunk.
@ljasinskipl commented on GitHub (Feb 7, 2026):
Noob question here: how do you get your password string?
@sharafabacery commented on GitHub (Feb 8, 2026):
@ljasinskipl I think you could run password-hash.js it contans all functions of password , it based on bcryptjs and saltrounds =10