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

/v3/service_discovery/consul PUT panicmem #349

Open
cervajs opened this issue Nov 21, 2024 · 3 comments
Open

/v3/service_discovery/consul PUT panicmem #349

cervajs opened this issue Nov 21, 2024 · 3 comments

Comments

@cervajs
Copy link

cervajs commented Nov 21, 2024

rocky 9.5
haproxy 3.0.5
dataplaneapi 3.0.3 (from rpm, run from systemd unit)
selinux enabled

[root@lb ~]# curl -s -u admin:admin http://localhost:5555/v3/service_discovery/consul | jq
[
{
"address": "consul-1.example.net",
"enabled": true,
"id": "9c720cd0-021d-4a3d-b229-d1bc32509628",
"port": 8500,
"retry_timeout": 10,
"server_slots_base": 10,
"server_slots_growth_increment": 10,
"server_slots_growth_type": "linear",
"service_allowlist": [
"app1"
]
}
]

curl -X PUT
-u admin:admin
-H 'Content-Type: application/json'
-d '{
"id": "9c720cd0-021d-4a3d-b229-d1bc32509628",
"address": "consul-1.example.net",
"enabled": true,
"port": 8500,
"retry_timeout": 10,
"service_allowlist": ["my-consul-service"]
}' http://localhost:5555/v3/service_discovery/consul/9c720cd0-021d-4a3d-b229-d1bc32509628

{"code":500,"message":"runtime error: invalid memory address or nil pointer dereference: /opt/hostedtoolcache/go/1.23.2/x64/src/runtime/panic.go:261 panicmem"}

replicated: always

@mjuraga
Copy link
Collaborator

mjuraga commented Nov 22, 2024

Hi Marek, can you please paste the logs with the full stack trace to the panic if possible. Thank you,

@cervajs
Copy link
Author

cervajs commented Nov 22, 2024

this one?
from /var/log/dataplaneapi.log

time="2024-11-22T09:21:24Z" level=info msg="[::1] - - [22/Nov/2024:09:21:24 +0000] "PUT /v3/service_discovery/consul/9c720cd0-021d-4a3d-b229-d1bc32509628 HTTP/1.1" 200 - "-" "curl/7.76.1""
time="2024-11-22T09:21:24Z" level=error msg="Panic runtime error: invalid memory address or nil pointer dereference" stack_trace="\n/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/panic.go:261 panicmem\n/home/runner/work/dataplaneapi/dataplaneapi/handlers/consul.go:142 (*ReplaceConsulHandlerImpl).Handle\n/home/runner/work/dataplaneapi/dataplaneapi/operations/service_discovery/replace_consul.go:83 (*ReplaceConsul).ServeHTTP\n/home/runner/go/pkg/mod/github.com/go-openapi/[email protected]/middleware/operation.go:28 (*Context).RoutesHandler.NewOperationExecutor.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/go/pkg/mod/github.com/go-openapi/[email protected]/middleware/router.go:80 NewRouter.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/go/pkg/mod/github.com/go-openapi/[email protected]/middleware/ui_options.go:164 Redoc.serveUI.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/go/pkg/mod/github.com/go-openapi/[email protected]/middleware/spec.go:72 Spec.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/go/pkg/mod/github.com/rs/[email protected]/cors.go:289 (*Cors).Handler-fm.(*Cors).Handler.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/work/dataplaneapi/dataplaneapi/adapters/adapters.go:163 configureAPI.ConfigVersionMiddleware.func16.1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/go/pkg/mod/github.com/lestrrat-go/[email protected]/logformat.go:65 (*ApacheLog).Wrap.func1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/home/runner/work/dataplaneapi/dataplaneapi/adapters/adapters.go:109 configureAPI.RecoverMiddleware.func18.1\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2220 HandlerFunc.ServeHTTP\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:3210 serverHandler.ServeHTTP\n/opt/hostedtoolcache/go/1.23.2/x64/src/net/http/server.go:2092 (*conn).serve\n/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/asm_amd64.s:1700 goexit"

changed log_level to trace in /etc/dataplaneapi/dataplaneapi.yml
log_targets:

  • log_to: file
    log_file: /var/log/dataplaneapi.log
    log_level: trace
    log_types:
    • access
    • app

@mjuraga
Copy link
Collaborator

mjuraga commented Nov 22, 2024

yes, thank you!

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