Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating release via API Endpoint resulting in internal server Error #3005

Closed
2 of 7 tasks
SnowMB opened this issue Nov 27, 2017 · 0 comments · Fixed by #3012
Closed
2 of 7 tasks

Creating release via API Endpoint resulting in internal server Error #3005

SnowMB opened this issue Nov 27, 2017 · 0 comments · Fixed by #3012
Labels
modifies/api This PR adds API routes or modifies them type/bug
Milestone

Comments

@SnowMB
Copy link
Contributor

SnowMB commented Nov 27, 2017

  • Gitea version (or commit ref): 1.3.0-rc2
  • 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

Hey, can someone help me out? I try to use the api to create a release. I get no reply, but the server log shows me an internal server error.

curl -X POST "https://SERVER/api/v1/repos/USER/REPO/releases" -H "Content-Type: application/json"  -H "Authorization: token TOKEN" -d "{ \"body\": \"test\", \"draft\": false, \"name\": \"test\", \"prerelease\" : false, \"tag_name\": \"v2.1.1\", \"target_commitish\": \"f34f281e6045a20cd79f85d31a585bd40cbe473d\"}"

Obfuscated SERVER, USER, REPO, TOKEN.

This is the log:

2017-11-27T17:03:01.137374967Z [Macaron] 2017-11-27 17:03:01: Started POST /api/v1/repos/USER/REPO/releases for 172.18.0.1
2017-11-27T17:03:01.800166648Z [Macaron] PANIC: runtime error: invalid memory address or nil pointer dereference
2017-11-27T17:03:01.800205336Z /usr/lib/go/src/runtime/panic.go:491 (0x55bda72acf86)
2017-11-27T17:03:01.800215354Z /usr/lib/go/src/runtime/panic.go:63 (0x55bda72abe5f)
2017-11-27T17:03:01.800279081Z /usr/lib/go/src/runtime/signal_unix.go:367 (0x55bda72c47af)
2017-11-27T17:03:01.800289125Z /srv/app/src/code.gitea.io/gitea/vendor/code.gitea.io/git/repo_tag.go:23 (0x55bda75a77d4)
2017-11-27T17:03:01.800296677Z /srv/app/src/code.gitea.io/gitea/routers/api/v1/repo/release.go:128 (0x55bda7efa52c)
2017-11-27T17:03:01.800304168Z /usr/lib/go/src/runtime/asm_amd64.s:511 (0x55bda72dc9b3)
2017-11-27T17:03:01.800517981Z /usr/lib/go/src/reflect/value.go:434 (0x55bda7346466)
2017-11-27T17:03:01.800525379Z /usr/lib/go/src/reflect/value.go:302 (0x55bda7345a25)
2017-11-27T17:03:01.800531154Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x55bda7662f4a)
2017-11-27T17:03:01.800537039Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x55bda766283b)
2017-11-27T17:03:01.800543141Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x55bda7690b7f)
2017-11-27T17:03:01.800584809Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x55bda7690ab7)
2017-11-27T17:03:01.800593886Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:186 (0x55bda76e81f8)
2017-11-27T17:03:01.800612785Z /usr/lib/go/src/runtime/asm_amd64.s:509 (0x55bda72dc89c)
2017-11-27T17:03:01.800620445Z /usr/lib/go/src/reflect/value.go:434 (0x55bda7346466)
2017-11-27T17:03:01.800626154Z /usr/lib/go/src/reflect/value.go:302 (0x55bda7345a25)
2017-11-27T17:03:01.800792497Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x55bda7662f4a)
2017-11-27T17:03:01.800835961Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x55bda766283b)
2017-11-27T17:03:01.800844438Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x55bda7690b7f)
2017-11-27T17:03:01.800850411Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x55bda7690ab7)
2017-11-27T17:03:01.800856194Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/recovery.go:161 (0x55bda76a378c)
2017-11-27T17:03:01.800861874Z /usr/lib/go/src/runtime/asm_amd64.s:509 (0x55bda72dc89c)
2017-11-27T17:03:01.800867354Z /usr/lib/go/src/reflect/value.go:434 (0x55bda7346466)
2017-11-27T17:03:01.800872888Z /usr/lib/go/src/reflect/value.go:302 (0x55bda7345a25)
2017-11-27T17:03:01.801022591Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x55bda7662f4a)
2017-11-27T17:03:01.801032071Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x55bda766283b)
2017-11-27T17:03:01.801038126Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x55bda7690b7f)
2017-11-27T17:03:01.801076954Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x55bda7690ab7)
2017-11-27T17:03:01.801085176Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/logger.go:43 (0x55bda76a2a5d)
2017-11-27T17:03:01.801092394Z /usr/lib/go/src/runtime/asm_amd64.s:509 (0x55bda72dc89c)
2017-11-27T17:03:01.801098348Z /usr/lib/go/src/reflect/value.go:434 (0x55bda7346466)
2017-11-27T17:03:01.801103816Z /usr/lib/go/src/reflect/value.go:302 (0x55bda7345a25)
2017-11-27T17:03:01.801109404Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x55bda7662f4a)
2017-11-27T17:03:01.801115014Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x55bda766283b)
2017-11-27T17:03:01.801120576Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x55bda7690b7f)
2017-11-27T17:03:01.801306984Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:184 (0x55bda76a4a74)
2017-11-27T17:03:01.801315628Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:288 (0x55bda769ccbd)
2017-11-27T17:03:01.801321300Z /srv/app/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/macaron.go:177 (0x55bda7694d89)
2017-11-27T17:03:01.801327820Z /srv/app/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0x55bda796843c)
2017-11-27T17:03:01.801334688Z /usr/lib/go/src/net/http/server.go:1918 (0x55bda7558cf5)
2017-11-27T17:03:01.801348651Z /usr/lib/go/src/net/http/server.go:2619 (0x55bda755ba15)
2017-11-27T17:03:01.801354840Z /usr/lib/go/src/net/http/server.go:1801 (0x55bda7557bae)
2017-11-27T17:03:01.801360509Z /usr/lib/go/src/runtime/asm_amd64.s:2337 (0x55bda72df140)
2017-11-27T17:03:01.801365924Z [Macaron] 2017-11-27 17:03:01: Completed /api/v1/repos/USER/REPO/releases 500 Internal Server Error in 662.850942ms

Screenshots

@lunny lunny added modifies/api This PR adds API routes or modifies them type/bug labels Nov 28, 2017
@lafriks lafriks added this to the 1.4.0 milestone Jan 15, 2018
lafriks pushed a commit that referenced this issue Jan 16, 2018
* Fixes API-Endpoint release (#3005)

* Using context.ReferencesGitRepo(); doing the same in the PATCH route.

* Add release create, get and update test
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants