open-contracting-archive / standard-collaborator

Superseded by open-contracting/standard
https://github.com/open-contracting/standard
1 stars 3 forks source link

CalledProcessError for master branch #24

Open Bjwebb opened 9 years ago

Bjwebb commented 9 years ago

I keep seeing an error like this in my 500 error emails from the site:

CalledProcessError: Command '[u'git', u'reset', u'--hard', u'origin/master']' returned non-zero exit status 128

On urls such as http://ocds.open-contracting.org/standard/r/master/release-schema.json

This only occurs on the master branch, and does not hap4pen each time the url is visited.

I suspect that this is because two different Django threads/processes attempt to run the reset at the same time, causing one of them to fail (due to git's locking).

I've not seen this error via the interface yet. @timgdavies do you think you may have seen this problem on the site?

Full traceback:

Traceback (most recent call last):

  File "/home/opencontracting/standard-collaborator/django/website/.ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/home/opencontracting/standard-collaborator/django/website/.ve/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)

  File "/home/opencontracting/standard-collaborator/django/website/.ve/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)

  File "/home/opencontracting/standard-collaborator/django/website/main/views.py", line 177, in get
    doc = repo.get_json_contents(release, schema_name)

  File "/home/opencontracting/standard-collaborator/django/website/main/standardscache.py", line 198, in get_json_contents
    export_dir = self.export_commit(commit)

  File "/home/opencontracting/standard-collaborator/django/website/main/standardscache.py", line 183, in export_commit
    commit = self.standardise_commit_name(commit)

  File "/home/opencontracting/standard-collaborator/django/website/main/standardscache.py", line 164, in standardise_commit_name
    self.git_pull()

  File "/home/opencontracting/standard-collaborator/django/website/main/standardscache.py", line 128, in git_pull
    subprocess.check_call(['git', 'reset', '--hard', 'origin/master'], cwd=REPO_DIR)

  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)

CalledProcessError: Command '[u'git', u'reset', u'--hard', u'origin/master']' returned non-zero exit status 128
timgdavies commented 9 years ago

I've not seen an error message exposed on front-end, but have had some requests to master which I refreshed as they were slow - so suspect they may have been timing out.