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

[BUG] Ombi null childRequest output #119

Closed
4pack opened this issue Apr 3, 2019 · 5 comments
Closed

[BUG] Ombi null childRequest output #119

4pack opened this issue Apr 3, 2019 · 5 comments
Labels
enhancement New feature or request in-next-release In the next release

Comments

@4pack
Copy link

4pack commented Apr 3, 2019

Describe the bug
When there are no denied requests in Ombi, the function get_all_requests errors out with the following error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/Varken/Varken.py", line 34, in thread
    a = job()
  File "/opt/Varken/varken/ombi.py", line 105, in get_all_requests
    if show.childRequests[0]['denied']:
IndexError: list index out of range

This used to work in the past. The function doesn't check to see if the index actually exists before checking the value.

if show.childRequests[0]['denied']:

To Reproduce
Steps to reproduce the behavior:

  1. Run Ombi 3.0.4256
  2. Don't deny requests
  3. Run Varken
  4. Everything breaks

Expected behavior
Ombi data is added to InfluxDB and the thread stays running.

Environment (please complete the following information):

  • OS: Ubuntu 16.04.5 (LXC Container)
  • Version (develop/bd98b3c)

Additional context
I do recall this working in the past. This seems to kill the thread preventing anything else from being written to InfluxDB.

@4pack 4pack added the awaiting-triage Request awaiting triage label Apr 3, 2019
@samwiseg0 samwiseg0 added more-info-requested Waiting on more information and removed awaiting-triage Request awaiting triage labels Apr 3, 2019
@samwiseg0
Copy link
Member

samwiseg0 commented Apr 3, 2019

This may not be a bug but broken data in the API calls...Can you make these calls manually and post the data in a gist?

It is erroring on that line because that is the first time we evaluate the data. Has nothing to do with denied requests.

tv_endpoint = '/api/v1/Request/tv'
movie_endpoint = "/api/v1/Request/movie"

@dirtycajunrice
Copy link
Member

@samwiseg0 its most certainly broken data as usual. we could do a .get(key, False) tho to account for it though

@4pack
Copy link
Author

4pack commented Apr 9, 2019

Sorry I didn't respond sooner. See below gist.
https://gist.github.com/4pack/1278737e4ba79eba60a8a2461a6af7c5

Looks like the denied key for TV shows is returning null, which would definitely error that if call out.

@4pack
Copy link
Author

4pack commented Apr 18, 2019

This gets even more fun. Several of the requested TV shows doesn't have any content in childRequests somehow. If these are skipped over (or empty data is put in place of the empty request) then it works fine. API changes are fun...

{
    "tvDbId": 70839,
    "imdbId": "tt0276656",
    "qualityOverride": null,
    "rootFolder": null,
    "overview": "Welcome to MTV Cribs, the most exciting way to peep into your favourite celebrity homes without getting slapped with a restraining order.",
    "title": "MTV Cribs",
    "posterPath": "https://static.tvmaze.com/uploads/images/medium_portrait/25/64588.jpg",
    "background": null,
    "releaseDate": "2000-09-20T00:00:00",
    "status": "Ended",
    "totalSeasons": 0,
    "childRequests": [],
    "id": 70839
  },

@samwiseg0
Copy link
Member

samwiseg0 commented Apr 18, 2019

Neither of these issues are API changes but rather a broken state the app has created. You might find that removing the broken data and adding it back might rectify the issue. There has to be child objects in TV shows.

Edit: All we will do/can do is workaround this by dropping invalid data. There is no "fix" on our side. Ombi is broken and issues will have to be opened with that project.

@samwiseg0 samwiseg0 added enhancement New feature or request in-next-release In the next release and removed more-info-requested Waiting on more information labels Apr 18, 2019
@dirtycajunrice dirtycajunrice changed the title [BUG] Ombi status checking fails if there are no denied requests [BUG] Ombi null childRequest output Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in-next-release In the next release
Projects
None yet
Development

No branches or pull requests

3 participants