Opening any repository returns 500 error #2531

Closed
opened 2025-11-02 04:39:37 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @weeco on GitHub (Nov 14, 2018).

  • Gitea version (or commit ref):
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I am using the official docker image from dockerhub (tag 1.6) and I am using a managed MySQL instance from Google. I can use gitea just fine, create a repository and do whatever I want. However once I restarted the docker container (hosted inside of a kubernetes cluster) I can not open the created repository's anymore. In the browser I get a 500 server error returned in the server logs I do see the following log lines:

[Macaron] 2018-11-14 09:26:29: Started GET /test-orga/test3 for 217.111.34.38
2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2018/11/14 09:26:29 [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"test-orga"}
2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{3, "test3"}
2018/11/14 09:26:29 [...ules/context/repo.go:354 func1()] [E] RepoAssignment Invalid repo /data/git/repositories/test-orga/test3.git: no such file or directory
[Macaron] 2018-11-14 09:26:29: Completed GET /test-orga/test3 404 Not Found in 129.50161ms

This is 100% reproducible on my setup, therefore I am wondering if I missed something in the setup?

Originally created by @weeco on GitHub (Nov 14, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): - Git version: - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description I am using the official docker image from dockerhub (tag 1.6) and I am using a managed MySQL instance from Google. I can use gitea just fine, create a repository and do whatever I want. However once I restarted the docker container (hosted inside of a kubernetes cluster) I can not open the created repository's anymore. In the browser I get a 500 server error returned in the server logs I do see the following log lines: ``` [Macaron] 2018-11-14 09:26:29: Started GET /test-orga/test3 for 217.111.34.38 2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2018/11/14 09:26:29 [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"test-orga"} 2018/11/14 09:26:29 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{3, "test3"} 2018/11/14 09:26:29 [...ules/context/repo.go:354 func1()] [E] RepoAssignment Invalid repo /data/git/repositories/test-orga/test3.git: no such file or directory [Macaron] 2018-11-14 09:26:29: Completed GET /test-orga/test3 404 Not Found in 129.50161ms ``` This is 100% reproducible on my setup, therefore I am wondering if I missed something in the setup?
GiteaMirror added the type/question label 2025-11-02 04:39:37 -06:00
Author
Owner

@SagePtr commented on GitHub (Nov 14, 2018):

Probably repo exists in database but doesn't exist in /data/git/repositories

@SagePtr commented on GitHub (Nov 14, 2018): Probably repo exists in database but doesn't exist in /data/git/repositories
Author
Owner

@weeco commented on GitHub (Nov 14, 2018):

You were right, I didn't attach a persistent volume to my docker container. Thanks :-)

@weeco commented on GitHub (Nov 14, 2018): You were right, I didn't attach a persistent volume to my docker container. Thanks :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2531