Skip to content

API : teams query #1809

Closed
Closed
@camlafit

Description

@camlafit
  • Gitea version (or commit ref): master and 1.1.1
  • Git version:
  • Operating system: Debian Jessie
  • 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

Following url provided by api/v1/api.go, I've try to get teams informations and set members to team.
I've tried with 1.1.1 and master version on 386 arch

Query tested :

curl -H 'Authorization: token $TOKEN' -X GET "https://$GITEA_SERVER/api/v1/teams/"
curl -H 'Authorization: token $TOKEN' -X GET "https://$GITEA_SERVER/api/v1/teams/3"
curl -H 'Authorization: token $TOKEN' -X PUT "https://$GITEA_SERVER/api/v1/teams/3/members/$USERNAME"

1/ With first query log shown :

[Macaron] 2017-05-25 08:49:58: Started GET /api/v1/teams for 88.190.92.83
[Macaron] 2017-05-25 08:49:58: Completed /api/v1/teams 404 Not Found in 10.363091ms

Looks logical any endpoint looks defined, but get all teams should be a plus

2/ With second query log shown :

[Macaron] 2017-05-25 08:49:35: Started GET /api/v1/teams/3/ for IP
[Macaron] PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:489 (0x433c0f)
        gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/local/go/src/runtime/panic.go:63 (0x432abe)
        panicmem: panic(memoryError)
/usr/local/go/src/runtime/signal_unix.go:290 (0x44928f)
        sigpanic: panicmem()
/root/GO/src/code.gitea.io/gitea/routers/api/v1/api.go:155 (0x10616aa)
/usr/local/go/src/runtime/asm_amd64.s:514 (0x460ca8)
        call32: CALLFN(·call32, 32)
/usr/local/go/src/reflect/value.go:434 (0x4c344f)
        Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/local/go/src/reflect/value.go:302 (0x4c2a14)
        Value.Call: return v.call("Call", in)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x85dfdf)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x85d9aa)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x88aca2)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x88abc6)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/session/session.go:186 (0x8e2300)
/usr/local/go/src/runtime/asm_amd64.s:514 (0x460ca8)
        call32: CALLFN(·call32, 32)
/usr/local/go/src/reflect/value.go:434 (0x4c344f)
        Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/local/go/src/reflect/value.go:302 (0x4c2a14)
        Value.Call: return v.call("Call", in)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x85dfdf)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x85d9aa)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x88aca2)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x88abc6)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/recovery.go:161 (0x89dd2b)
/usr/local/go/src/runtime/asm_amd64.s:514 (0x460ca8)
        call32: CALLFN(·call32, 32)
/usr/local/go/src/reflect/value.go:434 (0x4c344f)
        Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/local/go/src/reflect/value.go:302 (0x4c2a14)
        Value.Call: return v.call("Call", in)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x85dfdf)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x85d9aa)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x88aca2)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:104 (0x88abc6)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/logger.go:43 (0x89cfe4)
/usr/local/go/src/runtime/asm_amd64.s:514 (0x460ca8)
        call32: CALLFN(·call32, 32)
/usr/local/go/src/reflect/value.go:434 (0x4c344f)
        Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/local/go/src/reflect/value.go:302 (0x4c2a14)
        Value.Call: return v.call("Call", in)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:177 (0x85dfdf)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/go-macaron/inject/inject.go:137 (0x85d9aa)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/context.go:113 (0x88aca2)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:184 (0x89eff9)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/router.go:288 (0x8970dd)
/root/GO/src/code.gitea.io/gitea/vendor/gopkg.in/macaron.v1/macaron.go:177 (0x88f10c)
/root/GO/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0xaca22b)
/usr/local/go/src/net/http/server.go:1942 (0x6dba34)
        HandlerFunc.ServeHTTP: f(w, r)
/usr/local/go/src/net/http/server.go:2568 (0x6de2f2)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/local/go/src/net/http/server.go:1825 (0x6da5a2)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/local/go/src/runtime/asm_amd64.s:2197 (0x463461)
        goexit: BYTE    $0x90   // NOP
[Macaron] 2017-05-25 08:51:48: Completed /api/v1/teams/3 500 Internal Server Error in 23.696434ms

3/ With third query

[Macaron] 2017-05-25 08:53:17: Started GET /api/v1/teams/3/members/$USERNAME for IP
[Macaron] 2017-05-25 08:53:17: Completed /api/v1/teams/3/members/$USERNAME 404 Not Found in 11.908173ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions