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 disconnected without sending a response #128

Open
WhistleMaster opened this issue Apr 17, 2022 · 13 comments
Open

Server disconnected without sending a response #128

WhistleMaster opened this issue Apr 17, 2022 · 13 comments

Comments

@WhistleMaster
Copy link

WhistleMaster commented Apr 17, 2022

Hi !

Once again thanks for the amazing work on this component. I've recently added a new Axis camera in my setup and I get the following error in HA:

Logger: homeassistant.components.light
Source: components/axis/light.py:70
Integration: Light (documentation, issues)
First occurred: 5:39:28 PM (1 occurrences)
Last logged: 5:39:28 PM

Error adding entities for domain light with platform axis
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 102, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 81, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 143, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 186, in _receive_event
    raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/axis/vapix.py", line 265, in request
    response = await self.config.session.request(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1506, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1593, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1621, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1658, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1695, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 798, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/axis/light.py", line 70, in async_added_to_hass
    await self.device.api.vapix.light_control.get_current_intensity(
  File "/usr/local/lib/python3.9/site-packages/axis/light_control.py", line 189, in get_current_intensity
    return await self._request(
  File "/usr/local/lib/python3.9/site-packages/axis/vapix.py", line 296, in request
    raise RequestError("Connection error: {}".format(errc))
axis.errors.RequestError: Connection error: Server disconnected without sending a response.

Everything seems to work fine though.

Thanks for your help,
Kind regards,

WM

Axis Firmware: 10.10.71
HA: 2022.4.5

@Pedro-Leitek
Copy link

Pedro-Leitek commented Jul 18, 2022

Hi,

I'm also facing the same error. What is the cause of this?

Thanks

Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_transports/default.py", line 62, in map_httpcore_exceptions
yield
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_transports/default.py", line 281, in handle_async_request
extensions=request.extensions,
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpcore/_async/connection_pool.py", line 235, in handle_async_request
method, url, headers=headers, stream=stream, extensions=extensions
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpcore/_async/connection.py", line 149, in handle_async_request
method, url, headers, stream, extensions
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpcore/_async/http11.py", line 128, in handle_async_request
) = await self._receive_response(timeout)
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpcore/_async/http11.py", line 189, in _receive_response
event = await self._receive_event(timeout)
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpcore/_async/http11.py", line 236, in _receive_event
raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ai-dev/AI-Engine/Projeto_6_Videre/VidereApp/axis/vapix.py", line 268, in request
method, url, auth=self.auth, timeout=TIME_OUT, **kwargs # type: ignore [arg-type]
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_client.py", line 1484, in request
request, auth=auth, follow_redirects=follow_redirects
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_client.py", line 1575, in send
history=[],
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_client.py", line 1602, in _send_handling_auth
history=history,
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_client.py", line 1636, in _send_handling_redirects
response = await self._send_single_request(request)
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_client.py", line 1673, in _send_single_request
response = await transport.handle_async_request(request)
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_transports/default.py", line 281, in handle_async_request
extensions=request.extensions,
File "/usr/lib/python3.6/contextlib.py", line 99, in exit
self.gen.throw(type, value, traceback)
File "/home/ai-dev/.local/lib/python3.6/site-packages/httpx/_transports/default.py", line 79, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(self._args, **self._kwargs)
File "utilizador3.py", line 565, in stream
go_azi(p,15.0
i)
File "utilizador3.py", line 115, in go_azi
p.move_go_azi(p.loop, azimuth)
File "utilizador3.py", line 264, in move_go_azi
loop.run_until_complete(self.aux_go_azi(self.p,azimuth))
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "utilizador3.py", line 214, in aux_go_azi
await p.control(camera=1, pan=azi)
File "/home/ai-dev/AI-Engine/Projeto_6_Videre/VidereApp/axis/ptz.py", line 236, in control
return await self._request("post", URL, data=data)
File "/home/ai-dev/AI-Engine/Projeto_6_Videre/VidereApp/axis/vapix.py", line 298, in request
raise RequestError("Connection error: {}".format(errc))
axis.errors.RequestError: Connection error: Server disconnected without sending a response.

@Kane610
Copy link
Owner

Kane610 commented Jul 19, 2022

Something on server side it seems so I have no idea without more details

@Pedro-Leitek
Copy link

Something on server side it seems so I have no idea without more details

Hi, what is considered server side? Yesterday i tried to send you an email through pypi but I got an error saying the email doesn't exist.
Here is an excerpt of that email

"The application consists of capturing a frame, process it and move the camera a certain angle to the right or up. This process should happen indefinetely.
Currently I have na AXIS camara and a python script that sends and receives commands to/from camara.
Everything works fine for few hours of script running, but after some time the following error appears.
"

The "error" is what is in the comment above.

Regards

@Kane610
Copy link
Owner

Kane610 commented Jul 19, 2022

In this context it's the camera which is the server

@Kane610
Copy link
Owner

Kane610 commented Jul 20, 2022

Yesterday i tried to send you an email through pypi but I got an error saying the email doesn't exist.

Yes I want communication to be in one place and that is github :)

@Pedro-Leitek
Copy link

Yesterday i tried to send you an email through pypi but I got an error saying the email doesn't exist.

Yes I want communication to be in one place and that is github :)

Ok, makes sense :)

Do you have any idea why that error appears after some time of system working? Is it possible that the login session on the camera, expires?

Many thanks!

@Kane610
Copy link
Owner

Kane610 commented Jul 20, 2022

Yesterday i tried to send you an email through pypi but I got an error saying the email doesn't exist.

Yes I want communication to be in one place and that is github :)

Ok, makes sense :)

Do you have any idea why that error appears after some time of system working? Is it possible that the login session on the camera, expires?

Many thanks!

I have no idea. But I should add some kind of retry mechanism if request fails

@Pedro-Leitek
Copy link

Yesterday i tried to send you an email through pypi but I got an error saying the email doesn't exist.

Yes I want communication to be in one place and that is github :)

Ok, makes sense :)
Do you have any idea why that error appears after some time of system working? Is it possible that the login session on the camera, expires?
Many thanks!

I have no idea. But I should add some kind of retry mechanism if request fails

I forgot to mention, I'm using your axis repository in a company project. The idea is to have the camera working 24/7. What is your availability to study this issue? This issue can be critical for the project.

Your help is very appreciated. Just tell me what you need to understand better the issue.

Thank you

@Kane610
Copy link
Owner

Kane610 commented Jul 20, 2022

Right now I'm traveling. There are some rewrites I want to do of the library to help improve overall design and functionality. I plan to come back to work on this project in the not too distant future (as I have many different things going on)

@Pedro-Leitek
Copy link

Hi, do you have any news? Did you try to study this issue?

@Kane610
Copy link
Owner

Kane610 commented Aug 23, 2022

Hi, do you have any news? Did you try to study this issue?

No. Still busy on other projects.

@Kane610
Copy link
Owner

Kane610 commented Nov 10, 2022

Hi, do you have any news? Did you try to study this issue?

I was thinking, maybe we can do something unofficial for your case if you still need it, I don't need to publish a real release since you're running your own stuff. Does that sound ok?

@Pedro-Leitek
Copy link

Hi,
I was able to solve my issue. Instead of using your repository, I'm using directly the axis API. I think for my project and the way I wanted to do, your repository is not compatible. Thank you anyway!

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

3 participants