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

500 Internal Server Error when getting channel list #37

Closed
dilorc opened this issue Oct 17, 2014 · 5 comments
Closed

500 Internal Server Error when getting channel list #37

dilorc opened this issue Oct 17, 2014 · 5 comments

Comments

@dilorc
Copy link

dilorc commented Oct 17, 2014

Hi,

When I use urllib or urllib2 in python to get a list of channels the servers returns an 500 error. I can use curl with no issue. I can also use urllib2 to tune and get the status of a channel. It only fails when I try to pull the list. Are there debug logs I can look at? I need to use python because I'm writing an XBMC plugin to play Wallop channels.

Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import urllib2
urllib2.urlopen("http://192.168.1.202:8888/channels")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

@maddox
Copy link
Owner

maddox commented Oct 17, 2014

Did you set the IP address of your HDHomerun correctly in the config?
Is your HDHomerun one of the original Duals? That one is not supported.
Is your firmware up to date? You'll need up to date firmware to get your channel listings back.

@dilorc
Copy link
Author

dilorc commented Oct 17, 2014

Yes, the IP is correct. It's the CableCard HDHomerun, the CC3 I believe. Firmware is 20140604.

curl works fine: curl http://192.168.1.202:8888/channels returns all the channels. It only happens when I use the Python library.

@maddox
Copy link
Owner

maddox commented Oct 17, 2014

Very weird.

Are there debug logs I can look at?

It logs at logs/wallop.log. But they're not showing much except that a 500 is happening :/

I'm seeing this too. This is very weird.

@maddox
Copy link
Owner

maddox commented Oct 17, 2014

Ok, it looks like that urlopen doesn't send a default accept header in it's request. If you add one it should be fine.

import urllib2

req = urllib2.Request('http://localhost:8888/channels')
req.add_header('Accept', 'application/json')
print urllib2.urlopen(req).read()

@dilorc
Copy link
Author

dilorc commented Oct 17, 2014

Perfect! Thanks for the help and the quick turnaround!

Chris

On Fri, Oct 17, 2014 at 6:08 PM, Jon Maddox notifications@github.com
wrote:

Ok, it looks like that urlopen doesn't send a default accept header in
it's request. If you add one it should be fine.

import urllib2
req = urllib2.Request('http://localhost:8888/channels')req.add_header('Accept', 'application/json')print urllib2.urlopen(req).read()


Reply to this email directly or view it on GitHub
#37 (comment).

@maddox maddox closed this as completed Oct 18, 2014
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

2 participants