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

echobot example has problems #69

Open
XANi opened this issue Oct 5, 2022 · 1 comment
Open

echobot example has problems #69

XANi opened this issue Oct 5, 2022 · 1 comment

Comments

@XANi
Copy link

XANi commented Oct 5, 2022

I ran near-unchanged (changed port to 8080) echobot from samples directory and got nil panic:

Starting server on port:8080...
2022/10/05 19:38:27 http: panic serving 10.100.199.14:11078: runtime error: invalid memory address or nil pointer dereference
goroutine 18 [running]:
net/http.(*conn).serve.func1()
	/usr/lib/go-1.18/src/net/http/server.go:1825 +0xbf
panic({0x6e4640, 0x962d50})
	/usr/lib/go-1.18/src/runtime/panic.go:844 +0x258
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).getToken(0xc00010c000, {0x7b8b80, 0xc0000a8000})
	/tmp/msbotbuilder-go/connector/client/client.go:178 +0x9c9
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).sendRequest(_, _, {{0x730559, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...})
	/tmp/msbotbuilder-go/connector/client/client.go:116 +0x55
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).Post(_, {_, _}, {{0xc0000a66f0, 0x5}, {0x0, 0x0}, 0x0, {0xc0000a66f8, 0x17}, ...}, ...)
	/tmp/msbotbuilder-go/connector/client/client.go:84 +0x19b
github.com/infracloudio/msbotbuilder-go/core/activity.(*DefaultResponse).SendActivity(_, {_, _}, {{0x730559, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, ...})
	/tmp/msbotbuilder-go/core/activity/response.go:84 +0x2cd
github.com/infracloudio/msbotbuilder-go/core.(*BotFrameworkAdapter).ProcessActivity(_, {_, _}, {{0xc0000a9950, 0x7}, {0xc0000a99a3, 0xd}, {0x1cd06634, 0xedacfb812, 0x0}, ...}, ...)
	/tmp/msbotbuilder-go/core/bot_framework_adapter.go:115 +0x1b9
main.(*HTTPHandler).processMessage(0xc00009ed20, {0x7b8968, 0xc00010c1c0}, 0x4cef69?)
	/tmp/msbotbuilder-go/samples/echobot/main.go:36 +0x20d
net/http.HandlerFunc.ServeHTTP(0x6d3660?, {0x7b8968?, 0xc00010c1c0?}, 0xc00012c080?)
	/usr/lib/go-1.18/src/net/http/server.go:2084 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0?, {0x7b8968, 0xc00010c1c0}, 0xc00012a000)
	/usr/lib/go-1.18/src/net/http/server.go:2462 +0x149
net/http.serverHandler.ServeHTTP({0x7b7b20?}, {0x7b8968, 0xc00010c1c0}, 0xc00012a000)
	/usr/lib/go-1.18/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc0000bcb40, {0x7b8bf0, 0xc0000a3230})
	/usr/lib/go-1.18/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/lib/go-1.18/src/net/http/server.go:3071 +0x4db
2022/10/05 19:38:28 http: panic serving 10.100.199.12:50088: runtime error: invalid memory address or nil pointer dereference
goroutine 26 [running]:
net/http.(*conn).serve.func1()
	/usr/lib/go-1.18/src/net/http/server.go:1825 +0xbf
panic({0x6e4640, 0x962d50})
	/usr/lib/go-1.18/src/runtime/panic.go:844 +0x258
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).getToken(0xc00010c000, {0x7b8b80, 0xc0000a8000})
	/tmp/msbotbuilder-go/connector/client/client.go:178 +0x9c9
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).sendRequest(_, _, {{0x730559, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...})
	/tmp/msbotbuilder-go/connector/client/client.go:116 +0x55
github.com/infracloudio/msbotbuilder-go/connector/client.(*ConnectorClient).Post(_, {_, _}, {{0xc0005c8180, 0x5}, {0x0, 0x0}, 0x0, {0xc0005c8188, 0x17}, ...}, ...)
	/tmp/msbotbuilder-go/connector/client/client.go:84 +0x19b
github.com/infracloudio/msbotbuilder-go/core/activity.(*DefaultResponse).SendActivity(_, {_, _}, {{0x730559, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, ...})
	/tmp/msbotbuilder-go/core/activity/response.go:84 +0x2cd
github.com/infracloudio/msbotbuilder-go/core.(*BotFrameworkAdapter).ProcessActivity(_, {_, _}, {{0xc0003301d0, 0x7}, {0xc0003301e0, 0xd}, {0x1cd06634, 0xedacfb812, 0x0}, ...}, ...)
	/tmp/msbotbuilder-go/core/bot_framework_adapter.go:115 +0x1b9
main.(*HTTPHandler).processMessage(0xc00009ed20, {0x7b8968, 0xc00010c2a0}, 0xc000204100?)
	/tmp/msbotbuilder-go/samples/echobot/main.go:36 +0x20d
net/http.HandlerFunc.ServeHTTP(0x0?, {0x7b8968?, 0xc00010c2a0?}, 0xc00012c0c0?)
	/usr/lib/go-1.18/src/net/http/server.go:2084 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0?, {0x7b8968, 0xc00010c2a0}, 0xc000204100)
	/usr/lib/go-1.18/src/net/http/server.go:2462 +0x149
net/http.serverHandler.ServeHTTP({0x7b7b20?}, {0x7b8968, 0xc00010c2a0}, 0xc000204100)
	/usr/lib/go-1.18/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc0000bcd20, {0x7b8bf0, 0xc0000a3230})
	/usr/lib/go-1.18/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/lib/go-1.18/src/net/http/server.go:3071 +0x4db

I've captured the request

POST /api/messages HTTP/1.1
authorization: Bearer <redacted>
x-ms-conversation-id: <redacted>
x-ms-tenant-id: <redacted>
user-agent: Microsoft-SkypeBotApi (Microsoft-BotFramework/3.0)
ms-cv: <redacted>
content-type: application/json; charset=utf-8
host: <redacted>
content-length: 1055
x-forwarded-proto: https
x-forwarded-for: 52.113.205.15
connection: close

{"text":"testbot ","textFormat":"plain","attachments":[{"contentType":"text/html","content":"<p>testbot </p>"}],"type":"message","timestamp":"2022-10-05T17:40:48.2890875Z","localTimestamp":"2022-10-05T19:40:48.2890875+02:00","id":"1664991648254","channelId":"msteams","serviceUrl":"https://smba.trafficmanager.net/emea/","from":{"id":"29:17Tq-xb-FxJqethEHuG1XHhISPVERKQZO9AfLaR8tKckt1f1Lmfv1rkFr6LRO2Ok9NQyVsvmseJTQE2UsKnVnVw","name":"<redacted>","aadObjectId":"<redacted>"},"conversation":{"conversationType":"personal","tenantId":"<redacted>","id":"a:1Wa3YlVHUQoiefkiY_LBvhvffdgm1qBVPPvlakMDeWY031MShWvqA4XpXMaJijhzoSWfwQr5jx04CYptl2lhNtLelbIzV4Py7AIGwCkANBrtrjHHonC_hYp8fZijny6Kj"},"recipient":{"id":"28:7d7fb618-9d5c-4c42-b4e7-95030b5fb9e9","name":"testbot"},"entities":[{"locale":"en-US","country":"US","platform":"Web","timezone":"Europe/Warsaw","type":"clientInfo"}],"channelData":{"tenant":{"id":"<redacted>"}},"locale":"en-US","localTimezone":"Europe/Warsaw"}

but it looks just fine...

@smlsr
Copy link

smlsr commented Feb 9, 2024

I am seeing the same thing - anyone have a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants