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

Amcrest error in logs when password contains special characters #87967

Closed
jaminh opened this issue Feb 13, 2023 · 12 comments
Closed

Amcrest error in logs when password contains special characters #87967

jaminh opened this issue Feb 13, 2023 · 12 comments

Comments

@jaminh
Copy link
Contributor

jaminh commented Feb 13, 2023

The problem

If the password for an Amcrest camera contains special characters it results in an error in the logs because it can not parse the RTSP URL generated. The error looks something like:

2023-02-09 18:17:42.469 ERROR (stream_worker) [root] Uncaught thread exception
Traceback (most recent call last):
File "/srv/homeassistant/lib64/python3.10/site-packages/homeassistant/components/stream/worker.py", line 504, in stream_worker
container = av.open(source, options=pyav_options, timeout=SOURCE_TIMEOUT)
File "av/container/core.pyx", line 401, in av.container.core.open
File "av/container/core.pyx", line 272, in av.container.core.Container.cinit
File "av/container/core.pyx", line 292, in av.container.core.Container.err_check
File "av/error.pyx", line 336, in av.error.err_check
av.error.ValueError: [Errno 22] Invalid argument: 'rtsp://:@*******:554/cam/realmonitor?channel=1&subtype=0'; last error log: [tcp] Port missing in uri

It appears the error is also failing to redact the username/password despite being formatted to do so (I redacted the URL manually when posting).

It appears the solution is to URL encode the username and password. I have a pull request with the python-amcrest project for this change. tchellomello/python-amcrest#224

What version of Home Assistant Core has the issue?

2023.2.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Amcrest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/amcrest/

Diagnostics information

No response

Example YAML snippet

amcrest:
  - host: **************
    name: Webcam Front Door
    username: ************
    password: !secret amcrest_password

Anything in the logs that might be useful for us?

2023-02-09 18:17:42.469 ERROR (stream_worker) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/srv/homeassistant/lib64/python3.10/site-packages/homeassistant/components/stream/worker.py", line 504, in stream_worker
    container = av.open(source, options=pyav_options, timeout=SOURCE_TIMEOUT)
  File "av/container/core.pyx", line 401, in av.container.core.open
  File "av/container/core.pyx", line 272, in av.container.core.Container.__cinit__
  File "av/container/core.pyx", line 292, in av.container.core.Container.err_check
  File "av/error.pyx", line 336, in av.error.err_check
av.error.ValueError: [Errno 22] Invalid argument: 'rtsp://***************:************@**********:554/cam/realmonitor?channel=1&subtype=0'; last error log: [tcp] Port missing in uri

Additional information

No response

@home-assistant
Copy link

Hey there @flacjacket, mind taking a look at this issue as it has been labeled with an integration (amcrest) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of amcrest can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign amcrest Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


amcrest documentation
amcrest source
(message by IssueLinks)

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@jaminh
Copy link
Contributor Author

jaminh commented May 14, 2023

This is still an issue but requires the python-amcrest library to be fixed. tchellomello/python-amcrest#224

@github-actions github-actions bot removed the stale label May 14, 2023
@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@jaminh
Copy link
Contributor Author

jaminh commented Aug 12, 2023

I believe this is still an issue as the python-amcrest project still hasn't been updated.

@github-actions github-actions bot removed the stale label Aug 12, 2023
@jaminh
Copy link
Contributor Author

jaminh commented Oct 6, 2023

This is still an issue in the new 1.9.8 version of python-amcrest.

@jaminh
Copy link
Contributor Author

jaminh commented Oct 6, 2023

I'll add that this issue seems to cause more than just error log messages, there is reduced functionality (can't view the full resolution video stream) for amcrest cameras as well.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@jaminh
Copy link
Contributor Author

jaminh commented Jan 5, 2024

The fix still hasn't been merged in the amcrest library so this is still an issue for homeassistant.

@github-actions github-actions bot removed the stale label Jan 5, 2024
@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@jaminh
Copy link
Contributor Author

jaminh commented Apr 6, 2024

This is still an issue.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant