500 / Show repo after creation not working

Hello community,

I am not sure if this is a bug so I want to check this here in this forum before creating an issue on GitHub.

My environment.

  • Physical system
  • 64GB RAM
  • 4 core CPU
  • FreeBSD 13
  • PostgreSQL 14.2
  • DB and repo are on a ufs file system
  • Gitea 1.16.5 (via packages)

I am able to login and can create a repo.

When I try to click on a repo after creation I got “500” server error.

I have changed the logging from info to debug. There is a warning about a deprecated stuff from Go. Maybe this is the error.

2022/04/27 15:02:49 ...s/issue_stopwatch.go:76:GetUserStopwatches() [I] [SQL] SELECT "id", "issue_id", "user_id", "created_unix" FROM "stopwatch" WHERE (stopwatch.user_id = $1) [1] - 541.588µs
2022/04/27 15:02:50 models/user/user.go:959:GetUserByIDEngine() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_change
_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "i
s_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_rep
os", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme", "keep_activity_private" FROM "user" WHERE "id"=$1 LIMIT 1 [1] - 899.973µs
2022/04/27 15:02:50 ...s/issue_stopwatch.go:103:hasUserStopwatch() [I] [SQL] SELECT "id", "issue_id", "user_id", "created_unix" FROM "stopwatch" WHERE (user_id = $1) LIMIT 1 [1] - 451.221µs
2022/04/27 15:02:50 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "owner_id", "owner_name", "lower_name", "name", "description", "website", "original_service_type", "original_url", "default_branch", "num_watches", "nu
m_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "num_projects", "num_closed_projects", "is_private", "is_empty", "is_archived", "is_mirror", "s
tatus", "is_fork", "fork_id", "is_template", "template_id", "size", "is_fsck_enabled", "close_issues_via_commit_in_any_branch", "topics", "trust_model", "avatar", "created_unix", "updated_unix" FROM "repository" WHERE "owner_id"=
$1 AND "lower_name"=$2 LIMIT 1 [1 spiritlog] - 1.192452ms
2022/04/27 15:02:50 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "repo_id", "user_id", "mode", "created_unix", "updated_unix" FROM "collaboration" WHERE "repo_id"=$1 AND "user_id"=$2 LIMIT 1 [1 1] - 600.791µs
2022/04/27 15:02:50 ...ls/repo/repo_unit.go:226:getUnitsByRepoID() [I] [SQL] SELECT "id", "repo_id", "type", "config", "created_unix" FROM "repo_unit" WHERE (repo_id = $1) [1] - 542.129µs
2022/04/27 15:02:50 ...s/repo/pushmirror.go:102:GetPushMirrorsByRepoID() [I] [SQL] SELECT "id", "repo_id", "remote_name", "interval", "created_unix", "last_update", "last_error" FROM "push_mirror" WHERE (repo_id=$1) [1] - 868.389
µs
2022/04/27 15:02:50 ...ules/context/repo.go:500:RepoAssignment() [I] [SQL] SELECT count(*) FROM "release" WHERE repo_id=$1 AND is_draft=$2 [1 false] - 549.372µs
2022/04/27 15:02:50 ...ules/context/repo.go:507:RepoAssignment() [I] [SQL] SELECT count(*) FROM "release" WHERE repo_id=$1 AND is_draft=$2 AND is_tag=$3 [1 false false] - 578.742µs
2022/04/27 15:02:50 models/org.go:631:GetOrgsCanCreateRepoByUserID() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_c
hange_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation
", "is_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "nu
m_repos", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme", "keep_activity_private" FROM "user" WHERE id IN (SELECT "user".id FROM "user" INNER JOIN "team_user" ON "team_user".
org_id = "user".id INNER JOIN "team" ON "team".id = "team_user".team_id WHERE "team_user".uid=$1 AND ("team".authorize=$2 OR "team".can_create_org_repo=$3)) ORDER BY "user"."name" ASC [1 owner true] - 2.258272ms
2022/04/27 15:02:50 models/repo/fork.go:49:GetUserFork() [I] [SQL] SELECT "id", "owner_id", "owner_name", "lower_name", "name", "description", "website", "original_service_type", "original_url", "default_branch", "num_watches", "
num_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "num_projects", "num_closed_projects", "is_private", "is_empty", "is_archived", "is_mirror",
"status", "is_fork", "fork_id", "is_template", "template_id", "size", "is_fsck_enabled", "close_issues_via_commit_in_any_branch", "topics", "trust_model", "avatar", "created_unix", "updated_unix" FROM "repository" WHERE (fork_id
= $1) AND (owner_id = $2) LIMIT 1 [1 1] - 846.915µs
2022/04/27 15:02:50 models/repo.go:338:FindUserOrgForks() [I] [SQL] SELECT "id", "owner_id", "owner_name", "lower_name", "name", "description", "website", "original_service_type", "original_url", "default_branch", "num_watches",
"num_stars", "num_forks", "num_issues", "num_closed_issues", "num_pulls", "num_closed_pulls", "num_milestones", "num_closed_milestones", "num_projects", "num_closed_projects", "is_private", "is_empty", "is_archived", "is_mirror",
 "status", "is_fork", "fork_id", "is_template", "template_id", "size", "is_fsck_enabled", "close_issues_via_commit_in_any_branch", "topics", "trust_model", "avatar", "created_unix", "updated_unix" FROM "repository" WHERE fork_id=
