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

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #52

Closed
goldyfruit opened this issue Jun 6, 2023 · 1 comment

Comments

@goldyfruit
Copy link
Member

goldyfruit commented Jun 6, 2023

When asking the temperature (in French) I got this error:

2023-06-06 18:35:29.488 - OVOS - ovos_utils.file_utils:resolve_resource_file:146 - WARNING - Expected a dict config and got None. This configfallback behavior will be deprecated in a future release
2023-06-06 18:35:29.539 - OVOS - ovos_utils.dialog:get_dialog:169 - DEBUG - Resource file not found: text/fr-fr/skill.error.dialog
2023-06-06 18:35:29.589 - skill-ovos-weather.openvoiceos - ERROR - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/ovos_utils/messagebus.py", line 554, in wrapper
    handler(message)
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/__init__.py", line 236, in handle_current_temperature
    self._report_temperature(message, temperature_type="current")
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/__init__.py", line 894, in _report_temperature
    dialog.build_temperature_dialog(temperature_type)
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/weather_helpers/dialog.py", line 145, in build_temperature_dialog
    self._add_location()
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/weather_helpers/dialog.py", line 85, in _add_location
    if self.intent_data.config.country == self.intent_data.geolocation["country"]:
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/weather_helpers/intent.py", line 93, in geolocation
    self._geolocation = get_geolocation(self.location)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.local/lib/python3.11/site-packages/skill_ovos_weather/weather_helpers/util.py", line 99, in get_geolocation
    geolocation = geolocation_api.get_geolocation(location)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ovos_backend_client/api.py", line 351, in get_geolocation
    return self.backend.geolocation_get(location)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ovos_backend_client/backends/offline.py", line 166, in geolocation_get
    data = self.get(url, params={"q": location, "format": "json", "limit": 1}).json()[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@emphasize
Copy link
Member

closing this now as this was tackled in the backend client. Reopen if still problematic

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