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

Reject invite via /leave API panics on Pinecone #3490

Open
t3chguy opened this issue Jan 7, 2025 · 3 comments
Open

Reject invite via /leave API panics on Pinecone #3490

t3chguy opened this issue Jan 7, 2025 · 3 comments
Labels
good first issue Good for newcomers T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@t3chguy
Copy link
Member

t3chguy commented Jan 7, 2025

Background information

  • Dendrite version or git SHA: dendrite-demo-pinecone:main
  • SQLite3 or Postgres?: sqlite3
  • Running in Docker?: yes
  • go version: dendrite-demo-pinecone:main
  • Client used (if applicable): element-web

Description

  • What is the problem: Unclear
  • Who is affected: Users trying to reject invites seemingly
  • How is this bug manifesting: goroutine panic
  • When did this first appear: Unclear

Steps to reproduce

  • reject invite
  • check logs to find
time="2025-01-07T17:28:54Z" level=error msg="Request panicked!\ngoroutine 527 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x5e\ngithub.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.Protect.func3.1()\n\tgithub.com/matrix-org/[email protected]/json.go:98 +0x13c\npanic({0x17856c0?, 0x27ba6e0?})\n\truntime/panic.go:770 +0x132\ngithub.com/element-hq/dendrite/internal/httputil.MakeAuthAPI.func1.1()\n\tgithub.com/element-hq/dendrite/internal/httputil/httpapi.go:94 +0x4a\npanic({0x17856c0?, 0x27ba6e0?})\n\truntime/panic.go:770 +0x132\ngithub.com/element-hq/dendrite/roomserver/internal/perform.(*Leaver).performLeaveRoomByID(0xc0035742d0, {0x1c9dec0, 0x2903ee0}, 0xc0065203c0, 0xc006516408)\n\tgithub.com/element-hq/dendrite/roomserver/internal/perform/perform_leave.go:106 +0x545\ngithub.com/element-hq/dendrite/roomserver/internal/perform.(*Leaver).PerformLeave(0xc0035742d0, {0x1c9e0f0, 0xc006515d70}, 0xc0065203c0, 0xc006516408)\n\tgithub.com/element-hq/dendrite/roomserver/internal/perform/perform_leave.go:57 +0x305\ngithub.com/element-hq/dendrite/roomserver/internal.(*RoomserverInternalAPI).PerformLeave(0xc0036d0580, {0x1c9e0f0?, 0xc006515d70?}, 0xc0065203c0, 0xc005edf2a0?)\n\tgithub.com/element-hq/dendrite/roomserver/internal/api.go:263 +0x32\ngithub.com/element-hq/dendrite/clientapi/routing.LeaveRoomByID(0xc006519560, 0xc006515da0?, {0x7f1084151518, 0xc0036d0580}, {0xc00651d0e0, 0x52})\n\tgithub.com/element-hq/dendrite/clientapi/routing/leaveroom.go:40 +0x1a8\ngithub.com/element-hq/dendrite/clientapi/routing.Setup.func21(0xc006519560, 0xc006513b90)\n\tgithub.com/element-hq/dendrite/clientapi/routing/routing.go:383 +0xd7\ngithub.com/element-hq/dendrite/internal/httputil.MakeAuthAPI.func1(0xc006519320)\n\tgithub.com/element-hq/dendrite/internal/httputil/httpapi.go:111 +0x5a3\ngithub.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest(0xc0065190e0?, 0x2903ee0?)\n\tgithub.com/matrix-org/[email protected]/json.go:79 +0x19\ngithub.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.func2({0x1c9b3b0, 0xc00534ea80}, 0x0?)\n\tgithub.com/matrix-org/[email protected]/json.go:141 +0xaa\ngithub.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.Protect.func3({0x1c9b3b0?, 0xc00534ea80?}, 0x19ca84c?)\n\tgithub.com/matrix-org/[email protected]/json.go:103 +0x63\nnet/http.HandlerFunc.ServeHTTP(...)\n\tnet/http/server.go:2171\ngithub.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.func1({0x1c9b3b0?, 0xc00534ea80?}, 0xc006518fc0)\n\tgithub.com/element-hq/dendrite/internal/httputil/httpapi.go:194 +0x3e9\nnet/http.HandlerFunc.ServeHTTP(0xc006518ea0?, {0x1c9b3b0?, 0xc00534ea80?}, 0x4145fb?)\n\tnet/http/server.go:2171 +0x29\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0xc000000780, {0x1c9b3b0, 0xc00534ea80}, 0xc006518c60)\n\tgithub.com/gorilla/[email protected]/mux.go:210 +0x1e2\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0xc0036472c0, {0x1c9b3b0, 0xc00534ea80}, 0xc006518900)\n\tgithub.com/gorilla/[email protected]/mux.go:210 +0x1e2\nnet/http.serverHandler.ServeHTTP({0x1c97800?}, {0x1c9b3b0?, 0xc00534ea80?}, 0x6?)\n\tnet/http/server.go:3142 +0x8e\nnet/http.(*conn).serve(0xc00416bcb0, {0x1c9e0f0, 0xc003ac7b30})\n\tnet/http/server.go:2044 +0x5e8\ncreated by net/http.(*Server).Serve in goroutine 378\n\tnet/http/server.go:3290 +0x4b4\n" context=missing panic="runtime error: invalid memory address or nil pointer dereference"

