dimkr / tootik

A federated nanoblogging service with a Gemini frontend.
gemini://hd.206267.xyz
Apache License 2.0
95 stars 3 forks source link

Cannot start Tootik as systemctl service #29

Closed locrianz closed 7 months ago

locrianz commented 7 months ago

All right, I'm coming back to report this problem like a good user.

I've filled out /etc/systemd/system/tootik.service as described in the quick setup guide:

[Unit]
Description=tootik
After=network.target

[Service]
ExecStart=tootik -domain toot.locrian.zone -addr :443 -gemaddr :1965 -gopherad>
User=tootik
Group=tootik
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Restart=always

[Install]
WantedBy=multi-user.target

Then ran systemctl daemon-reload and systemctl enable tootik.

At this point, running systemctl status tootik gives this output:

○ tootik.service - tootik
     Loaded: loaded (/etc/systemd/system/tootik.service; enabled; vendor preset: enabled)
     Active: inactive (dead)

I run systemctl start tootik, but toot.locrian.zone is not accessible over Gemini or HTTPS. Now when I run systemctl status tootik I get this:

× tootik.service - tootik
     Loaded: loaded (/etc/systemd/system/tootik.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-12-19 14:03:10 UTC; 2min 8s ago
   Main PID: 9985 (code=exited, status=2)
        CPU: 9ms

Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Scheduled restart job, restart counter is at 5.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Stopped tootik.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Start request repeated too quickly.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Failed to start tootik.

journalctl -u tootik -S 'today' gives me this:

Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Started tootik.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9957]: panic: failed to remove invisible posts: attempt to write a readonly database
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9957]: goroutine 1 [running]:
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9957]: main.main()
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9957]:         /home/runner/work/tootik/tootik/cmd/tootik/main.go:126 +0xf8e
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Scheduled restart job, restart counter is at 1.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Stopped tootik.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Started tootik.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9964]: panic: failed to remove invisible posts: attempt to write a readonly database
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9964]: goroutine 1 [running]:
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9964]: main.main()
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9964]:         /home/runner/work/tootik/tootik/cmd/tootik/main.go:126 +0xf8e
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Scheduled restart job, restart counter is at 2.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Stopped tootik.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Started tootik.
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9971]: panic: failed to remove invisible posts: attempt to write a readonly database
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9971]: goroutine 1 [running]:
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9971]: main.main()
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9971]:         /home/runner/work/tootik/tootik/cmd/tootik/main.go:126 +0xf8e
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 19 14:03:09 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Scheduled restart job, restart counter is at 3.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Stopped tootik.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Started tootik.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9978]: panic: failed to remove invisible posts: attempt to write a readonly database
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9978]: goroutine 1 [running]:
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9978]: main.main()
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9978]:         /home/runner/work/tootik/tootik/cmd/tootik/main.go:126 +0xf8e
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Failed with result 'exit-code'.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: tootik.service: Scheduled restart job, restart counter is at 4.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Stopped tootik.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 systemd[1]: Started tootik.
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9985]: panic: failed to remove invisible posts: attempt to write a readonly database
Dec 19 14:03:10 ubuntu-s-1vcpu-512mb-10gb-fra1-01 tootik[9985]: goroutine 1 [running]:
dimkr commented 7 months ago

Try chown -R tootik:tootik /tootik-cfg /tootik-data, then restart again

locrianz commented 7 months ago

That worked. I was pretty sure I already did that but I guess I missed that step. Thanks.