Systemd notify doesn't work for Install Page (INSTALL_LOCK=false) #12242

Open
opened 2025-11-02 10:03:07 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @irfanjunaid on GitHub (Dec 20, 2023).

Description

Hi,
I am still facing the same issue as #27422
Installed the latest version(1.21.2) following the docs. The service is not getting to active (running) state after copying the gitea.service.

root@localhost:/home/ubuntu# systemctl status gitea
● gitea.service - Gitea (Git with a cup of tea)
     Loaded: loaded (/etc/systemd/system/gitea.service; enabled; vendor preset: enabled)
     Active: activating (start) since Wed 2023-12-20 11:08:52 UTC; 52s ago
   Main PID: 9702 (gitea)
     Status: "Starting Gitea"
      Tasks: 8 (limit: 4590)
     Memory: 106.3M
        CPU: 491ms
     CGroup: /system.slice/gitea.service
             └─9702 /usr/local/bin/gitea web --config /etc/gitea/app.ini

Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.21.2 built with GNU Make 4.3, go1.21.5 : bindata, sqlite, sqlite_unlock_notify
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /var/lib/gitea
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /var/lib/gitea/custom
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /etc/gitea/app.ini
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run install page
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:304:listen() [I] Listen: http://0.0.0.0:3000
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:308:listen() [I] AppURL(ROOT_URL): http://localhost:3000/
Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 ...s/graceful/server.go:70:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 9712

According to the changelog, only pre 1.20.x releases should be affected but the latest versions are also affected.

Gitea Version

1.21.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.43.0

Operating System

Ubuntu 22.04.3 LTS

How are you running Gitea?

Installation from binary

Database

SQLite

Originally created by @irfanjunaid on GitHub (Dec 20, 2023). ### Description Hi, I am still facing the same issue as #27422 Installed the latest version(`1.21.2`) following the [docs](https://docs.gitea.com/installation/install-from-binary). The service is not getting to `active (running)` state after copying the [gitea.service](https://github.com/go-gitea/gitea/blob/release/v1.21/contrib/systemd/gitea.service). ``` root@localhost:/home/ubuntu# systemctl status gitea ● gitea.service - Gitea (Git with a cup of tea) Loaded: loaded (/etc/systemd/system/gitea.service; enabled; vendor preset: enabled) Active: activating (start) since Wed 2023-12-20 11:08:52 UTC; 52s ago Main PID: 9702 (gitea) Status: "Starting Gitea" Tasks: 8 (limit: 4590) Memory: 106.3M CPU: 491ms CGroup: /system.slice/gitea.service └─9702 /usr/local/bin/gitea web --config /etc/gitea/app.ini Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.21.2 built with GNU Make 4.3, go1.21.5 : bindata, sqlite, sqlite_unlock_notify Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/local/bin/gitea Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /var/lib/gitea Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /var/lib/gitea/custom Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /etc/gitea/app.ini Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:117:showWebStartupMessage() [I] Prepare to run install page Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:304:listen() [I] Listen: http://0.0.0.0:3000 Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 cmd/web.go:308:listen() [I] AppURL(ROOT_URL): http://localhost:3000/ Dec 20 11:08:52 ip-172-31-32-79 gitea[9702]: 2023/12/20 11:08:52 ...s/graceful/server.go:70:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 9712 ``` According to the [changelog](https://blog.gitea.com/release-of-1.20.0/), only pre 1.20.x releases should be affected but the latest versions are also affected. ### Gitea Version 1.21.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.43.0 ### Operating System Ubuntu 22.04.3 LTS ### How are you running Gitea? [Installation from binary](https://docs.gitea.com/installation/install-from-binary) ### Database SQLite
GiteaMirror added the type/bugissue/workaround labels 2025-11-02 10:03:07 -06:00
Author
Owner

@lng2020 commented on GitHub (Dec 20, 2023):

What's your gitea.service file?

@lng2020 commented on GitHub (Dec 20, 2023): What's your gitea.service file?
Author
Owner

@irfanjunaid commented on GitHub (Dec 20, 2023):

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target

[Service]
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
# LimitNOFILE=524288:524288
RestartSec=2s
Type=notify
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
WatchdogSec=30s
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
PrivateUsers=false

[Install]
WantedBy=multi-user.target
@irfanjunaid commented on GitHub (Dec 20, 2023): ``` [Unit] Description=Gitea (Git with a cup of tea) After=syslog.target After=network.target [Service] # Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that # LimitNOFILE=524288:524288 RestartSec=2s Type=notify User=git Group=git WorkingDirectory=/var/lib/gitea/ ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini Restart=always Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea WatchdogSec=30s CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE PrivateUsers=false [Install] WantedBy=multi-user.target ```
Author
Owner

@bowaggoner commented on GitHub (Jan 6, 2024):

I ran into this issue on Debian 12 and Gitea 1.21.3 after a clean install. Installing from binary, following the docs. I found that if app.ini does not exist, then the issue occurs, i.e. the service status stays stuck on "activating". Attached are the results of systemctl status gitea and the relevant contents of gitea.service.

However, once app.ini exists with the correct permissions, the gitea service works normally. (So I can get around the issue by running gitea manually, completing the web setup, then stopping gitea and launching it as a service at that point.)

When I delete app.ini, the problem returns, and when I put app.ini back, the problem disappears.

systemctl_status_gitea.txt
gitea_service.txt

@bowaggoner commented on GitHub (Jan 6, 2024): I ran into this issue on Debian 12 and Gitea 1.21.3 after a clean install. Installing from binary, following the docs. I found that if app.ini does not exist, then the issue occurs, i.e. the service status stays stuck on "activating". Attached are the results of `systemctl status gitea` and the relevant contents of gitea.service. However, once app.ini exists with the correct permissions, the gitea service works normally. (So I can get around the issue by running gitea manually, completing the web setup, then stopping gitea and launching it as a service at that point.) When I delete app.ini, the problem returns, and when I put app.ini back, the problem disappears. [systemctl_status_gitea.txt](https://github.com/go-gitea/gitea/files/13850856/systemctl_status_gitea.txt) [gitea_service.txt](https://github.com/go-gitea/gitea/files/13850857/gitea_service.txt)
Author
Owner

@wxiaoguang commented on GitHub (Jan 7, 2024):

There seems to be a bug.

So please use Type=simple at the moment (just as the old document said)

@wxiaoguang commented on GitHub (Jan 7, 2024): There seems to be a bug. So please use Type=simple at the moment (just as the old document said)
Author
Owner

@irfanjunaid commented on GitHub (Jan 7, 2024):

I can see that @bowaggoner comment seems to be true. Once the Gitea is initialized, Type=notify works(Alteast for me).

@irfanjunaid commented on GitHub (Jan 7, 2024): I can see that @bowaggoner comment seems to be true. Once the Gitea is initialized, `Type=notify` works(Alteast for me).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12242