[GH-ISSUE #1258] unable to login / reset the password. #688

Closed
opened 2026-02-26 12:09:09 +03:00 by kerem · 4 comments
Owner

Originally created by @sbarex on GitHub (Jul 23, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1258

Describe the bug
I install nginx-ui on macos with homebrew.
After install and created a local user, I cannot login (password incorrect).
I cannot reset the password.

To Reproduce
on terminal:

nginx-ui reset-password --config=/opt/homebrew/etc/nginx-ui/app.ini

2025-07-23 15:38:05 INFO user/reset_password.go:52 confPath: /opt/homebrew/etc/nginx-ui/app.ini
2025-07-23 15:38:05 INFO user/reset_password.go:59 dbPath: /opt/homebrew/etc/nginx-ui/database.db

2025/07/23 15:38:05 github.com/0xJacky/Nginx-UI/internal/user/reset_password.go:70 illegal base64 data at input byte 0
[0.108ms] [rows:1] SELECT * FROM users WHERE id=1 AND users.deleted_at IS NULL LIMIT 1
2025/07/23 15:38:05 init user not exists

Info (please complete the following information):

  • Server OS: macOS 15.5
  • Server Arch: aach64
  • Nginx UI Version: 2.1.14 2(455)
  • Your Browser: Safari, Firefox
Originally created by @sbarex on GitHub (Jul 23, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1258 **Describe the bug** I install nginx-ui on macos with homebrew. After install and created a local user, I cannot login (password incorrect). I cannot reset the password. **To Reproduce** on terminal: ```sh nginx-ui reset-password --config=/opt/homebrew/etc/nginx-ui/app.ini ``` > 2025-07-23 15:38:05 INFO user/reset_password.go:52 confPath: /opt/homebrew/etc/nginx-ui/app.ini > 2025-07-23 15:38:05 INFO user/reset_password.go:59 dbPath: /opt/homebrew/etc/nginx-ui/database.db > > 2025/07/23 15:38:05 github.com/0xJacky/Nginx-UI/internal/user/reset_password.go:70 illegal base64 data at input byte 0 > [0.108ms] [rows:1] SELECT * FROM `users` WHERE id=1 AND `users`.`deleted_at` IS NULL LIMIT 1 > 2025/07/23 15:38:05 init user not exists **Info (please complete the following information):** - Server OS: macOS 15.5 - Server Arch: aach64 - Nginx UI Version: 2.1.14 2(455) - Your Browser: Safari, Firefox
kerem 2026-02-26 12:09:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Jul 25, 2025):

Sorry, I cannot reproduce this issue. Can you try to reinstall nginx-ui or remove /opt/homebrew/etc/nginx-ui/app.ini and /opt/homebrew/etc/nginx-ui/database.db, then restart the service and try again?

<!-- gh-comment-id:3116287534 --> @0xJacky commented on GitHub (Jul 25, 2025): Sorry, I cannot reproduce this issue. Can you try to reinstall nginx-ui or remove /opt/homebrew/etc/nginx-ui/app.ini and /opt/homebrew/etc/nginx-ui/database.db, then restart the service and try again?
Author
Owner

@0xJacky commented on GitHub (Jul 25, 2025):

I understand. After installing via brew, you should access localhost:9000/#/install in your browser for the installation process, rather than using the password reset function directly.

<!-- gh-comment-id:3116711958 --> @0xJacky commented on GitHub (Jul 25, 2025): I understand. After installing via brew, you should access localhost:9000/#/install in your browser for the installation process, rather than using the password reset function directly.
Author
Owner

@sbarex commented on GitHub (Jul 28, 2025):

I understand. After installing via brew, you should access localhost:9000/#/install in your browser for the installation process, rather than using the password reset function directly.

I actually did the setup on first boot, but then authentication fails and I can't reset the password or start the setup again.

I deleted the app.ini file and the database.db, and reset the setup with the username and password. But then when I try to log in, it doesn't work: "password incorrect."

<!-- gh-comment-id:3126058853 --> @sbarex commented on GitHub (Jul 28, 2025): > I understand. After installing via brew, you should access localhost:9000/#/install in your browser for the installation process, rather than using the password reset function directly. I actually did the setup on first boot, but then authentication fails and I can't reset the password or start the setup again. I deleted the `app.ini` file and the `database.db`, and reset the setup with the username and password. But then when I try to log in, it doesn't work: "password incorrect."
Author
Owner

@zhangxh-math commented on GitHub (Sep 5, 2025):

I think I'm encountering almost the same issue, and I hope my solution can help you. My device is a Mac mini M4. After installing nginx-ui via Homebrew, I started nginx-ui using brew services and ran into the same problems and error messages as you. However, if I run the following command directly in the terminal:

/opt/homebrew/opt/nginx-ui/bin/nginx-ui serve --config /opt/homebrew/etc/nginx-ui/app.ini

there are no issues at all.

After searching for answers on GitHub issues without success, I sent the error logs to DeepSeek. DeepSeek explained that this happens because when nginx-ui runs via brew services, the environment variables are different from those in the user's terminal. As a result, it fails to recognize the correct path to nginx, leading to errors such as "exec: no command", "pid path not found in nginx -V output", etc.

To resolve this, it's only necessary to add environment variables to the plist file. Specifically, add the following to ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist

<key>EnvironmentVariables</key>
<dict>
    <key>PATH</key>
    <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string>
</dict>

Then execute:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist                                                                                                    
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist

That should fix it. I don't come from a programming background, so my expression might not be entirely accurate - please forgive any imprecision. At the same time, I genuinely enjoy using nginx-ui and sincerely hope the developer can help incorporate this configuration.


我认为我遇到了几乎一样的问题, 我希望我自己的解决办法能够帮到你. 我使用的设备是 mac mini m4, 通过 Homebrew 安装 nginx-ui 后, 使用 brew service 启动 nginx-ui, 遇到了与你一样的问题与报错, 但是如果我直接在终端运行

 /opt/homebrew/opt/nginx-ui/bin/nginx-ui serve --config /opt/homebrew/etc/nginx-ui/app.ini

并不会出现任何问题. 我在 github issue 寻找答案无果后, 就把报错的日志发送给 deepseek, deepseek 告诉我这是因为 nginx-ui 通过 brew services 运行时, 环境变量与用户终端中的不同, 所以运行时没有识别到 nginx 的准确路径, 导致出现 "exec: no command"、"pid path not found in nginx -V output" 等错误. 为了解决这个问题, 只需要往 plist 中添加环境变量即可. 即在 ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist 中加入

<key>EnvironmentVariables</key>
<dict>
    <key>PATH</key>
    <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string>
</dict>

再执行

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist                                                                                                    
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist

即可. 我个人并不是编程出身, 表达有可能不太准确, 请见谅, 同时我也很喜欢 nginx-ui, 并真心希望作者帮忙加上这一段设置.

Describe the bug I install nginx-ui on macos with homebrew. After install and created a local user, I cannot login (password incorrect). I cannot reset the password.

To Reproduce on terminal:

nginx-ui reset-password --config=/opt/homebrew/etc/nginx-ui/app.ini

2025-07-23 15:38:05 INFO user/reset_password.go:52 confPath: /opt/homebrew/etc/nginx-ui/app.ini
2025-07-23 15:38:05 INFO user/reset_password.go:59 dbPath: /opt/homebrew/etc/nginx-ui/database.db
2025/07/23 15:38:05 github.com/0xJacky/Nginx-UI/internal/user/reset_password.go:70 illegal base64 data at input byte 0
[0.108ms] [rows:1] SELECT * FROM users WHERE id=1 AND users.deleted_at IS NULL LIMIT 1
2025/07/23 15:38:05 init user not exists

Info (please complete the following information):

  • Server OS: macOS 15.5
  • Server Arch: aach64
  • Nginx UI Version: 2.1.14 2(455)
  • Your Browser: Safari, Firefox
<!-- gh-comment-id:3256608843 --> @zhangxh-math commented on GitHub (Sep 5, 2025): I think I'm encountering almost the same issue, and I hope my solution can help you. My device is a Mac mini M4. After installing nginx-ui via Homebrew, I started nginx-ui using brew services and ran into the same problems and error messages as you. However, if I run the following command directly in the terminal: ``` /opt/homebrew/opt/nginx-ui/bin/nginx-ui serve --config /opt/homebrew/etc/nginx-ui/app.ini ``` there are no issues at all. After searching for answers on GitHub issues without success, I sent the error logs to DeepSeek. DeepSeek explained that this happens because when nginx-ui runs via brew services, the environment variables are different from those in the user's terminal. As a result, it fails to recognize the correct path to nginx, leading to errors such as "exec: no command", "pid path not found in nginx -V output", etc. To resolve this, it's only necessary to add environment variables to the plist file. Specifically, add the following to `~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist` ``` <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string> </dict> ``` Then execute: ``` launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist ``` That should fix it. I don't come from a programming background, so my expression might not be entirely accurate - please forgive any imprecision. At the same time, I genuinely enjoy using nginx-ui and sincerely hope the developer can help incorporate this configuration. ---------- 我认为我遇到了几乎一样的问题, 我希望我自己的解决办法能够帮到你. 我使用的设备是 mac mini m4, 通过 Homebrew 安装 nginx-ui 后, 使用 brew service 启动 nginx-ui, 遇到了与你一样的问题与报错, 但是如果我直接在终端运行 ``` /opt/homebrew/opt/nginx-ui/bin/nginx-ui serve --config /opt/homebrew/etc/nginx-ui/app.ini ``` 并不会出现任何问题. 我在 github issue 寻找答案无果后, 就把报错的日志发送给 deepseek, deepseek 告诉我这是因为 nginx-ui 通过 `brew services` 运行时, 环境变量与用户终端中的不同, 所以运行时没有识别到 nginx 的准确路径, 导致出现 "exec: no command"、"pid path not found in nginx -V output" 等错误. 为了解决这个问题, 只需要往 plist 中添加环境变量即可. 即在 `~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist` 中加入 ``` <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string> </dict> ``` 再执行 ``` launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-ui.plist ``` 即可. 我个人并不是编程出身, 表达有可能不太准确, 请见谅, 同时我也很喜欢 nginx-ui, 并真心希望作者帮忙加上这一段设置. > **Describe the bug** I install nginx-ui on macos with homebrew. After install and created a local user, I cannot login (password incorrect). I cannot reset the password. > > **To Reproduce** on terminal: > > nginx-ui reset-password --config=/opt/homebrew/etc/nginx-ui/app.ini > > 2025-07-23 15:38:05 INFO user/reset_password.go:52 confPath: /opt/homebrew/etc/nginx-ui/app.ini > > 2025-07-23 15:38:05 INFO user/reset_password.go:59 dbPath: /opt/homebrew/etc/nginx-ui/database.db > > 2025/07/23 15:38:05 github.com/0xJacky/Nginx-UI/internal/user/reset_password.go:70 illegal base64 data at input byte 0 > > [0.108ms] [rows:1] SELECT * FROM `users` WHERE id=1 AND `users`.`deleted_at` IS NULL LIMIT 1 > > 2025/07/23 15:38:05 init user not exists > > **Info (please complete the following information):** > > * Server OS: macOS 15.5 > * Server Arch: aach64 > * Nginx UI Version: 2.1.14 2(455) > * Your Browser: Safari, Firefox
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#688
No description provided.