You are not logged in.
Pages: 1
I've updated Gogs via yaourt package on my server and now gogs service doesn't restart. I obtain the following error:
systemctl status gogs.service
● gogs.service - Gogs
Loaded: loaded (/usr/lib/systemd/system/gogs.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-12-01 10:45:06 CET; 5min ago
Process: 18743 ExecStart=/usr/bin/gogs web --config /etc/gogs/app.ini (code=exited, status=2)
Main PID: 18743 (code=exited, status=2)
Dec 01 10:45:06 sputnik systemd[1]: gogs.service: Service hold-off time over, scheduling restart.
Dec 01 10:45:06 sputnik systemd[1]: gogs.service: Scheduled restart job, restart counter is at 5.
Dec 01 10:45:06 sputnik systemd[1]: Stopped Gogs.
Dec 01 10:45:06 sputnik systemd[1]: gogs.service: Start request repeated too quickly.
Dec 01 10:45:06 sputnik systemd[1]: gogs.service: Failed with result 'exit-code'.
Dec 01 10:45:06 sputnik systemd[1]: Failed to start Gogs.
Can you help me? How can I obtain more info about the issue?
Last edited by giacombum (2017-12-01 09:54:47)
Offline
Offline
Nope, because the server doesn't start...
Offline
Have you tried running the ExecStart command directly? And is there no --debug / --verbose / etc. flag you can pass to the program to say what it's doing and why it's exiting with an error?
Offline
I start the server via systemd command, so I don't know if is there another command to start gogs...
Offline
Loaded: loaded (/usr/lib/systemd/system/gogs.service; enabled; vendor preset: disabled)
/usr/lib/systemd/system/gogs.service is the file systemd uses to start it, just look at the content of that file to see what is done.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
The content of the file is the following:
[Unit]
Description=Gogs
After=syslog.target
After=network.target
After=mariadb.service mysqld.service postgresql.service memcached.service redis.service
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=gogs
Group=gogs
WorkingDirectory=/var/lib/gogs
ExecStart=/usr/bin/gogs web --config /etc/gogs/app.ini
Restart=always
Environment=USER=gogs HOME=/var/lib/gogs
[Install]
WantedBy=multi-user.target
I've tried to execute the ExecStart command, but it requires the user 'gogs' so I can't start it...
Offline
It's easy enough to run the command as a different user...
sudo -u gogs /usr/bin/gogs web --config /etc/gogs/app.ini
Offline
sudo -u gogs /usr/bin/gogs web --config /etc/gogs/app.ini
panic: error getting work directory: stat .: permission denied
goroutine 1 [running]:
github.com/gogits/gogs/vendor/gopkg.in/macaron%2ev1.init.1()
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/gopkg.in/macaron.v1/macaron.go:317 +0x142
github.com/gogits/gogs/vendor/gopkg.in/macaron%2ev1.init()
<autogenerated>:1 +0x413
github.com/gogits/gogs/vendor/github.com/go-macaron/cache.init()
<autogenerated>:1 +0x50
github.com/gogits/gogs/vendor/github.com/go-macaron/cache/memcache.init()
<autogenerated>:1 +0x53
github.com/gogits/gogs/pkg/setting.init()
<autogenerated>:1 +0x7f
github.com/gogits/gogs/models.init()
<autogenerated>:1 +0x8c
github.com/gogits/gogs/cmd.init()
<autogenerated>:1 +0x8c
main.init()
<autogenerated>:1 +0x4e
Offline
[Unit]
Description=Gogs (Go Git Service)
After=network.target mariadb.service
[Service]
Type=simple
User=gogs
Group=gogs
Environment="GOGS_WORK_DIR=/var/lib/gogs"
WorkingDirectory=/var/lib/gogs
ExecStart=/usr/bin/gogs web
Restart=always
[Install]
WantedBy=multi-user.target
Offline
sudo -u gogs /usr/bin/gogs web --config /etc/gogs/app.ini panic: error getting work directory: stat .: permission denied goroutine 1 [running]: github.com/gogits/gogs/vendor/gopkg.in/macaron%2ev1.init.1() /tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/gopkg.in/macaron.v1/macaron.go:317 +0x142 github.com/gogits/gogs/vendor/gopkg.in/macaron%2ev1.init() <autogenerated>:1 +0x413 github.com/gogits/gogs/vendor/github.com/go-macaron/cache.init() <autogenerated>:1 +0x50 github.com/gogits/gogs/vendor/github.com/go-macaron/cache/memcache.init() <autogenerated>:1 +0x53 github.com/gogits/gogs/pkg/setting.init() <autogenerated>:1 +0x7f github.com/gogits/gogs/models.init() <autogenerated>:1 +0x8c github.com/gogits/gogs/cmd.init() <autogenerated>:1 +0x8c main.init() <autogenerated>:1 +0x4e
You should do a
sudo chown -R gogs:gogs /etc/gogs
Offline
I've tried to change the permissions in every gogs folder, but the problem still persists... Do you think I need a reboot?
Offline
It's failing to stat "." i.e. your current working directory. Did you cd to /var/lib/gogs like the unit does (WorkingDirectory=/var/lib/gogs) ?
Offline
No, I can't cd to /var/lib/gogs: but the permissions seems correct...
/var/lib 23 files, 100Kb
└──────╼ lt
total 92K
drwxrwxrwt 2 root root 4.0K Sep 6 2015 ex
drwxr-xr-x 2 root root 4.0K Aug 4 2016 upower
drwxr-xr-x 2 root root 4.0K Nov 7 2016 dhcpcd
drwxr-xr-x 2 root root 4.0K Mar 26 2017 misc
drwxr-xr-x 2 root root 4.0K Mar 27 2017 iptables
drwxr-xr-x 2 root root 4.0K Mar 27 2017 ip6tables
drwxr-xr-x 2 root root 4.0K May 1 2017 arpd
drwx------ 2 root root 4.0K May 18 2017 udisks2
drwxr-xr-x 2 root root 4.0K May 21 2017 alsa
drwx------ 2 root root 4.0K Jun 20 17:36 machines
drwxr-xr-x 6 root root 4.0K Jun 20 17:59 systemd
drwxr-xr-x 13 sddm sddm 4.0K Jun 20 18:00 sddm
drwxr-xr-x 2 root root 4.0K Oct 5 11:47 krb5kdc
drwxr-xr-x 2 root root 4.0K Nov 6 09:19 dbus
drwx------ 2 redis redis 4.0K Nov 13 09:09 redis
drwx------ 5 mysql mysql 4.0K Nov 18 07:32 mysql
drwxr-xr-x 2 root root 4.0K Nov 18 07:32 xkb
drwx------ 2 root root 4.0K Nov 18 07:32 NetworkManager
drwxr-xr-x 2 ntp root 4.0K Nov 18 08:32 ntp
drwxr-xr-x 3 colord colord 4.0K Nov 28 14:56 colord
drwx------ 7 gogs gogs 4.0K Dec 1 10:45 gogs
drwxr-xr-x 4 root root 4.0K Dec 6 09:14 pacman
Offline
The directory only has permissions for gogs. So to enter it, it should be run as gogs: sudo -u gogs sh -c 'cd /var/lib/gogs && ...'
Last edited by GenkiSky (2017-12-07 16:33:03)
Offline
sudo -u gogs sh -c 'cd /var/lib/gogs && ls -lrth'
total 16K
drwxr-xr-x 2 gogs gogs 4.0K Oct 9 16:53 repos
drwxr-xr-x 2 gogs gogs 4.0K Oct 9 16:53 avatars
drwxr-xr-x 2 gogs gogs 4.0K Oct 9 16:53 certs
drwx------ 3 gogs gogs 4.0K Dec 1 10:40 data
It seems everything ok... or not?
Offline
So, recap, please make sure you're doing everything in the service file you posted...
1) You have the following services running: mariadb.service mysqld.service postgresql.service memcached.service redis.service
2) You're using the following command:
sudo -u gogs sh -c 'cd /var/lib/gogs && GOGS_WORK_DIR=/var/lib/gogs /usr/bin/gogs web --config /etc/gogs/app.ini'
3) You've looked to see if there are any --debug or --verbose commands for gogs that you can add to help see why it fails when you run step 2, as presumably it will fail if the service fails.
Offline
I've all the service up and running, except for postgresql and memcached (but they don't seems necessary), now, when I launch the command I obtain this error:
sudo -u gogs sh -c 'cd /var/lib/gogs && GOGS_WORK_DIR=/var/lib/gogs /usr/bin/gogs web --config /etc/gogs/app.ini'
2017/12/12 13:26:27 [TRACE] Custom path: /var/lib/gogs/custom
2017/12/12 13:26:27 [TRACE] Log path: /var/log/gogs
2017/12/12 13:26:27 [TRACE] Log Mode: File (Trace)
2017/12/12 13:26:27 [ INFO] SpQR Team 0.11.34.1122
panic: length of langs is not same as length of names
goroutine 1 [running]:
github.com/gogits/gogs/vendor/github.com/go-macaron/i18n.prepareOptions(0xc420236000, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/github.com/go-macaron/i18n/i18n.go:123 +0x603
github.com/gogits/gogs/vendor/github.com/go-macaron/i18n.I18n(0xc420236000, 0x1, 0x1, 0xc420735f60, 0x20)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/github.com/go-macaron/i18n/i18n.go:157 +0x7a
github.com/gogits/gogs/cmd.newMacaron(0xc420214140)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/cmd/web.go:122 +0xa98
github.com/gogits/gogs/cmd.runWeb(0xc420214140, 0x0, 0xc420214140)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/cmd/web.go:166 +0x74
github.com/gogits/gogs/vendor/github.com/urfave/cli.HandleAction(0xe28840, 0xf90e70, 0xc420214140, 0xc42016c200, 0x0)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/github.com/urfave/cli/app.go:483 +0xb7
github.com/gogits/gogs/vendor/github.com/urfave/cli.Command.Run(0xf470c9, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf5931d, 0x10, 0x0, ...)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/github.com/urfave/cli/command.go:193 +0xa99
github.com/gogits/gogs/vendor/github.com/urfave/cli.(*App).Run(0xc4202901a0, 0xc4200100c0, 0x4, 0x4, 0x0, 0x0)
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/vendor/github.com/urfave/cli/app.go:250 +0x758
main.main()
/tmp/yaourt-tmp-giacomo/aur-gogs/src/build/src/github.com/gogits/gogs/gogs.go:41 +0x3b4
I've seen the 'panic' line, maybe is there some error in the /etc/gogs/app.ini file?
Offline
I've seen the 'panic' line, maybe is there some error in the /etc/gogs/app.ini file?
very likely, what is the content of it ?
Log path: /var/log/gogs
The content of the log file could also be helpful.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
[Thought it was a thread about a problem I had before (using the wrong logdir)]
Meanwhile, is the problem solved?
Cheers,
Felix
Last edited by TheGoliath (2018-09-22 20:23:30)
Offline
Pages: 1