Sentry upgrade fails using python install

I have installed sentry in CentOS 7, using virtualenv and pip.
My pip version is 9.0.1 and sentry compile without errors, after installed all dependencies:

- python-setuptools                                                             
- python-devel                                                                  
- libxslt-devel                                                                 
- gcc                                                                           
- libffi-devel                                                                  
- libjpeg-turbo-devel                                                           
- libxml2-devel                                                                 
- libxslt-devel                                                                 
- libyaml-devel                                                                 
- libpqxx-devel                                                                 
- python-virtualenv                                                             
- clang                                                                         
- python-psycopg2                                                               
- postgresql-devel                                                              
- openssl-devel                                                                 
- libgcc.x86_64                                                                 
- cpp                                                                           
- postgresql                                                                    
- gcc-c++   

My sentry.conf.py:

from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(file)
DATABASES = {
‘default’: {
‘ENGINE’: ‘sentry.db.postgres’,
‘NAME’: ‘sentry’,
‘USER’: ‘sentry’,
‘PASSWORD’: ‘teste123’,
‘HOST’: ‘192.168.30.51’,
‘PORT’: ‘5432’,
‘AUTOCOMMIT’: True,
‘ATOMIC_REQUESTS’: False,
}
}
SENTRY_USE_BIG_INTS = True
SENTRY_SINGLE_ORGANIZATION = True
DEBUG = False
SENTRY_CACHE = 'sentry.cache.redis.RedisCache’
BROKER_URL = 'redis://localhost:6379’
SENTRY_RATELIMITER = 'sentry.ratelimits.redis.RedisRateLimiter’
SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer’
SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota’
SENTRY_TSDB = 'sentry.tsdb.redis.RedisTSDB’
SENTRY_DIGESTS = 'sentry.digests.backends.redis.RedisBackend’
SENTRY_WEB_HOST = '0.0.0.0’
SENTRY_WEB_PORT = 9000
SENTRY_WEB_OPTIONS = {
# ‘workers’: 3, # the number of web workers
# ‘protocol’: ‘uwsgi’, # Enable uwsgi protocol instead of http
}

My config.yml:

mail.backend: ‘smtp’ # Use dummy if you want to disable email entirely
system.secret-key: 'x&xb_n8&nzmp#600+)^07my4(6d&+1j*(gl&xgib-i#w92oozt’
redis.clusters:
default:
hosts:
0:
host: localhost
port: 6379
filestore.backend: 'filesystem’
filestore.options:
location: ‘/tmp/sentry-files’

Command (with virtualenv activated):

sentry --config /etc/sentry/ upgrade

Result:

Error in sys.excepthook:
Traceback (most recent call last):
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/raven/base.py”, line 249, in handle_exception
self.captureException(exc_info=exc_info, level=‘fatal’)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/raven/base.py”, line 781, in captureException
’raven.events.Exception’, exc_info=exc_info, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/raven.py”, line 43, in capture
return super(SentryInternalClient, self).capture(*args, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/raven/contrib/django/client.py”, line 284, in capture
result = super(DjangoClient, self).capture(event_type, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/raven/base.py”, line 610, in capture
self.send(**data)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/raven.py”, line 64, in send
from sentry.coreapi import ClientApiHelper
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/coreapi.py”, line 28, in
from sentry import filters
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/filters/init.py”, line 8, in
from .base import Filter # NOQA
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/filters/base.py”, line 5, in
from sentry.models import ProjectOption
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/models/init.py”, line 14, in
import_submodules(globals(), name, path)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/imports.py”, line 52, in import_submodules
module = import(module_name, globals(), locals(), [‘name’])
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/models/deploy.py”, line 11, in
from sentry.app import locks
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/app.py”, line 15, in
from sentry.utils.locking.backends.redis import RedisLockBackend
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/locking/backends/redis.py”, line 10, in
delete_lock = redis.load_script(‘utils/locking/delete_lock.lua’)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/redis.py”, line 145, in load_script
script = Script(None, resource_string(‘sentry’, posixpath.join(‘scripts’, path)))
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/redis/client.py”, line 2930, in init
encoder = registered_client.connection_pool.get_encoder()
AttributeError: ‘NoneType’ object has no attribute ‘connection_pool’

Original exception was:
Traceback (most recent call last):
File “/opt/muxi/virtualenvs/sentry/bin/sentry”, line 11, in
sys.exit(main())
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/init.py”, line 160, in main
cli(prog_name=get_prog(), obj={}, max_content_width=100)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/decorators.py”, line 35, in inner
configure()
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/init.py”, line 123, in configure
configure(ctx, py, yaml, skip_service_validation)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/settings.py”, line 152, in configure
skip_service_validation=skip_service_validation
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/initializer.py”, line 251, in initialize_app
apply_legacy_settings(settings)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/runner/initializer.py”, line 437, in apply_legacy_settings
url_prefix = options.get(‘system.url-prefix’, silent=True)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/options/manager.py”, line 152, in get
result = self.store.get(opt, silent=silent)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/options/store.py”, line 72, in get
result = self.get_store(key, silent=silent)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/options/store.py”, line 164, in get_store
except self.model.DoesNotExist:
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/django/utils/functional.py”, line 49, in get
res = instance.dict[self.func.name] = self.func(instance)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/options/store.py”, line 58, in model
from sentry.models.option import Option
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/models/init.py”, line 14, in
import_submodules(globals(), name, path)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/imports.py”, line 52, in import_submodules
module = import(module_name, globals(), locals(), [‘name’])
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/models/deploy.py”, line 11, in
from sentry.app import locks
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/app.py”, line 15, in
from sentry.utils.locking.backends.redis import RedisLockBackend
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/locking/backends/redis.py”, line 10, in
delete_lock = redis.load_script(‘utils/locking/delete_lock.lua’)
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/sentry/utils/redis.py”, line 145, in load_script
script = Script(None, resource_string(‘sentry’, posixpath.join(‘scripts’, path)))
File “/opt/muxi/virtualenvs/sentry/lib/python2.7/site-packages/redis/client.py”, line 2930, in init
encoder = registered_client.connection_pool.get_encoder()
AttributeError: ‘NoneType’ object has no attribute ‘connection_pool’

My guess is that for some reason the redis configurations aren’t been loaded, but I’m not sure.

Any help will be appreciated, I’m developing an ansible role to help people use sentry outside docker.

Yeah, so see: https://github.com/getsentry/sentry/pull/5905

redis-py bumped from 2.10.5 to 2.10.6 breaking an API that we used which you can see in the stacktrace. But we were being fuzzy and following semver to allow up to 2.11.0. So the answer right now is to just explicitly install 2.10.5 separately until we cut a new release, unfortunately. :frowning:

Thanks Matt, that solves the problem. I added a requirements.txt with redis==2.10.5 and that did the trick.