[1.20.0] After update an new error about WORK_PATH are logged #11250

Closed
opened 2025-11-02 09:32:13 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @tuxmaster5000 on GitHub (Jul 17, 2023).

Description

After the update this error is logged:

Jul 17 16:36:09 gitea[537292]: 2023/07/17 16:36:09 cmd/web.go:170:serveInstalled() [E] Unable to update WORK_PATH=/opt/gitea to config "/etc/gitea/app.ini">
Jul 17 16:36:09 gitea[537292]: You must set it manually, otherwise there might be bugs when accessing the git repositories
```.
But the Configuration Cheat Sheet will not explain this setting.

### Gitea Version

1.20.0

### Can you reproduce the bug on the Gitea demo site?

Yes

### Log Gist

_No response_

### Screenshots

_No response_

### Git Version

_No response_

### Operating System

_No response_

### How are you running Gitea?

Download binary from GH.

### Database

PostgreSQL
Originally created by @tuxmaster5000 on GitHub (Jul 17, 2023). ### Description After the update this error is logged: ``` Jul 17 16:36:09 gitea[537292]: 2023/07/17 16:36:09 cmd/web.go:170:serveInstalled() [E] Unable to update WORK_PATH=/opt/gitea to config "/etc/gitea/app.ini"> Jul 17 16:36:09 gitea[537292]: You must set it manually, otherwise there might be bugs when accessing the git repositories ```. But the Configuration Cheat Sheet will not explain this setting. ### Gitea Version 1.20.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Download binary from GH. ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:32:13 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 17, 2023):

I think the log message is clear enough, right?

Update: I see your point, see the comment below.

@wxiaoguang commented on GitHub (Jul 17, 2023): I think the log message is clear enough, right? Update: I see your point, see the comment below.
Author
Owner

@wxiaoguang commented on GitHub (Jul 17, 2023):

But the Configuration Cheat Sheet will not explain this setting.

The document PR is : Update path related documents #25417 , sorry for that it hasn't been merged yet.

You can do chmod 0600 and chown (to gitea user) to your app.ini, then Gitea can update the config file automatically.

@wxiaoguang commented on GitHub (Jul 17, 2023): > But the Configuration Cheat Sheet will not explain this setting. The document PR is : Update path related documents #25417 , sorry for that it hasn't been merged yet. You can do `chmod 0600` and `chown (to gitea user)` to your `app.ini`, then Gitea can update the config file automatically.
Author
Owner

@tuxmaster5000 commented on GitHub (Jul 18, 2023):

No problem, thanks for the update. But in my case chmod will not be an option, because the app.ini is managed. So you go to the hell, when both (the app and the management system) write to the file. So when the PR will be merged, the dev docu will be updated and I can read it :)

@tuxmaster5000 commented on GitHub (Jul 18, 2023): No problem, thanks for the update. But in my case chmod will not be an option, because the app.ini is managed. So you go to the hell, when both (the app and the management system) write to the file. So when the PR will be merged, the dev docu will be updated and I can read it :)
Author
Owner

@wxiaoguang commented on GitHub (Jul 18, 2023):

because the app.ini is managed

Thank you for the details. IMO it won't be a problem, because Gitea can update some necessary config options automatically, and it won't break anything even if the file is managed.

So when the PR will be merged, the dev docu will be updated and I can read it :)

No need to wait :)

In short: if you want to manage the app.ini by your tools, just put "WORK_PATH = /the/gitea/work-path" in your app.ini in the global scope (just like RUN_MODE and APP_NAME)

In history, Gitea's "work-path" is its binary directory. So the default directory layout is:

/dir/gitea (the binary program)

Then "work-path" is "/dir", then many other paths are based on the "work-path":
/dir/data/...
/dir/custom/...
/dir/log/...

To avoid "guessing" the "work-path", now, the WORK_PATH option in "app.ini" is used to provide a stable work-path value.

@wxiaoguang commented on GitHub (Jul 18, 2023): > because the app.ini is managed Thank you for the details. IMO it won't be a problem, because Gitea can update some necessary config options automatically, and it won't break anything even if the file is managed. > So when the PR will be merged, the dev docu will be updated and I can read it :) No need to wait :) In short: if you want to manage the app.ini by your tools, just put "WORK_PATH = /the/gitea/work-path" in your `app.ini` in the global scope (just like RUN_MODE and APP_NAME) In history, Gitea's "work-path" is its binary directory. So the default directory layout is: ``` /dir/gitea (the binary program) Then "work-path" is "/dir", then many other paths are based on the "work-path": /dir/data/... /dir/custom/... /dir/log/... ``` To avoid "guessing" the "work-path", now, the WORK_PATH option in "app.ini" is used to provide a stable work-path value.
Author
Owner

@tuxmaster5000 commented on GitHub (Jul 18, 2023):

Ah the global block. I will try it at the evening today

@tuxmaster5000 commented on GitHub (Jul 18, 2023): Ah the global block. I will try it at the evening today
Author
Owner

@tuxmaster5000 commented on GitHub (Jul 18, 2023):

Yes, this will work. While the PR is on the road, it will close this here.

@tuxmaster5000 commented on GitHub (Jul 18, 2023): Yes, this will work. While the PR is on the road, it will close this here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11250