question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting Invalid Response

See original GitHub issue

I’m using pynetgear in a hass.io rpi system to monitor presence by probing the device list on my Netgear Nighthawk X10 R9000 (hitting it about every 30 seconds with a query). The system works about 80% of the time and I’m able to get the list of devices without issue but for 10% of the time (and it seems random/sporadic) I get the following error:

2019-05-28 20:41:06 ERROR (SyncWorker_1) [pynetgear] Invalid response
2019-05-28 20:41:06 DEBUG (SyncWorker_1) [pynetgear] 200
{'Content-Length': '1518', 'Content-Type': 'text/xml; charset="UTF-8"', 'Server': 'Linux/2.6.15 uhttpd/1.0.0 soap/1.0'}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:GetAttachDeviceResponse xmlns:m="urn:NETGEAR-ROUTER:service:DeviceInfo:1">    
    <NewAttachDevice><!-- snipped for privacy --></NewAttachDevice>
</m:GetAttachDeviceResponse>
<ResponseCode>000</ResponseCo</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

2019-05-28 20:41:06 ERROR (SyncWorker_1) [pynetgear] Get attached devices failed

Clearly the XML that is printed out in the debug log is invalid:

<ResponseCode>000</ResponseCo</SOAP-ENV:Body>

At first I thought it might be random dropped packets losing the response… but it is consistent in not printing the full <ResponseCode> tag. Sometimes it breaks at different spots where it only prints </Respon but it is always this closing tag that is printed.

The question is… is this actually coming from the netgear… or is this some sort of preprocessing of the response that corrupts it within pynetgear?

Either way, I see you don’t actually validate the XML any way around this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
VincentMasseliscommented, Jan 14, 2020

Same issue here, you’re not alone…

0reactions
MatMaulcommented, Nov 21, 2021

Thanks all for the detailed analysis, I have incorporated the suggested changes. Sorry for the tremendous delay, but I have been a quite more busy than usual and also don’t own anymore any Netgear devices with stock firmware.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix "Invalid Response Received" on YouTube? - Appuals
This happens when your query wasn't submitted properly to Google's servers due to which you receive the invalid response received error message.
Read more >
Why am I getting an "Error: Invalid Response" message?
If you encounter this error message when you try to perform an action within your vault (e.g., add a new site password, change...
Read more >
[FIXED] NET::ERR_INVALID_RESPONSE Error Code Problem
If you are facing or getting NET::ERR_INVALID_RESPONSE Error Code Issue then don't worry as you just have to Check out & Read ERR...
Read more >
[Fix] “Invalid Response Received” error on YouTube
If your Google account does not have a name set up, your email will be chosen instead, which can cause the “invalid response...
Read more >
Fix connection errors - Google Chrome Help
Get help with a specific error message · Step 1: Sign in to the portal · Step 2: Open the page in Incognito...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found