DjangoGirls/djangogirls

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Closed this issue · 5 comments

Sentry Issue: DJANGO-GIRLS-WEBSITE-6K

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  File "requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
(10 additional frame(s) were not displayed)
...
  File "organize/views.py", line 52, in done
    application = EventApplication.object.create(**data_dict)
  File "organize/models.py", line 83, in create
    return super().create(**data_dict)
  File "organize/models.py", line 155, in save
    self.latlng = get_coordinates_for_city(self.city, self.get_country_display())
  File "core/utils.py", line 17, in get_coordinates_for_city
    data = req.json()[0]

This looks the same as we're seeing in some test failures for the pre-commit and black updates

#965

Would it be possible to make the Sentry issue public, as it could be helpful? It's tough to determine what caused this issue solely from the stack trace.

@marksweb do we know what's the city that caused this error?

@vanessa Ah yes, the public pages miss such useful info;

city "Prague"

country "Czechia"

q "Prague, Czechia"

req <Response [403]>