[GH-ISSUE #131] invalid memory address or nil pointer dereference #3171

Closed
opened 2026-02-28 11:54:51 +03:00 by kerem · 5 comments
Owner

Originally created by @skrilax91 on GitHub (Jun 2, 2023).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/131

Describe the bug
after a fresh install on IONOS ubuntu 22.04 os i get this error on log when i go to the ui :
ERROR router/middleware.go:29 runtime error: invalid memory address or nil pointer dereference
from what i could see this unhandled error happens because something else returns an error, so i know that solving this error will not solve my problem, but it prevents me from having the right message allowing me to understand the real mistake

To Reproduce

  1. Install nginx-ui with quick script
  2. make the recover() function in the middleware file return an error

Expected behavior
A clear and concise description of the error

Screenshots
image

Info (please complete the following information):

  • Server OS: Ubuntu 22.04
  • Server Arch: amd64
  • Nginx UI Version: 1.9.9-4
  • Your Browser: Firefox
Originally created by @skrilax91 on GitHub (Jun 2, 2023). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/131 **Describe the bug** after a fresh install on IONOS ubuntu 22.04 os i get this error on log when i go to the ui : `ERROR router/middleware.go:29 runtime error: invalid memory address or nil pointer dereference` from what i could see this unhandled error happens because something else returns an error, so i know that solving this error will not solve my problem, but it prevents me from having the right message allowing me to understand the real mistake **To Reproduce** 1. Install nginx-ui with quick script 2. make the recover() function in the middleware file return an error **Expected behavior** A clear and concise description of the error **Screenshots** ![image](https://github.com/0xJacky/nginx-ui/assets/6585219/422ac433-1c9c-494c-9422-d5bf4a6c46cb) **Info (please complete the following information):** - Server OS: Ubuntu 22.04 - Server Arch: amd64 - Nginx UI Version: 1.9.9-4 - Your Browser: Firefox
kerem 2026-02-28 11:54:51 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Jun 2, 2023):

Hi, this issue was resolved in v2.0.0 beta. I can explain why it was throwing a runtime error. It was caused by the auto-cert goroutine, which was trying to access the db pointer. However this pointer could be nil until you visit <your_domain>/install to install nginx-ui. Thus, the recovery function will print this error in the console.

In v2.0.0, I have enhanced the recovery function, and now it can be able to print the call stack if a panic occurs.
And also, in v2.0.0 the auto-cert goroutine will not start until you install the nginx-ui via <your_domain>/install.

<!-- gh-comment-id:1573822326 --> @0xJacky commented on GitHub (Jun 2, 2023): Hi, this issue was resolved in v2.0.0 beta. I can explain why it was throwing a runtime error. It was caused by the auto-cert goroutine, which was trying to access the db pointer. However this pointer could be nil until you visit `<your_domain>/install` to install nginx-ui. Thus, the recovery function will print this error in the console. In v2.0.0, I have enhanced the recovery function, and now it can be able to print the call stack if a panic occurs. And also, in v2.0.0 the auto-cert goroutine will not start until you install the nginx-ui via `<your_domain>/install`.
Author
Owner

@skrilax91 commented on GitHub (Jun 2, 2023):

Thanks for your answer, the problem is that i am not able to go to x.x.x.x:9000/install, i am always redirect to the dashboard

<!-- gh-comment-id:1573839783 --> @skrilax91 commented on GitHub (Jun 2, 2023): Thanks for your answer, the problem is that i am not able to go to x.x.x.x:9000/install, i am always redirect to the dashboard
Author
Owner

@skrilax91 commented on GitHub (Jun 2, 2023):

My bad, i need to go to x.x.x.x:9000/#/install

<!-- gh-comment-id:1573841076 --> @skrilax91 commented on GitHub (Jun 2, 2023): My bad, i need to go to x.x.x.x:9000/#/install
Author
Owner

@skrilax91 commented on GitHub (Jun 2, 2023):

It's working now, thanks you for the help !

<!-- gh-comment-id:1573842523 --> @skrilax91 commented on GitHub (Jun 2, 2023): It's working now, thanks you for the help !
Author
Owner

@jflad17 commented on GitHub (Oct 20, 2024):

My bad, i need to go to x.x.x.x:9000/#/install

Thank you for this, this solved the issue I mentioned on https://github.com/0xJacky/nginx-ui/issues/612

<!-- gh-comment-id:2424473394 --> @jflad17 commented on GitHub (Oct 20, 2024): > My bad, i need to go to x.x.x.x:9000/#/install Thank you for this, this solved the issue I mentioned on https://github.com/0xJacky/nginx-ui/issues/612
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#3171
No description provided.