$1 AND owner_id IN (SELECT org_id FROM org_user WHERE uid=$2) [1 1] - 1.215154ms
2022/04/27 15:02:50 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "user_id", "repo_id", "mode", "created_unix", "updated_unix" FROM "watch" WHERE "user_id"=$1 AND "repo_id"=$2 LIMIT 1 [1 1] - 935.551µs
2022/04/27 15:02:50 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "uid", "repo_id", "created_unix" FROM "star" WHERE "uid"=$1 AND "repo_id"=$2 LIMIT 1 [1 1] - 818.316µs
2022/04/27 15:02:50 ...dules/git/command.go:143:RunWithContext() [D] /var/db/gitea/gitea-repositories/gitea/spiritlog.git: /usr/local/bin/git -c credential.helper= -c protocol.version=2 -c uploadpack.allowfilter=true rev-parse
2022/04/27 15:02:50 ...dules/git/command.go:143:RunWithContext() [D] /var/db/gitea/gitea-repositories/gitea/spiritlog.git: /usr/local/bin/git -c credential.helper= -c protocol.version=2 -c uploadpack.allowfilter=true show-ref --t
ags
2022/04/27 15:02:50 ...dules/git/command.go:143:RunWithContext() [D] /var/db/gitea/gitea-repositories/gitea/spiritlog.git: /usr/local/bin/git -c credential.helper= -c protocol.version=2 -c uploadpack.allowfilter=true cat-file --b
atch
2022/04/27 15:02:50 ...dules/git/command.go:143:RunWithContext() [D] /var/db/gitea/gitea-repositories/gitea/spiritlog.git: /usr/local/bin/git -c credential.helper= -c protocol.version=2 -c uploadpack.allowfilter=true cat-file --b
atch-check
2022/04/27 15:02:50 ...ules/context/repo.go:624:RepoAssignment() [E] GetTags: exit status 1 - warning: core.fsyncObjectFiles is deprecated; use core.fsync instead

2022/04/27 15:02:50 ...s/context/context.go:204:HTML() [D] Template: status/500
2022/04/27 15:02:50 ...dels/notification.go:741:GetNotificationCount() [I] [SQL] SELECT count(*) FROM "notification" WHERE (user_id = $1) AND (status = $2) [1 1] - 288.771µs
2022/04/27 15:02:50 models/user/user.go:959:GetUserByIDEngine() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_preference", "passwd", "passwd_hash_algo", "must_change
_password", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "language", "description", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "i
s_active", "is_admin", "is_restricted", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_rep
os", "num_teams", "num_members", "visibility", "repo_admin_change_team_access", "diff_view_style", "theme", "keep_activity_private" FROM "user" WHERE "id"=$1 LIMIT 1 [1] - 912.894µs
2022/04/27 15:02:50 ...s/issue_stopwatch.go:103:hasUserStopwatch() [I] [SQL] SELECT "id", "issue_id", "user_id", "created_unix" FROM "stopwatch" WHERE (user_id = $1) LIMIT 1 [1] - 477.422µs
2022/04/27 15:02:52 ...dels/notification.go:764:GetUIDsAndNotificationCounts() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= $1 AND updated_
unix < $2) AND status = $3 GROUP BY user_id [1651064560 1651064570 1] - 1.111687ms

I checked the forum and saw several entries about 500 error but these I checked did not provide a solution.

Someone please can check this or advise.

Best regards

–Christian

Hello community,

this is solved via GitHub.
I had tried GitLab before Gitea. There was some bad stuff inside the directory from the git user. After new installation of the git package it was running as expected :grinning:

How can I mark this thread to solved?

Best regards

–Christian

1 Like

There is no better way to do it than what you just did :slight_smile: