GetUserRepoPermission: invalid character '&' looking for beginning of value #9422

Closed
opened 2025-11-02 08:38:16 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @safag05 on GitHub (Aug 18, 2022).

Description

We are using helm chart to deploy Gitea. We are trying to migrate our instance from image version 1.14.5 to 1.16.7. After the helm upgrade we received the following error in the logs when trying to access the existing repos. We do not have any issues with the new repos.

GetUserRepoPermission: invalid character '&' looking for beginning of value

Gitea Version

1.16.7

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2022/08/17 22:24:16 ...orm@v1.2.5/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", "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 "owner_id"=$1 AND "lower_name"=$2 LIMIT 1 [1 test-cve] - 1.04514ms 2022/08/17 22:24:16 ...orm@v1.2.5/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 [949 5] - 747.96µs 2022/08/17 22:24:16 ...ls/repo/repo_unit.go:226:getUnitsByRepoID() [I] [SQL] SELECT "id", "repo_id", "type", "config", "created_unix" FROM "repo_unit" WHERE (repo_id = $1) [949] - 666.38µs 2022/08/17 22:24:16 ...ules/context/repo.go:351:repoAssignment() [E] GetUserRepoPermission: invalid character '&' looking for beginning of value 2022/08/17 22:24:16 ...s/context/context.go:204:HTML() [D] Template: status/500

Screenshots

No response

Git Version

2.30.5

Operating System

Kubernetes Pod (Linux)

How are you running Gitea?

Gitea is deployed via helm charts on Kubernetes cluster.

Database

PostgreSQL

Originally created by @safag05 on GitHub (Aug 18, 2022). ### Description We are using helm chart to deploy Gitea. We are trying to migrate our instance from image version 1.14.5 to 1.16.7. After the helm upgrade we received the following error in the logs when trying to access the existing repos. We do not have any issues with the new repos. `GetUserRepoPermission: invalid character '&' looking for beginning of value` ### Gitea Version 1.16.7 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist 2022/08/17 22:24:16 ...orm@v1.2.5/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", "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 "owner_id"=$1 AND "lower_name"=$2 LIMIT 1 [1 test-cve] - 1.04514ms 2022/08/17 22:24:16 ...orm@v1.2.5/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 [949 5] - 747.96µs 2022/08/17 22:24:16 ...ls/repo/repo_unit.go:226:getUnitsByRepoID() [I] [SQL] SELECT "id", "repo_id", "type", "config", "created_unix" FROM "repo_unit" WHERE (repo_id = $1) [949] - 666.38µs 2022/08/17 22:24:16 ...ules/context/repo.go:351:repoAssignment() [E] GetUserRepoPermission: invalid character '&' looking for beginning of value 2022/08/17 22:24:16 ...s/context/context.go:204:HTML() [D] Template: status/500 ### Screenshots _No response_ ### Git Version 2.30.5 ### Operating System Kubernetes Pod (Linux) ### How are you running Gitea? Gitea is deployed via helm charts on Kubernetes cluster. ### Database PostgreSQL
GiteaMirror added the type/bugissue/duplicate labels 2025-11-02 08:38:16 -06:00
Author
Owner

@zeripath commented on GitHub (Aug 18, 2022):

This is #16961. There was a bug in gitea dump from 1.14.3—1.14.6 and 1.15.0.

See https://blog.gitea.io/2021/12/gitea-1.15.8-is-released/ (+ many other blog posts in the 1.15 series.)


⚠️ We remind users that a bug was discovered with gitea dump in 1.14.3–1.14.6 and 1.15.0. Database dumps from these versions cause broken fields in the repo_unit and login_source tables causing the issue identified in #16961. Users on 1.14.x must upgrade to 1.14.7 before running gitea dump. If this is not possible and you are affected #17137 provides a new gitea doctor command to fix the repo_unit issue:

gitea doctor --fix --run fix-broken-repo-units
@zeripath commented on GitHub (Aug 18, 2022): This is #16961. There was a bug in gitea dump from 1.14.3—1.14.6 and 1.15.0. See https://blog.gitea.io/2021/12/gitea-1.15.8-is-released/ (+ many other blog posts in the 1.15 series.) --- :warning: We remind users that a bug was discovered with gitea dump in 1.14.3–1.14.6 and 1.15.0. Database dumps from these versions cause broken fields in the repo_unit and login_source tables causing the issue identified in [#16961](https://github.com/go-gitea/gitea/pull/16961). Users on 1.14.x must upgrade to 1.14.7 before running gitea dump. If this is not possible and you are affected [#17137](https://github.com/go-gitea/gitea/pull/17137) provides a new gitea doctor command to fix the repo_unit issue: ``` gitea doctor --fix --run fix-broken-repo-units ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9422