Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nautobot Healthchecks fail with Redis Sentinel if password is required #1682

Closed
nniehoff opened this issue Apr 22, 2022 · 0 comments · Fixed by #1683
Closed

Nautobot Healthchecks fail with Redis Sentinel if password is required #1682

nniehoff opened this issue Apr 22, 2022 · 0 comments · Fixed by #1683
Assignees
Labels
type: bug Something isn't working as expected

Comments

@nniehoff
Copy link
Contributor

Environment

  • Python version: 3.7
  • Nautobot version: 1.3

If a password is required for redis + redis sentinel the Nautobot healthcheck fails because the healtcheck code is not passing those values to the redis-py library and therefore failing to connect to redis.

Steps to Reproduce

  1. Create redis + sentinel cluster with a password
  2. Connect Nautobot

Expected Behavior

Nautobot health checks pass

Observed Behavior

$ nautobot-server health_check
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nautobot/extras/health_checks.py", line 46, in check_status
    master.ping()
  File "/usr/local/lib/python3.7/site-packages/redis/commands/core.py", line 1053, in ping
    return self.execute_command("PING", **kwargs)
  File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1215, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1386, in get_connection
    connection.connect()
  File "/usr/local/lib/python3.7/site-packages/redis/sentinel.py", line 56, in connect
    lambda error: None,
  File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 50, in call_with_retry
    raise error
  File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 45, in call_with_retry
    return do()
  File "/usr/local/lib/python3.7/site-packages/redis/sentinel.py", line 44, in _connect_retry
    self.connect_to(self.connection_pool.get_master_address())
  File "/usr/local/lib/python3.7/site-packages/redis/sentinel.py", line 117, in get_master_address
    master_address = self.sentinel_manager.discover_master(self.service_name)
  File "/usr/local/lib/python3.7/site-packages/redis/sentinel.py", line 251, in discover_master
    raise MasterNotFoundError(f"No master found for {service_name!r}")
redis.sentinel.MasterNotFoundError: No master found for 'nautobot'
DatabaseBackend          ... working
DefaultFileStorageHealthCheck ... working
RedisBackend             ... unavailable: Unable to connect to Redis Sentinel: MasterNotFoundError
@bryanculver bryanculver added the type: bug Something isn't working as expected label Apr 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants