Skip to content

Dataformat validation is still unprotected

Following an analysis from @laurent.el-shafey, the data format errors you saw passing by are related to a lack of protection (missing try/except clauses) during their validation.

Here is one of the backtraces:

File "/remote/sw/beat.web/src/beat.web/beat/web/common/serializers.py", line 203, in get_declaration
    return obj.json()
  File "/remote/sw/beat.web/src/beat.web/beat/web/common/models.py", line 298, in json
    return simplejson.loads(self.load_contents('file'),
  File "/remote/sw/beat.web/src/beat.web/beat/web/common/models.py", line 272, in load_contents
    f.open()
  File "/remote/sw/beat.env.deploy/usr/lib/python2.7/site-packages/django/db/models/fields/files.py", line 79, in open
    self.file.open(mode)
  File "/remote/sw/beat.env.deploy/usr/lib/python2.7/site-packages/django/db/models/fields/files.py", line 49, in _get_file
    self._file = self.storage.open(self.name, 'rb')
  File "/remote/sw/beat.env.deploy/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 35, in open
    return self._open(name, mode)
  File "/remote/sw/beat.env.deploy/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 172, in _open
    return File(open(self.path(name), mode))
IOError: [Errno 2] No such file or directory: u'/remote/prefix/dataformats/40/07/robert/FaceBoundingBox/1.json'