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

External condition not working. conditions.uri.IsValidUriResponse(): response not 200, disabling recording. #145

Open
enduluc opened this issue Jul 27, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@enduluc
Copy link

enduluc commented Jul 27, 2024

For some reason, the external condition using a condition url stop working,.... I have several agents configured, when meets the Region of Interest, and the condition url gets the 200 Status code, I should start recording. I almost have 5 months with this configuration, but now stop working. even if I reinstall everything from scratch.

INFO[2024-07-27T14:20:06-04:00] conditions.uri.IsValidUriResponse(): response not 200, disabling recording.

@enduluc enduluc changed the title External conditionnot working External condition not working Jul 27, 2024
@enduluc enduluc changed the title External condition not working External condition not working. conditions.uri.IsValidUriResponse(): response not 200, disabling recording. Jul 27, 2024
@cedricve
Copy link
Member

hello @enduluc, I assume you are still using the old Kerberos Agent?

@cedricve cedricve self-assigned this Jul 28, 2024
@cedricve cedricve added the question Further information is requested label Jul 28, 2024
@enduluc
Copy link
Author

enduluc commented Jul 29, 2024

hi @cedricve Version 3.1.8
I even reinstall everything, install new ones, and in one case, started working again, but when I restart the container, stopped ....The thing is that I have a nodered flow that enable an HTTP endpoint, when Im at home, the endpoint sends in the response (404) status code, when I leave, the endpoint sends a 200....the kerberos agent, verify the conditional URL, but even with the 200, its says is that the response is not 200, and stop the recording.

I even tried entering to the containers´ console, test the command curl -i to the endpoint and the response is 200. but the agent says NOPE.

@enduluc
Copy link
Author

enduluc commented Aug 2, 2024

hi @cedricve any updates? do you need more information about this, logs, or anything else?
I even install one agent in another environment, same results. The agent doesnt recognize the 200 status code from the endpoint response.

Please let me know.

kind regards,

@enduluc
Copy link
Author

enduluc commented Aug 3, 2024

Hi @cedricve I have an update. I tested two agents with different url endpoints (condition url). Those endpoints are in my nodered instance. The results:

http://192.168.192.30:1880/endpoint ----> this always works in keberos agent and the status code in browser is 200
http://192.168.192.30:1880/endpoint/other ----> this one doesn't work in kerberos agent, but still status code in browser is 200

http://192.168.192.30:1880/endpoint/ ----> when I put the "/" to the end, in kerberos agent stop working and says that response is not 200.

The condition URL in kerberos agent cannot validated the url response when you have another deep level in the url.
http://192.168.192.30:1880/endpoint ----kerberos OK
http://192.168.192.30:1880/endpoint/ ----kerberos Failed
http://192.168.192.30:1880/endpoint/other ----kerberos Failed
http://192.168.192.30:1880/endpoint/other/ ----kerberos Failed

@cedricve
Copy link
Member

Thanks for the information @enduluc, we will provide a fix! ;)

@cedricve cedricve added bug Something isn't working and removed question Further information is requested labels Aug 10, 2024
@enduluc
Copy link
Author

enduluc commented Sep 15, 2024

Hi @cedricve, any updates?

@enduluc
Copy link
Author

enduluc commented Oct 6, 2024

Hi @cedricve any updates?

I ran some test and find out that kerberos only works with nodered home assistant addon. When i recreate the same flow in a nodered vm standalone, the endpoint returns 200 but kerberos says nop.

@enduluc
Copy link
Author

enduluc commented Oct 17, 2024

Hi @cedricve, is me again.
Just to know if there is light at the end of the tunnel.
Im running a bunch of tests, with different node-red instances (lxc, docker, vm, home assistant OS) the only that works is with haos, with the main endpoint, but when I try to use a second endpoint, it fails. the workaround was installing two VMs with haos and run different endpoints.... please, need some light here!

@enduluc
Copy link
Author

enduluc commented Nov 25, 2024

Hi @cedricve I hope you are doing well. Have you had the oportunity to check this bug?

@andp97
Copy link
Contributor

andp97 commented Nov 28, 2024

Hi @enduluc,

I have looked at and tested the code responsible for this error message, but I am unable to reproduce this error:

INFO[2024-07-27T14:20:06-04:00] conditions.uri.IsValidUriResponse(): response not 200, disabling recording.

Could you please share with us the output of these commands:

curl -I http://192.168.192.30:1880/endpoint
curl -I http://192.168.192.30:1880/endpoint/other
curl -I http://192.168.192.30:1880/endpoint/
curl -I http://192.168.192.30:1880/endpoint/other/

The Kerberos External Condition URI check will fail if these conditions are met:

  • The remote endpoint returns an HTTP code strictly different from 200 (we can improve this by adding all 2xx status codes @cedricve)
  • The URL is invalid/malformed (you should see a frontend validation error)
  • The remote host is unreachable

Based on the information that you provided, I suppose that your endpoint returns a different HTTP status code than 200 when a trailing slash is added to the URL.

For example, your endpoint web server might be configured to redirect the URL to the non-trailing slashed version and return an HTTP 301 status code. In this case, the External Condition check will fail.

I suggest you double-check the endpoint web server configuration and share the output of the above commands with us, so we can better handle this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants