Closed andig closed 1 year ago
Confirmed. I can repro the error by sending the following Configuration to the CS:
func (handler *ChargePointHandler) OnGetConfiguration(request *core.GetConfigurationRequest) (confirmation *core.GetConfigurationConfirmation, err error) {
return core.NewGetConfigurationConfirmation([]core.ConfigurationKey{
{Key: "AuthorizationKey"},
}), nil
}
I've also noticed a follow-on error. The PropertyConstraintViolation
is returned from CS to CP. It is not returned to the GetConfiguration()
call though. Eventually, GetConfiguration
will time out with GenericError
which seems really unfortunate as it hides the underlying issue if you have not enabled full logging. Shall I open separate issue for this?
Nice catch, I'm looking into it and will try to tackle both issues directly, no need to open another issue.
Great thank you! This was only possible thanks to the new logging capabilities:)
Shall I open separate issue for the error return now or do you think current behaviour is by design? It seems to increase timeout until the error actually occurs at least.
@andig no need, the other issue is WIP. I closed this issue by mistake. I just reopened it.
@lorenzodonini any chance to get this fixed? I had a look at the code but don't quite understand how/where the errors are returned or why the actual error gets swallowed. Would be happy to put up a small bounty!
@andig I have an open branch with a working solution. Need to write some tests then I'll merge the fix.
@andig I merged a fix. When a response with an invalid payload is returned, the library will now send an error instead to the requesting endpoint. Let me know if you still encounter any issues.
When a response with an invalid payload is returned, the library will now send an error instead to the requesting endpoint.
@lorenzodonini does that only cover invalid payloads or any errors returned by the chargepoint? Imho the expected behaviour would be that any request that the remote endpoint returns an error for returns that error to the caller instead of waiting for timeout.
Is that the correct understanding? I'll merge your changes into our dev environment and check for feedback.
It covers any error encountered while sending a response, in either direction. For network errors, the timeout/disconnect will still be the quickest indicator though.
Feel free to look at the charge_point.go/sendResponse
function logic for more info.
Think this one has been fixed, much appreciated!
Here's what's happened in https://github.com/evcc-io/evcc/issues/6817:
If I don't misjudge this the culprit 3 is
It looks as if the validation rule in https://github.com/lorenzodonini/ocpp-go/blob/fc83394875b1fc6f96fe4ad46e5d6889c3daa0f4/ocpp1.6/core/get_configuration.go#L15 is mis-triggering? The message is bogus if it's checking for maximum- seems this is more a required fields check?