Redis Auth error on on-premise

Hello,

I am deploying sentry onpremise using docker by passing environment variables
docker run -d \ $(echo $DOCKER_RUN_OPTS) \ -h sentry.example.com \ -e SENTRY_POSTGRES_HOST='sentry-postgres' \ -e SENTRY_DB_NAME='sentry' \ -e SENTRY_DB_USER='sentry' \ -e SENTRY_DB_PASSWORD='sentry' \ -e SENTRY_REDIS_HOST='sentry-redis-int' \ -e SENTRY_REDIS_PASSWORD='sentry' \ -e SENTRY_SECRET_KEY="$SECRET_KEY" \ -v sentry-data:/var/lib/sentry/data \ -p 9000:9000 \ --name sentry-base \ --restart always \ --link sentry-postgres \ --link sentry-redis \ docker.io/getsentry/sentry:latest

16:35:39 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
16:35:42 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/sentry/buffer/redis.py”, line 67, in validate
client.ping()
File “/usr/local/lib/python3.6/site-packages/redis/client.py”, line 1106, in ping
return self.execute_command(‘PING’)
File “/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/redis.py”, line 101, in sentry_patched_execute_command
return old_execute_command(self, name, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 488, in execute_command
buf = self._get_command_buffer(host_id, args[0])
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 355, in _get_command_buffer
buf = CommandBuffer(host_id, connect, self.auto_batch)
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 91, in init
self.connect()
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 107, in connect
self.connection = self._connect_func()
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 353, in connect
return self.connection_pool.get_connection(command_name, shard_hint=host_id)
File “/usr/local/lib/python3.6/site-packages/rb/clients.py”, line 254, in get_connection
con = real_pool.get_connection(command_name)
File “/usr/local/lib/python3.6/site-packages/redis/connection.py”, line 1073, in get_connection
connection.connect()
File “/usr/local/lib/python3.6/site-packages/redis/connection.py”, line 548, in connect
self.on_connect()
File “/usr/local/lib/python3.6/site-packages/redis/connection.py”, line 618, in on_connect
if nativestr(self.read_response()) != ‘OK’:
File “/usr/local/lib/python3.6/site-packages/redis/connection.py”, line 718, in read_response
raise response
redis.exceptions.ResponseError: AUTH called without any password configured for the default user. Are you sure your configuration is correct?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/sentry”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.6/site-packages/sentry/runner/init.py”, line 166, in main
cli(prog_name=get_prog(), obj={}, max_content_width=100)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/decorators.py”, line 68, in inner
return ctx.invoke(f, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/decorators.py”, line 29, in inner
configure()
File “/usr/local/lib/python3.6/site-packages/sentry/runner/init.py”, line 129, in configure
configure(ctx, py, yaml, skip_service_validation)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/settings.py”, line 158, in configure
skip_service_validation=skip_service_validation,
File “/usr/local/lib/python3.6/site-packages/sentry/runner/initializer.py”, line 380, in initialize_app
setup_services(validate=not skip_service_validation)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/initializer.py”, line 422, in setup_services
service.validate()
File “/usr/local/lib/python3.6/site-packages/sentry/utils/services.py”, line 105, in
context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
File “/usr/local/lib/python3.6/site-packages/sentry/buffer/redis.py”, line 69, in validate
raise InvalidConfiguration(six.text_type(e))
sentry.exceptions.InvalidConfiguration: AUTH called without any password configured for the default user. Are you sure your configuration is correct?

Even I tried these variables REDIS_HOST and REDIS_PASSWORD, but the error persists. Could you please tell me which env variable to be used to get rid off this error ?

We do not support using env variables or an external redis instance on our GitHub - getsentry/onpremise: Sentry On-Premise setup repo. If you want to change some settings you need to use a custom configuration file.

Thanks for the response. I made my own configuration file to take into account env variables below in sentry.conf.py

redis = env("SENTRY_REDIS_HOST") or (env("REDIS_PORT_6379_TCP_ADDR") and "redis")
if not redis:
    raise Exception(
        "Error: REDIS_PORT_6379_TCP_ADDR (or SENTRY_REDIS_HOST) is undefined, did you forget to `--link` a redis container?"
    )

redis_password = env("SENTRY_REDIS_PASSWORD") or ""
redis_port = env("SENTRY_REDIS_PORT") or "6379"
redis_db = env("SENTRY_REDIS_DB") or "0"

SENTRY_OPTIONS.update(
    {
        "redis.clusters": {
            "default": {
                "hosts": {
                    0: {
                        "host": redis,
                        "password": redis_password,
                        "port": redis_port,
                        "db": redis_db,
                    }
                }
            }
        }
    }
)