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

Service exits immediately - 1/FAILURE #6972

Closed
gino opened this issue May 17, 2019 · 11 comments
Closed

Service exits immediately - 1/FAILURE #6972

gino opened this issue May 17, 2019 · 11 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail issue/stale

Comments

@gino
Copy link

gino commented May 17, 2019

Hi there,

I just installed Gitea on my server and created a service file, but unfortunately the service stops immediately without any errors.

May 17 11:02:37 [host] systemd[1]: Started Gitea (Git with a cup of tea).
May 17 11:02:37 [host] gitea[4001]: 2019/05/17 11:02:37 #033[1;36m[T] AppPath: /usr/local/bin/gitea#033[0m
May 17 11:02:37 [host] gitea[4001]: 2019/05/17 11:02:37 #033[1;36m[T] AppWorkPath: /home/git/#033[0m
May 17 11:02:37 [host] gitea[4001]: 2019/05/17 11:02:37 #033[1;36m[T] Custom path: /home/git/custom#033[0m
May 17 11:02:37 [host] gitea[4001]: 2019/05/17 11:02:37 #033[1;36m[T] Log path: /home/git/log#033[0m
May 17 11:02:37 [host] systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
May 17 11:02:37 [host] systemd[1]: gitea.service: Failed with result 'exit-code'.

I also configured the app.ini correctly and set up the log directory to /home/git/log, unfortunately the directory stays empty.

I hope someone can help me with this issue.

I am able to provide more information about the configuration files, if needed.

Thanks a lot.

@gino
Copy link
Author

gino commented May 17, 2019

Edit: the problem is solved whenever I change the user to 'root'

@lunny
Copy link
Member

lunny commented May 17, 2019

I think that maybe you have some directory permission denied.

@Tekaoh
Copy link
Contributor

Tekaoh commented May 17, 2019

Try becoming user git and running the binary in a terminal rather than using the service. You might get a much more informative error.

@silverwind
Copy link
Member

silverwind commented May 19, 2019

You should see more info in systemd when setting log.mode to console in app.ini. Would you mind sharing from which template you created app.ini? Asking for #6987.

@zeripath
Copy link
Contributor

zeripath commented May 19, 2019

@gino this bug report lacks critical information to help us help you. You must give us more information.

What architecture are you running on? Is it raspberry pi? If so use arm6 not arm7.

What does your service file look like? Did you read https://docs.gitea.io/en-us/linux-service/ ? Did you copy https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service ?

@zeripath zeripath reopened this May 19, 2019
@zeripath
Copy link
Contributor

Sorry fat fingers - didn't mean to close.

@zeripath
Copy link
Contributor

zeripath commented May 19, 2019

As @silverwind suggests if you set

[Log]
Mode=console
Level=Trace

(Assuming you don't have a [log.console] section)

You should get more information.

@zeripath zeripath reopened this May 19, 2019
@zeripath zeripath added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 20, 2019
@stale
Copy link

stale bot commented Jul 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 19, 2019
@zeripath
Copy link
Contributor

@gino if you are still suffering this problem please reopen and comment. Otherwise I'm closing this due to lack of activity and information.

@Kevin-Mok
Copy link

Kevin-Mok commented Aug 16, 2019

Try becoming user git and running the binary in a terminal rather than using the service. You might get a much more informative error.

I'm having this same error. I can't start the template gitea.service, but I can get a working gitea server running it from user git.

Edit: I got it to work by setting the owner of /etc/gitea/app.ini to git:git.

Here was my relevant journal log:

Aug 16 16:26:40 digital-ocean systemd[1]: Started Gitea (Git with a cup of tea).
Aug 16 16:26:40 digital-ocean gitea[20205]: 2019/08/16 16:26:40 [...s/setting/setting.go:971 loadOrGenerateInternalToken()] [E] Error saving generated INTERNAL_TOKEN to custom config: open /etc/gitea/app.ini: permission denied
Aug 16 16:26:40 digital-ocean systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 16:26:40 digital-ocean systemd[1]: gitea.service: Failed with result 'exit-code'.
Aug 16 16:26:42 digital-ocean systemd[1]: gitea.service: Service RestartSec=2s expired, scheduling restart.
Aug 16 16:26:42 digital-ocean systemd[1]: gitea.service: Scheduled restart job, restart counter is at 1.
Aug 16 16:26:42 digital-ocean systemd[1]: Stopped Gitea (Git with a cup of tea).
Aug 16 16:26:42 digital-ocean systemd[1]: Started Gitea (Git with a cup of tea).
Aug 16 16:26:42 digital-ocean gitea[20223]: 2019/08/16 16:26:42 [...s/setting/setting.go:971 loadOrGenerateInternalToken()] [E] Error saving generated INTERNAL_TOKEN to custom config: open /etc/gitea/app.ini: permission denied
Aug 16 16:26:42 digital-ocean systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 16:26:42 digital-ocean systemd[1]: gitea.service: Failed with result 'exit-code'.
Aug 16 16:26:44 digital-ocean systemd[1]: gitea.service: Service RestartSec=2s expired, scheduling restart.
Aug 16 16:26:44 digital-ocean systemd[1]: gitea.service: Scheduled restart job, restart counter is at 2.
Aug 16 16:26:44 digital-ocean systemd[1]: Stopped Gitea (Git with a cup of tea).
Aug 16 16:26:44 digital-ocean systemd[1]: Started Gitea (Git with a cup of tea).
Aug 16 16:26:44 digital-ocean gitea[20236]: 2019/08/16 16:26:44 [...s/setting/setting.go:971 loadOrGenerateInternalToken()] [E] Error saving generated INTERNAL_TOKEN to custom config: open /etc/gitea/app.ini: permission denied
Aug 16 16:26:44 digital-ocean systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 16:26:44 digital-ocean systemd[1]: gitea.service: Failed with result 'exit-code'.
Aug 16 16:26:46 digital-ocean systemd[1]: gitea.service: Service RestartSec=2s expired, scheduling restart.
Aug 16 16:26:46 digital-ocean systemd[1]: gitea.service: Scheduled restart job, restart counter is at 3.
Aug 16 16:26:46 digital-ocean systemd[1]: Stopped Gitea (Git with a cup of tea).
Aug 16 16:26:46 digital-ocean systemd[1]: Started Gitea (Git with a cup of tea).
Aug 16 16:26:46 digital-ocean gitea[20247]: 2019/08/16 16:26:46 [...s/setting/setting.go:971 loadOrGenerateInternalToken()] [E] Error saving generated INTERNAL_TOKEN to custom config: open /etc/gitea/app.ini: permission denied
Aug 16 16:26:46 digital-ocean systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 16:26:46 digital-ocean systemd[1]: gitea.service: Failed with result 'exit-code'.

@demostanis-worlds
Copy link

You need to set the owner of /etc/gitea to the user you're using with gitea:
sudo chown -R username /etc/gitea

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail issue/stale
Projects
None yet
Development

No branches or pull requests

7 participants