5
I’m trying to deploy to AWS Elastic Beanstalk. My project has a structure where Django’s 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 line of release, I’ve changed it anyway, tried with 2 levels above, tried everything and it returns error that did not identify git repository (which exists).
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’t get Séntry to run on Elastic Beanstalk. I also tried with the template they have in the tutorial with wsgi calling Sentry. Also gives the same error. Probably because config is valid for any installation method used.
Could you add more details about the error, for example the log? Usually there is an explanation about the error.
– Renato
The log is what I put in the post itself.
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.
– Karl Zillner
I understand he couldn’t get the git head...but my folder . git goes along in the deploy. I don’t understand why he has to take the head of git to run Ntry, but anyway he should take.
– Karl Zillner
Somewhere in the configuration is there space to configure the project’s local/path? Because it tries to find {path}/. git/HEAD and when it does not find it, it displays the error "Repository at {path}", as it is exiting "Repository at .", so the path is currently "." which appears to be incorrect. https://github.com/getsentry/raven-python/blob/master/raven/versioning.py#L22
– Renato
Of curiosity, some reason to separate the file
settings.py
inside another folder? If you move it to the root, it works again?– Leonardo Pessoa
Tried to gitclone the repository you took? Copying and pasting might not be enough.
– LeonanCarvalho
@leonardopessoa already moved and still did not work, but the reason is only to organize the project. Anyway he was already in a folder that was the project itself. But I think that’s not the problem, because the log message is related to git. But in Amazon elasticbeanstalk the repository folder doesn’t even go to the deploy
– Karl Zillner
@Leonancarvalho makes no sense to make a git clone in Elastic Beanstalk.... its deployment process is automated.
– Karl Zillner
@Renato I’ve seen this link you sent, is the line of the code that he gives the error. I checked this configuration, which would be PYTHONPATH if I’m not mistaken. The problem is that the Elastic Beanstalk deploy does not even send the folder. git, I connected via ssh and saw the folders it uses in the instance and there is no .git. I am simply giving up Sentry on AWS EBS and using logging to throw the errors in a db and email.
– Karl Zillner