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

server crashed when parsing ocpp message #313

Open
rocknoo7 opened this issue Nov 27, 2024 · 1 comment
Open

server crashed when parsing ocpp message #313

rocknoo7 opened this issue Nov 27, 2024 · 1 comment

Comments

@rocknoo7
Copy link

rocknoo7 commented Nov 27, 2024

OCPP version:
[x] 1.6
[ ] 2.0.1

I'm submitting a ...

[x] bug report
[ ] feature request

Current behavior:

time="2024-11-27T03:26:16Z" level=error msg="handling failed for e4vnbfn: ocpp message (HhmAgICAb4A=): FormationViolation - parsing time \"\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"2006\""
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbfddf3]

goroutine 9853 [running]:
github.com/lorenzodonini/ocpp-go/ocppj.(*Endpoint).ParseMessage(0xc000425a00, {0xc000b4e1c0, 0x7?, 0x655e5747655e5747?}, {0x1605620?, 0xc000a81f00?})
	/workspace/source/vendor/github.com/lorenzodonini/ocpp-go/ocppj/ocppj.go:418 +0x773
github.com/lorenzodonini/ocpp-go/ocppj.(*Server).ocppMessageHandler(0xc000425a00, {0x1601330, 0xc00086b5c0}, {0xc000dfb600, 0x20, 0x1?})
	/workspace/source/vendor/github.com/lorenzodonini/ocpp-go/ocppj/server.go:221 +0x26c
github.com/lorenzodonini/ocpp-go/ws.(*Server).readPump(0xc0001f45a0, 0xc00086b5c0)
	/workspace/source/vendor/github.com/lorenzodonini/ocpp-go/ws/websocket.go:582 +0x14d
created by github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler
	/workspace/source/vendor/github.com/lorenzodonini/ocpp-go/ws/websocket.go:543 +0xc4c

Expected behavior:

Steps to reproduce:

Related code:

source file: github.com/lorenzodonini/ocpp-go/ocppj.go

This line paniced:
profile, _ := endpoint.GetProfileForFeature(request.GetFeatureName())

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbfddf3]

Either endpoint or request is nil pointer.

Other information:

insert the output here
@xBlaz3kx
Copy link
Contributor

This is most likely due to a message from an unsupported profile being sent back to the central system.

The only way this could have happened is if this was an unsupported message call result, produced here.

Could you provide more context regarding the central system's supported features, what charge point's supported features are, etc? Could it be, that the charge point responded with a wrong message for a request?

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