gogs icon indicating copy to clipboard operation
gogs copied to clipboard

500 error on creating pull request

Open akademic opened this issue 10 years ago • 8 comments

  • Gogs version (or commit ref): 0.9.46.0717
  • Git version: 2.8.1
  • Operating system: debian jessie
  • Database: Sqlite
  • Can you reproduce the bug at http://try.gogs.io: No
  • Log gist: https://gist.github.com/akademic/afef02f8954f9b210d1e7146f8fb5480

Description

Steps for reproduction:

  1. user1 create repo1 with commits
  2. user2 forks user1/repo1 as user2/repo1
  3. user2 adds new commit to user2/repo2 and push it
  4. user2 clicks on Create Pull Request
  5. See 500 error

akademic avatar Jul 20 '16 08:07 akademic

I got the same behavior on all my repos when trying create issues (have not tried pull request yet): [E] NewIssue: newIssue: GetRepositoryByID: repository does not exist

I don't know what update broke this but it worked a week ago.

I'm using the gogs docker image.

cmtec avatar Jul 20 '16 16:07 cmtec

Having the same problem (a 500) when creating new issues on Debian Jessie (edit: and sqlite). Version 0.9.46 here, aka 1c7dcdd6b948b9c177b5ed4e036e612508ee9832.

[...outers/repo/issue.go:435 NewIssuePost()] [E] NewIssue: newIssue: GetRepositoryByID: repository does not exist [id: 14, uid: 0, name: ]

If I get a moment, I'll try to reproduce it against HEAD.

ausbin avatar Jul 20 '16 18:07 ausbin

I bisected, and f1b8d52eb3ac230ed5a275f4a844ddb0cf48041e appears to be the offending commit.

ausbin avatar Jul 20 '16 18:07 ausbin

Aha!

I think I fixed it. I just created #3297; I'd appreciate some feedback.

Seems like the SQLite driver for xorm can't retrieve data once an update occurs. A comment in issue.go says as much, at least:

// During the session, SQLite3 dirver cannot handle retrieve objects after update something.
// So we have to get all needed labels first.

ausbin avatar Jul 20 '16 20:07 ausbin

Patch has pushed to fix this issue, please test on master branch or https://try.gogs.io.

unknwon avatar Jul 21 '16 06:07 unknwon

Testing on c2fb01a257cfcddf5dc279fcd66175280778f7a9 just now Works fine!

akademic avatar Jul 21 '16 07:07 akademic

Works on latest gogs docker (0.9.47.0721)!

cmtec avatar Jul 21 '16 08:07 cmtec

For anyone blocking on this, I'll have a new revision release ASAP.

unknwon avatar Jul 22 '16 13:07 unknwon