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

Unexpected error in horizon.tv thread #30

Closed
easdue opened this issue Mar 8, 2018 · 18 comments
Closed

Unexpected error in horizon.tv thread #30

easdue opened this issue Mar 8, 2018 · 18 comments
Assignees
Labels

Comments

@easdue
Copy link

easdue commented Mar 8, 2018

The last couple of days I've noticed that tv_grab_nl3.py keeps running using 100% cpu. After running it manually I noticed the following error being thrown:

An unexpected error has occured in the horizon.tv thread:
While fetching the base pages
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/tvgrabpyAPI/tv_grab_fetch.py", line 1996, in run
self.init_channel_source_ids()
File "/usr/lib/python2.7/site-packages/tvgrabpyAPI/tv_grab_fetch.py", line 2143, in init_channel_source_ids
self.source_data[ptype]['url'] = self.source_data[ptype]['alt-url']
KeyError: u'channel'

I've attached the request conf an log files
tv_grab_nl3.tar.gz

@hikavdh
Copy link
Contributor

hikavdh commented Mar 8, 2018

Try deleting the source definition files in ~/.xmltv/sources (in the userdirectory of the user running it!), so they get downloaded afresh.

@easdue
Copy link
Author

easdue commented Mar 8, 2018 via email

@hikavdh
Copy link
Contributor

hikavdh commented Mar 8, 2018

I found the cause for the KeyError and am mostly surprised I have never seen it before. It comes from an error in tv_grab_API.json I just fixed. It might take ten minutes or so to propagate through any cashed data between you and github.
The weird thing is that this code bit deals with switching between the regularly alternating urls for horizon and should have shown up long time ago. Let me know if this solves it.

@hikavdh
Copy link
Contributor

hikavdh commented Mar 8, 2018

One other question. Does that high load stay indefinitely until you kill the script, and by indefinitely I mean more then 30 minutes?

@easdue
Copy link
Author

easdue commented Mar 9, 2018 via email

@easdue
Copy link
Author

easdue commented Mar 9, 2018 via email

@hikavdh
Copy link
Contributor

hikavdh commented Mar 9, 2018

The same KeyError: u'channel'?
That can't be as that key is no longer in data_def_names["source"]. I changed it to the correct u'channels'.
And tv_grab_API.json is always downloaded from git. So send me a log with the current error.

@easdue
Copy link
Author

easdue commented Mar 9, 2018 via email

@hikavdh
Copy link
Contributor

hikavdh commented Mar 9, 2018

I guess you're referring to the dummy copy inside the package. I only update that on a new release. The live one is in the sourcematching repository.

@easdue
Copy link
Author

easdue commented Mar 10, 2018 via email

@hikavdh hikavdh self-assigned this Mar 10, 2018
@hikavdh hikavdh added the bug label Mar 10, 2018
@hikavdh
Copy link
Contributor

hikavdh commented Mar 10, 2018

OK, I get what is happening and to properly fix it, it needs some code adaption. But I think I can fix it for now by adding dummy entries to the horizon definition. I have to check if that won't have any repercussions else. The trouble is that this happens before the thread is tagged active, so the thread manager is not aware and does not correct the state resulting in an indefinite lock-up.

@hikavdh
Copy link
Contributor

hikavdh commented Mar 10, 2018

That's also why disabling the source does not help.

@hikavdh
Copy link
Contributor

hikavdh commented Mar 10, 2018

What puzzles me however is that it has not come up before and does not on for instance my system. This part is in place for over a year.

@hikavdh
Copy link
Contributor

hikavdh commented Mar 10, 2018

That won't do. The dummy entries get filtered by the conversion. I'll see if I can push a fix sometime soon.

@erikdrenth
Copy link

erikdrenth commented Mar 10, 2018

Thanks for being on it. I'm having the same issues as easdue with exactly the same error (line 1996 and 2143). Can send more info if needed

@easdue
Copy link
Author

easdue commented Mar 10, 2018

I'm running fedora 27 and I have been using tvgrabpy since this summer. The error popped up I think last week so maybe an update here or there is the culprit (fedora is bleeding edge)

@hikavdh
Copy link
Contributor

hikavdh commented Mar 10, 2018

@easdue
Copy link
Author

easdue commented Mar 10, 2018 via email

@hikavdh hikavdh closed this as completed Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants