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

Queue is not working #6

Closed
RomLecat opened this issue Mar 14, 2023 · 4 comments
Closed

Queue is not working #6

RomLecat opened this issue Mar 14, 2023 · 4 comments

Comments

@RomLecat
Copy link

RomLecat commented Mar 14, 2023

Hello,

The Sonarr queue API is not working properly.

    config = sonarr.Configuration(host=url)
    config.api_key['apikey'] = api_key
    with sonarr.ApiClient(config) as api_client:
        queue = sonarr.QueueApi(api_client).get_queue(include_unknown_series_items=True, include_series=True, include_episode=True)
        print(queue)

I get this error:

Traceback (most recent call last):
  File "/opt/zabbix-tools/./arr_agent.py", line 65, in <module>
    main()
  File "/opt/zabbix-tools/./arr_agent.py", line 41, in main
    process_sonarr(url, api_key, host['host'])
  File "/opt/zabbix-tools/./arr_agent.py", line 54, in process_sonarr
    queue = sonarr.QueueApi(api_client).get_queue(include_unknown_series_items=True, include_series=True, include_episode=True)
  File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
  File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
  File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api/queue_api.py", line 384, in get_queue
    return self.get_queue_with_http_info(include_unknown_series_items, include_series, include_episode, **kwargs)  # noqa: E501
  File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
  File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
  File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api/queue_api.py", line 490, in get_queue_with_http_info
    return self.api_client.call_api(
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 407, in call_api
    return self.__call_api(resource_path, method,
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 206, in __call_api
    url_query = self.parameters_to_url_query(query_params,
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 546, in parameters_to_url_query
    return "&".join(["=".join(item) for item in new_params])
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 546, in <listcomp>
    return "&".join(["=".join(item) for item in new_params])
TypeError: sequence item 1: expected str instance, bool found

Radarr has the exact same issue.

Thanks

@Fuochi
Copy link
Contributor

Fuochi commented Mar 15, 2023

Hi @RomLecat,
it seems I'm not managing non-string query parameters properly, I'll address this after #5
Thanks

Fuochi added a commit that referenced this issue Mar 20, 2023
Fuochi added a commit that referenced this issue Mar 20, 2023
fix(#6): use repr of query parameters
@Fuochi Fuochi mentioned this issue Mar 20, 2023
@RomLecat
Copy link
Author

RomLecat commented Mar 25, 2023

Hi,

I did not close this one, I just had another error with the queue (it currently has 21 pending items, with 12 stalled ones due to missing peers in torrents) :

Traceback (most recent call last):
  File "/opt/zabbix-tools/./arr_agent.py", line 91, in <module>
    main()
  File "/opt/zabbix-tools/./arr_agent.py", line 47, in main
    process_arr(host, sonarr)
  File "/opt/zabbix-tools/./arr_agent.py", line 75, in process_arr
    queue = api_soft.QueueApi(api_client).get_queue(include_unknown_series_items=True, include_series=True, include_episode=True)
  File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
  File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
  File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api/queue_api.py", line 384, in get_queue
    return self.get_queue_with_http_info(include_unknown_series_items, include_series, include_episode, **kwargs)  # noqa: E501
  File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
  File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
  File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api/queue_api.py", line 490, in get_queue_with_http_info
    return self.api_client.call_api(
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 409, in call_api
    return self.__call_api(resource_path, method,
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 250, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 320, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 359, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.9/dist-packages/sonarr/api_client.py", line 751, in __deserialize_model
    return klass.from_dict(data)
  File "/usr/local/lib/python3.9/dist-packages/sonarr/models/queue_resource_paging_resource.py", line 112, in from_dict
    "records": [QueueResource.from_dict(_item) for _item in obj.get("records")] if obj.get("records") is not None else None
  File "/usr/local/lib/python3.9/dist-packages/sonarr/models/queue_resource_paging_resource.py", line 112, in <listcomp>
    "records": [QueueResource.from_dict(_item) for _item in obj.get("records")] if obj.get("records") is not None else None
  File "/usr/local/lib/python3.9/dist-packages/sonarr/models/queue_resource.py", line 189, in from_dict
    _obj = QueueResource.parse_obj({
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for QueueResource
timeleft
  expected string or bytes-like object (type=type_error)

Fuochi added a commit to devopsarr/sdk-generator that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/radarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/whisparr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/lidarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/sonarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/readarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/lidarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/prowlarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/readarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/prowlarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/whisparr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/radarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit that referenced this issue Mar 27, 2023
Fuochi added a commit to devopsarr/sdk-generator that referenced this issue Mar 27, 2023
devopsarr bot added a commit that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/readarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/lidarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/sonarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/radarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/whisparr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/whisparr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/readarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/radarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/prowlarr-py that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/prowlarr-go that referenced this issue Mar 27, 2023
devopsarr bot added a commit to devopsarr/lidarr-go that referenced this issue Mar 27, 2023
@Fuochi
Copy link
Contributor

Fuochi commented Mar 27, 2023

Just removed an useless validator that was producing the issue. Please let me know if it's working now

@RomLecat
Copy link
Author

Just did some tests, so far so good, thanks.
I'll close this one since it looks it works fine now, I'll open a new issue if I encounter something else :)

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