Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
irfanjunaid opened this issue Dec 20, 2023 · 5 comments
Open

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

irfanjunaid opened this issue Dec 20, 2023 · 5 comments
Labels
issue/workaround it is or has a workaround type/bug

Comments

@irfanjunaid
Copy link

irfanjunaid commented 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

@lng2020
Copy link
Member

lng2020 commented Dec 20, 2023

What's your gitea.service file?

@irfanjunaid
Copy link
Author

[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

@bowaggoner
Copy link

bowaggoner commented 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

@wxiaoguang
Copy link
Contributor

There seems to be a bug.

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

@irfanjunaid
Copy link
Author

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

wxiaoguang added a commit that referenced this issue Jan 7, 2024
Although the systemd notify support was added, it seems that there are
some problems (#28553, for the "non-installed" instance)
@wxiaoguang wxiaoguang changed the title Systemd notify is not working in Ubuntu Jammy Systemd notify doesn't work for Install Page (INSTALL_LOCK=false) Jan 7, 2024
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
Although the systemd notify support was added, it seems that there are
some problems (go-gitea#28553, for the "non-installed" instance)
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Although the systemd notify support was added, it seems that there are
some problems (go-gitea#28553, for the "non-installed" instance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/workaround it is or has a workaround type/bug
Projects
None yet
Development

No branches or pull requests

4 participants