release find by tag returns 500 error #6705

Closed
opened 2025-11-02 07:04:18 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @cameronbraid on GitHub (Jan 17, 2021).

git server version 1.13.1

When using the Get a release by tag name api call a 500 error is returned for a tag_name after git tag has been done but a release has not been created. The response is

{
"message": "user does not exist [uid: 0, name: , keyid: 0]",
"url": "https://git-dev.drivenow.com.au/api/swagger"
}

I suspect the cause is because there exists a record in the release table with the publisher_id=0

Originally created by @cameronbraid on GitHub (Jan 17, 2021). git server version 1.13.1 When using the `Get a release by tag name` api call a 500 error is returned for a tag_name after `git tag` has been done but a release has not been created. The response is { "message": "user does not exist [uid: 0, name: , keyid: 0]", "url": "https://git-dev.drivenow.com.au/api/swagger" } I suspect the cause is because there exists a record in the release table with the publisher_id=0
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 07:04:18 -06:00
Author
Owner

@noerw commented on GitHub (Jan 17, 2021):

Can't reproduce this on try.gitea.io.
Please provide a way to reproduce the issue, otherwise we can't debug this.

@noerw commented on GitHub (Jan 17, 2021): Can't reproduce this on try.gitea.io. Please provide a way to reproduce the issue, otherwise we can't debug this.
Author
Owner

@zeripath commented on GitHub (Jan 17, 2021):

Or at least give us some logs from the gitea instance.

@zeripath commented on GitHub (Jan 17, 2021): Or at least give us some logs from the gitea instance.
Author
Owner

@cameronbraid commented on GitHub (Jan 18, 2021):

I am using sqlite as database

the logs dont show anything more.. just the same user does not exist for id 0 - since the release.publisher_id col contains a 0 value

2021/01/17 13:00:38 ...repo/release_tags.go:56:GetReleaseTag() [E] LoadAttributes: user does not exist [uid: 0, name: , keyid: 0]

2021/01/17 13:00:38 Completed GET /api/v1/repos/drivenow/frontend/releases/tags/v8.0.13 500 Internal Server Error in 62.717056ms
@cameronbraid commented on GitHub (Jan 18, 2021): I am using sqlite as database the logs dont show anything more.. just the same user does not exist for id 0 - since the release.publisher_id col contains a 0 value ``` 2021/01/17 13:00:38 ...repo/release_tags.go:56:GetReleaseTag() [E] LoadAttributes: user does not exist [uid: 0, name: , keyid: 0] 2021/01/17 13:00:38 Completed GET /api/v1/repos/drivenow/frontend/releases/tags/v8.0.13 500 Internal Server Error in 62.717056ms ```
Author
Owner

@cameronbraid commented on GitHub (Jan 18, 2021):

Looks like try.gitea.io uses master as it has this code in there :

func (r *Release) loadAttributes(e Engine) error {
	var err error
	if r.Repo == nil {
		r.Repo, err = GetRepositoryByID(r.RepoID)
		if err != nil {
			return err
		}
	}
	if r.Publisher == nil {
		r.Publisher, err = getUserByID(e, r.PublisherID)
		if err != nil {
			if IsErrUserNotExist(err) {
				r.Publisher = NewGhostUser()
			} else {
				return err
			}
		}
	}
	return getReleaseAttachments(e, r)
}

where as v1.13.1 is missing the IsErrUserNotExist test

@cameronbraid commented on GitHub (Jan 18, 2021): Looks like try.gitea.io uses master as it has this code in there : ``` func (r *Release) loadAttributes(e Engine) error { var err error if r.Repo == nil { r.Repo, err = GetRepositoryByID(r.RepoID) if err != nil { return err } } if r.Publisher == nil { r.Publisher, err = getUserByID(e, r.PublisherID) if err != nil { if IsErrUserNotExist(err) { r.Publisher = NewGhostUser() } else { return err } } } return getReleaseAttachments(e, r) } ``` where as v1.13.1 is missing the `IsErrUserNotExist` test
Author
Owner

@noerw commented on GitHub (Jan 18, 2021):

Thanks, good hint!
Looks like #12096 did a bugfix within a feature PR :| Will backport that to 1.13.2

@noerw commented on GitHub (Jan 18, 2021): Thanks, good hint! Looks like #12096 did a bugfix within a feature PR :| Will backport that to 1.13.2
Author
Owner

@6543 commented on GitHub (Jan 18, 2021):

closed by #14375

@6543 commented on GitHub (Jan 18, 2021): closed by #14375
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6705