trace (2).zip

@S7evinK S7evinK added bug Something isn't working good first issue Good for newcomers T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. and removed bug Something isn't working labels Jan 16, 2025
@TruncatedDinoSour
Copy link

Formatted error:

Request panicked!
goroutine 527 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x5e
github.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.Protect.func3.1()
        github.com/matrix-org/[email protected]/json.go:98 +0x13c
panic({0x17856c0?, 0x27ba6e0?})
        runtime/panic.go:770 +0x132
github.com/element-hq/dendrite/internal/httputil.MakeAuthAPI.func1.1()
        github.com/element-hq/dendrite/internal/httputil/httpapi.go:94 +0x4a
panic({0x17856c0?, 0x27ba6e0?})
        runtime/panic.go:770 +0x132
github.com/element-hq/dendrite/roomserver/internal/perform.(*Leaver).performLeaveRoomByID(0xc0035742d0, {0x1c9dec0, 0x2903ee0}, 0xc0065203c0, 0xc006516408)
        github.com/element-hq/dendrite/roomserver/internal/perform/perform_leave.go:106 +0x545
github.com/element-hq/dendrite/roomserver/internal/perform.(*Leaver).PerformLeave(0xc0035742d0, {0x1c9e0f0, 0xc006515d70}, 0xc0065203c0, 0xc006516408)
        github.com/element-hq/dendrite/roomserver/internal/perform/perform_leave.go:57 +0x305
github.com/element-hq/dendrite/roomserver/internal.(*RoomserverInternalAPI).PerformLeave(0xc0036d0580, {0x1c9e0f0?, 0xc006515d70?}, 0xc0065203c0, 0xc005edf2a0?)
        github.com/element-hq/dendrite/roomserver/internal/api.go:263 +0x32
github.com/element-hq/dendrite/clientapi/routing.LeaveRoomByID(0xc006519560, 0xc006515da0?, {0x7f1084151518, 0xc0036d0580}, {0xc00651d0e0, 0x52})
        github.com/element-hq/dendrite/clientapi/routing/leaveroom.go:40 +0x1a8
github.com/element-hq/dendrite/clientapi/routing.Setup.func21(0xc006519560, 0xc006513b90)
        github.com/element-hq/dendrite/clientapi/routing/routing.go:383 +0xd7
github.com/element-hq/dendrite/internal/httputil.MakeAuthAPI.func1(0xc006519320)
        github.com/element-hq/dendrite/internal/httputil/httpapi.go:111 +0x5a3
github.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest(0xc0065190e0?, 0x2903ee0?)
        github.com/matrix-org/[email protected]/json.go:79 +0x19
github.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.func2({0x1c9b3b0, 0xc00534ea80}, 0x0?)
        github.com/matrix-org/[email protected]/json.go:141 +0xaa
github.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.MakeJSONAPI.Protect.func3({0x1c9b3b0?, 0xc00534ea80?}, 0x19ca84c?)
        github.com/matrix-org/[email protected]/json.go:103 +0x63
net/http.HandlerFunc.ServeHTTP(...)
        net/http/server.go:2171
github.com/element-hq/dendrite/internal/httputil.MakeExternalAPI.func1({0x1c9b3b0?, 0xc00534ea80?}, 0xc006518fc0)
        github.com/element-hq/dendrite/internal/httputil/httpapi.go:194 +0x3e9
net/http.HandlerFunc.ServeHTTP(0xc006518ea0?, {0x1c9b3b0?, 0xc00534ea80?}, 0x4145fb?)
        net/http/server.go:2171 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000000780, {0x1c9b3b0, 0xc00534ea80}, 0xc006518c60)
        github.com/gorilla/[email protected]/mux.go:210 +0x1e2
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0036472c0, {0x1c9b3b0, 0xc00534ea80}, 0xc006518900)
        github.com/gorilla/[email protected]/mux.go:210 +0x1e2
net/http.serverHandler.ServeHTTP({0x1c97800?}, {0x1c9b3b0?, 0xc00534ea80?}, 0x6?)
        net/http/server.go:3142 +0x8e
net/http.(*conn).serve(0xc00416bcb0, {0x1c9e0f0, 0xc003ac7b30})
        net/http/server.go:2044 +0x5e8
created by net/http.(*Server).Serve in goroutine 378
        net/http/server.go:3290 +0x4b4

runtime error: invalid memory address or nil pointer dereference

This error seems similar to the one in #3502 - maybe this is an issue related to the library?

@S7evinK
Copy link
Contributor

S7evinK commented Jan 18, 2025

The problem here is that we forgot to set the userAPI for the rsAPI after this line https://github.com/element-hq/dendrite/blob/main/cmd/dendrite-demo-pinecone/monolith/monolith.go#L140

Basically a one line fix.

@TruncatedDinoSour
Copy link

Ah lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

3 participants