Amazon Elastic Beanstalk + Django + Sentry returning raven.exceptions.InvalidGitRepository

5

I'm trying to deploy on AWS Elastic Beanstalk. My project has a structure where Django settings is in the settings folder:

|projeto
|--settings
|----settings.py

It contains the configuration as:

RAVEN_CONFIG = {
    'dsn': 'https://----------:[email protected]/------',
    'release': raven.fetch_git_sha(os.path.dirname(os.pardir)),
}

I believe the error is in the release line, I've already changed it anyway, tried with 2 levels above, tried everything and it returns error that did not identify git repository ).

File "/opt/python/run/venv/local/lib/python3.4/site-packages/raven/versioning.py", line 25, in fetch_git_sha
'Cannot identify HEAD for git repository at %s' % (path,))
raven.exceptions.InvalidGitRepository: Cannot identify HEAD for git repository at. 

Because of this error I can not make sentry run in Elastic Beanstalk. I also tried with the template that they have in the tutorial with wsgi calling Sentry. It also gives the same error. Probably because config is valid for any installation method used.

    
asked by anonymous 02.05.2017 / 21:31

1 answer

1

ElasticBeanstalk does not use git to deploy application revisions. It uses full application bundles stored in S3 (a zip / tarball of the entire repository, without the .git ).

You need to pull the revision (sha, version etc.) from somewhere other than the sha of git . You can also include this in the bundle, before deploying (i.e. git rev-parse HEAD > ./git-current-head && eb deploy ), and reading in the code.

    
11.05.2017 / 16:41