Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

owm api errors #63

Open
mikejgray opened this issue Jun 1, 2023 · 4 comments
Open

owm api errors #63

mikejgray opened this issue Jun 1, 2023 · 4 comments

Comments

@mikejgray
Copy link

I'm seeing this in my personal backend logs:

[2023-06-01 04:31:05,875] ERROR in app: Exception on /v1/owm/onecall [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 5 (char 4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.10/dist-packages/ovos_local_backend/backend/decorators.py", line 99, in decorated_function
    resp = make_response(f(*args, **kwargs))
  File "/usr/local/lib/python3.10/dist-packages/ovos_local_backend/backend/decorators.py", line 54, in decorated
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ovos_local_backend/backend/decorators.py", line 72, in decorated
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ovos_local_backend/backend/external_apis.py", line 135, in owm_onecall
    data = apis.owm_onecall(lat, lon, units, lang)
  File "/usr/local/lib/python3.10/dist-packages/ovos_local_backend/utils/__init__.py", line 210, in owm_onecall
    return self._owm.get_weather_onecall(params)
  File "/usr/local/lib/python3.10/dist-packages/ovos_utils/ovos_service_api.py", line 89, in get_weather_onecall
    r = requests.post(url, data=reqdata, headers=self.headers)
  File "/usr/local/lib/python3.10/dist-packages/ovos_utils/ovos_service_api.py", line 52, in headers
    self.api.get_session_challenge()
  File "/usr/local/lib/python3.10/dist-packages/ovos_utils/ovos_service_api.py", line 31, in get_session_challenge
    session_challenge_response = session_challenge_request.json()
  File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 5 (char 4)
@emphasize
Copy link
Member

emphasize commented Jun 5, 2023

have to ask, an api key is set in the backend config? Had no problems while requesting owm from the personal backend.

"microservices": {
        "ovos_fallback": true,
        "wolfram_provider": "auto",
        "weather_provider": "auto",
        "geolocation_provider": "auto",
        "wolfram_key": "",
        "owm_key": <some_key>
    },

Besides, the new weather skill is not requesting from owm any more

@mikejgray
Copy link
Author

have to ask, an api key is set in the backend config? Had no problems while requesting owm from the personal backend.


"microservices": {

        "ovos_fallback": true,

        "wolfram_provider": "auto",

        "weather_provider": "auto",

        "geolocation_provider": "auto",

        "wolfram_key": "",

        "owm_key": <some_key>

    },

Besides, the new weather skill is not requesting from owm any more

Yes it is. The weather skill not using owm may be the issue. I was running on all latest betas for OVOS - are you also, or are you on stable versions?

@emphasize
Copy link
Member

with weather i'm on a pr branch. (refactor/translatable)
But there wouldn't be a owm call with weather v.0.0.1a8 / a7 either

@builderjer
Copy link
Member

this has something to do with the admin_key value. I just came across the same error while doing a UI when trying to do a request without authorization. I guess the endpoint for weather wants admin access?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants