mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-19 14:42:41 -05:00
[Info] Update from 1.9 to 1.10.x raises [E] InitIssuesIndexer: create index, mkdir /usr/local/bin/data: permission denied #4519
Closed
opened 2025-11-02 05:53:20 -06:00 by GiteaMirror
·
10 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7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1.4.0
v1.4.0-rc3
v1.4.0-rc2
v1.3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/question
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#4519
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mbedded on GitHub (Dec 19, 2019).
[x]):Description
An update from Gitea 1.9 to several 1.10 versions causes
so the instance cannot be started instantly again after the update.
My update was (roughly) the following:
Every time the service was unable to start gitea again. I got the same error message as written in #6398. I downloaded different versions of gitea (1.10, 1.10.1, 1.10.2) everyone had the same issue.
After some time I decided to download 1.10.2 and restart my raspberry (
shutdown -r).As I did this, the server came back online and runs without any issues. I am not sure why a replacement of the Gitea-executable may cause a
[E] InitIssuesIndexer: create index, mkdir /usr/local/bin/data: permission deniedissue because the configuration file with information like database, filepaths etc. was not changed.After restart of the Raspberry everything was fine again. I am not sure if this issue is already known. I found nothing in the repository yet.
If you have a better title, please feel free to adjust it for clarification :)
Summary
After an update of gitea
[E] InitIssuesIndexer: create index, mkdir /usr/local/bin/data: permission deniedis written in the log and the gitea-service is unable to be started again. A restart of the device (shutdown -r) fixes this problem.@lunny commented on GitHub (Dec 19, 2019):
your gitea binary is placed
/usr/local/bin, but your indexer data should not be/usr/local/bin/data. Could you paste your systemctl script?@6543 commented on GitHub (Dec 19, 2019):
and
ls -la /usr/local/bin/datato see the rights@mbedded commented on GitHub (Dec 20, 2019):
Thank you for your quick feedback. My data is stored in /home/pi/gitea.
I installed the system-script as described in https://docs.gitea.io/en-us/linux-service/.
I have no path called
/usr/local/bin/data. It's strange that I have acustomandGitea.Could these folders (in /usr/local/bin) be created by using
gitea web? As I tried Gitea the first time I executed the binary by using gitea web to test it. After it worked very well I decided to install it by using a service.Because I am not that good with the user management in Linux yet I decided to run gitea as "pi" user on my raspberry, because there is no other service running on that device.
@6543 commented on GitHub (Dec 20, 2019):
first look: It looks like the config file patjs do not match
@zeripath commented on GitHub (Dec 20, 2019):
Yet again the non-standard paths problem strikes again.
Gitea does not obey the FHS. It expects to be run at the base of its configuration and data directories.
Sticking it in /usr/local/bin and expecting it to work like a FHS compliant program causes no end of trouble.
We should change our documentation to recommend using the FHS compliant wrapper script or rebuilding with the FHS compliant options.
I also genuinely think we should also offer two builds one with the current directory structure and one which complies with the FHS.
In this case I suspect that this problem is due to restarting Gitea without the appropriate environment for whatever reason. The reason that on restart of the pi it works is that the systemd unit file is then run properly and Gitea was started with the correct environment.
If you want Gitea to behave like an FHS compliant program use the wrapper or recompile. Placing it directly in /usr/local/bin is recipe for gotchas.
@mbedded commented on GitHub (Dec 21, 2019):
I am sorry but I didn't understood that in complete :/
In my service I have the following line
There is a path to my gitea executable with
-cgiving the configuration file. What confuses me is the fact thatstop serviceandstart serviceare working after I restarted my device. But downloading the file, addingchmod +xand start the service again should be working.I am not entirely sure why this causes an issue.
The config file uses absolute paths to avoid issues with relative paths like missing data or data stored in strange places.
I am not working with Linux that much yet (only since 6-7 months) so I assumed (coming from a Windows world) there should be no issues when I replace an executable with another one.
If you see some better ways to install or use gitea feel free to adjust the documentation if this fits better than a bugfix within the code. That's why I added the Info-tag to the title because I am not sure if this is an environmental issue or caused by code somehow.
What do you mean exactly with
Should I move my Gitea-executable to
/usr/local/bin, adjust my service file and that fixes my issues? Currently the file is stored in /home/pi/gitea/gitea`.I will search for the meaning of FHS on Linux (I am not sure what this abbreviation means), maybe I can give some more information then.
@bagasme commented on GitHub (Dec 23, 2019):
@mbedded FHS is Filesystem Hierarchy Standard, which describes common paths for Unix and Unix-like systems (including Linux).
@zeripath commented on GitHub (Dec 23, 2019):
Sorry I missed your reply @mbedded. My message wasn't necessarily directed at fixing your problem directly.
Let's try to solve your problem before discussing how to prevent this from happening to other people in future.
If I understand correctly, you have:
In your first comment you don't state that you chmodded the new gitea.
Do you have a gitea in /usr/local/bin ? Is it possible that because gitea was not chmod +x that when systemctl tried to start the program it used that? Or is it possible that when systemctl tried to start the non-executable gitea it had to do some dance that meant that the environment disappeared?
In any case it looks like (re)starting gitea with systemctl did not lead to the environment being passed to gitea - which is weird.
I suggest that instead of referencing the binary directly in the systemd unit you instead download a copy of https://github.com/go-gitea/gitea/blob/master/contrib/fhs-compliant-script/gitea appropriately configured for your install and reference that in the systemd unit file. You could put the script in /usr/local/bin and have the gitea admin commands work from anywhere without having to set -c or an environment.
@mbedded commented on GitHub (Dec 24, 2019):
@bagasme Thank you for that information.
@zeripath that's no problem. Currently there are some holidays, too. So I don't expect an answer within a few days :)
Your list above is correct and describes my current environment.
I have no Gitea-executable in any other path. I missed to mention the
chmod +xcommand in my minimal example above. The execution rights where updated so it can be executed by the service. Thels -lahabove shows this:The .bak-file is the "old" gitea file before the update.
For my understanding:
/usr/bin/gitea.giteacommand without any additional parameters or values for the config-file or working.directory.I will try to get gitea running with the script and the new file locations. Because of the holidays it could be in the beginning of next year. When I made some progress I will reply to this thread :)
Thank you very much everyone for your help. I hope you have some nice time with your friends and family 🎄
@mbedded commented on GitHub (Jan 16, 2020):
Hello @zeripath and @bagasme,
i found some time within the last days to try and fix my installation as you suggested. I have done the following:
/usr/local/bin/gitea/etc/gitea/app.ini/var/lib/gitea/gitea-repositoriesandgitea-lfs/etc/systemd/system/gitea.service.I switched some versions with the following example:
Now i was able to change my version as example to 1.7.0 or 1.6.x. Now i switched to the current release of 1.10.2 and the errors mentioned by my first post didn't happen to me. So finally i was able to replace the gitea-executable and restart the service without restarting my Raspberry.
So i assume that using default directories (FHS) for your installation fixes my initial error. As first i upgraded as usual (using my custom directories) and that reproduced the error.
From my point of view we can close this ticket, because it was important to me to inform you that there may be a bug in Gitea because i am not that professional with Go or Linux yet :)
At this point you can decide what to do: I think the easiest thing will be a hint or warning within the documentation that this may appear when the default directories are not used.
I checked the documentation and there you tell about the FHS directories. I just didn't used them because as a new guy it was easier for me to have everything in one place to get started. So it's totally a self made mistake.
Thank you very much for your help and guidance 👍