Settings->Repositories causing "500" error if the user (the user is an admin) has not created/owned any repository #6604

Closed
opened 2025-11-02 07:01:06 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @georgewayne on GitHub (Dec 30, 2020).

  • Gitea version (or commit ref): 1.13.1 built with GNU Make 4.3, go1.15.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify
  • Git version: 2.26.2
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x
      Capture
      ] No
  • Log gist:

Description

logged in user is a site admin who has not created or own any repository. Would get "500" error (screen shot attached) when choose Settings->Repositories tab.

Screenshots

Originally created by @georgewayne on GitHub (Dec 30, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.13.1 built with GNU Make 4.3, go1.15.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify - Git version: 2.26.2 - Operating system: Linux <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x ![Capture](https://user-images.githubusercontent.com/15681127/103335886-4d8bf880-4a2b-11eb-910d-7d838a67e77c.JPG) ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description logged in user is a site admin who has not created or own any repository. Would get "500" error (screen shot attached) when choose Settings->Repositories tab. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 07:01:06 -06:00
Author
Owner

@zeripath commented on GitHub (Dec 30, 2020):

please give us logs,

@zeripath commented on GitHub (Dec 30, 2020): please give us logs,
Author
Owner

@zeripath commented on GitHub (Dec 30, 2020):

seriously if you just gave us logs I would be able to sort this out without having to fire up a gitea instance.

@zeripath commented on GitHub (Dec 30, 2020): seriously if you just gave us logs I would be able to sort this out without having to fire up a gitea instance.
Author
Owner

@zeripath commented on GitHub (Dec 30, 2020):

2020/12/30 16:54:48 ...r/setting/profile.go:257:Repos() [E] filepath.Walk: lstat /data/git/repositories/administrator: no such file or directory

@zeripath commented on GitHub (Dec 30, 2020): 2020/12/30 16:54:48 ...r/setting/profile.go:257:Repos() [E] filepath.Walk: lstat /data/git/repositories/administrator: no such file or directory
Author
Owner

@zeripath commented on GitHub (Dec 30, 2020):

which comes from:

632800eda7/routers/user/setting/profile.go (L257)

and actually from:

632800eda7/routers/user/setting/profile.go (L235-L236)

because the user directory doesn't exist.

We simply need to ensure it does.

@zeripath commented on GitHub (Dec 30, 2020): which comes from: https://github.com/go-gitea/gitea/blob/632800eda7108e5e8d90dd9e3e985da3deecf365/routers/user/setting/profile.go#L257 and actually from: https://github.com/go-gitea/gitea/blob/632800eda7108e5e8d90dd9e3e985da3deecf365/routers/user/setting/profile.go#L235-L236 because the user directory doesn't exist. We simply need to ensure it does.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6604