src-d/vecino

docker run fails to decode index.json

Closed this issue · 1 comments

I'm getting an error decoding the downloaded index.json.

➜  docker run -it --rm -v vecino-cache:/root srcd/vecino https://github.com/apache/spark
INFO:bblfsh:Detected bblfsh server: 172.17.0.1:9432
INFO:enry:Fetching https://api.github.com/repos/src-d/enry/releases/latest
INFO:enry:Latest release resolved to enry_v1.6.4_linux_amd64.tar.gz
INFO:enry:Fetching https://github.com/src-d/enry/releases/download/v1.6.4/enry_v1.6.4_linux_amd64.tar.gz
INFO:enry:Extracting the binary
INFO:enry:Downloaded /enry
INFO:gcs-backend:Fetching https://storage.googleapis.com/models.cdn.sourced.tech/index.json?ignoreCache=1...
Traceback (most recent call last):
  File "/usr/local/bin/vecino", line 11, in <module>
    load_entry_point('vecino==0.1.5a0', 'console_scripts', 'vecino')()
  File "/usr/local/lib/python3.5/dist-packages/vecino/__main__.py", line 72, in main
    "vocabulary_max": args.vocabulary_max}
  File "/usr/local/lib/python3.5/dist-packages/vecino/similar_repositories.py", line 27, in __init__
    self._id2vec = Id2Vec(log_level=verbosity).load(backend=backend)
  File "/usr/local/lib/python3.5/dist-packages/modelforge/model.py", line 84, in load
    index = backend.fetch_index()
  File "/usr/local/lib/python3.5/dist-packages/modelforge/gcs_backend.py", line 87, in fetch_index
    return json.loads(buffer.getvalue().decode("utf8"))
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Is it possible the model has been deleted by mistake?

➜  curl https://storage.googleapis.com/models.cdn.sourced.tech/index.json
<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: models.cdn.sourced.tech/index.json</Details></Error>%

this is fixed in 0.2.0