Skip to content

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

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

Closed
tuxmaster5000 opened this issue Jul 17, 2023 · 6 comments
Closed

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

tuxmaster5000 opened this issue Jul 17, 2023 · 6 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@tuxmaster5000
Copy link
Contributor

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
@tuxmaster5000 tuxmaster5000 changed the title [1.20.0] After update an new error about WORK_PATH are loggged [1.20.0] After update an new error about WORK_PATH are logged Jul 17, 2023
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jul 17, 2023

I think the log message is clear enough, right?

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

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Jul 17, 2023
@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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.

@tuxmaster5000
Copy link
Contributor Author

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 :)

@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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.

@tuxmaster5000
Copy link
Contributor Author

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

@tuxmaster5000
Copy link
Contributor Author

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2023
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
Projects
None yet
Development

No branches or pull requests

2 participants