Warn user when running downlevel redis server #3928

Closed
opened 2025-12-29 18:32:07 +01:00 by adam · 7 comments
Owner

Originally created by @drmsoffall on GitHub (Aug 1, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.9-beta1

Proposed Functionality

Enhance the upgrade script or the application to verify the version of redis server installed meets NetBox's minimum requirements.

Use Case

Typically the upgrade process does a good job of making sure all required packages are installed, but there's a gap when it comes to the new requirement of redis 4+. While I did eventually figure this out from the redis installation page, it took quite a while because the failure modes are very non-specific, with error messages related to a failure to run a function.

This verification could happen either in upgrade.sh by calling a Python script that reads the configuration and checks the server, or in the startup of the application itself, depending on which is simpler to implement and maintain. While not a critical functionality, I believe it would save time and minimize frustration.

Alternate solution if effort is too great: add a specific call-out in the Upgrading documentation. This wouldn't be as robust, but as long as the user either reads the Upgrading page in advance or falls back to it after experiencing issues, it would get the job done.

Database Changes

None

External Dependencies

None

Originally created by @drmsoffall on GitHub (Aug 1, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.9 * NetBox version: 2.9-beta1 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Enhance the upgrade script or the application to verify the version of redis server installed meets NetBox's minimum requirements. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case Typically the upgrade process does a good job of making sure all required packages are installed, but there's a gap when it comes to the new requirement of redis 4+. While I did eventually figure this out from the redis installation page, it took quite a while because the failure modes are very non-specific, with error messages related to a failure to run a function. This verification could happen either in upgrade.sh by calling a Python script that reads the configuration and checks the server, or in the startup of the application itself, depending on which is simpler to implement and maintain. While not a critical functionality, I believe it would save time and minimize frustration. Alternate solution if effort is too great: add a specific call-out in the Upgrading documentation. This wouldn't be as robust, but as long as the user either reads the Upgrading page in advance or falls back to it after experiencing issues, it would get the job done. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 18:32:07 +01:00
adam closed this issue 2025-12-29 18:32:07 +01:00
Author
Owner

@kobayashi commented on GitHub (Aug 3, 2020):

Is this covered by #4910 ?

@kobayashi commented on GitHub (Aug 3, 2020): Is this covered by #4910 ?
Author
Owner

@jeremystretch commented on GitHub (Aug 3, 2020):

@kobayashi I don't believe so. That issue concerned the version of the Python package installed; this is to check the version of the Redis service itself.

@jeremystretch commented on GitHub (Aug 3, 2020): @kobayashi I don't believe so. That issue concerned the version of the Python package installed; this is to check the version of the Redis service itself.
Author
Owner

@jeremystretch commented on GitHub (Aug 3, 2020):

If implemented, we should consider doing something similar for PostgreSQL as well. I know there's a schema migration somewhere that validates the current minimum required version, but it would be more maintainable long-term to have a consistent check in the upgrade script.

@jeremystretch commented on GitHub (Aug 3, 2020): If implemented, we should consider doing something similar for PostgreSQL as well. I know there's a schema migration somewhere that validates the current minimum required version, but it would be more maintainable long-term to have a consistent check in the upgrade script.
Author
Owner

@tb-killa commented on GitHub (Sep 6, 2020):

@jeremystretch:

For Redis-Version: Use Raw Connect with django-redis http://niwinz.github.io/django-redis/latest/#_raw_client_access and use INFO https://stackoverflow.com/a/22153562

For PostgreSQL: Use Sql Read with SELECT version(); https://stackoverflow.com/a/13733856

What do you think ??

@tb-killa commented on GitHub (Sep 6, 2020): @jeremystretch: For Redis-Version: Use Raw Connect with django-redis http://niwinz.github.io/django-redis/latest/#_raw_client_access and use ``INFO`` https://stackoverflow.com/a/22153562 For PostgreSQL: Use Sql Read with ``SELECT version();`` https://stackoverflow.com/a/13733856 What do you think ??
Author
Owner

@drmsoffall commented on GitHub (Sep 8, 2020):

Although I don't have experience with Django, and wouldn't presume to make architectural decisions, I've been giving this some thought. Here are some things to consider:

  • Any configuration of PostgreSQL or Redis supported by NetBox should be supported by the version checker
    • This implies support for Sentinel and for separate servers for caching and tasks
  • Proper version number comparison isn't simple to implement
    • Could we use Python packaging's version parser, since we already get that with setuptools?
  • The checker should probably be externally callable only as needed, but how do we avoid reinventing the wheel?
    • How about a Django management command? This sounds like overkill at first, but it would allow us to leverage both Django's database connectivity and NetBox's settings validation/parsing rather than duplicating those functions

P.S., for PostgreSQL, how about using SHOW SERVER_VERSION? Less work to extract the numeric version that way!

@drmsoffall commented on GitHub (Sep 8, 2020): Although I don't have experience with Django, and wouldn't presume to make architectural decisions, I've been giving this some thought. Here are some things to consider: - Any configuration of PostgreSQL or Redis supported by NetBox should be supported by the version checker - This implies support for Sentinel and for separate servers for caching and tasks - Proper version number comparison isn't simple to implement - Could we use [Python packaging](https://packaging.pypa.io/en/latest/version/)'s version parser, since we already get that with setuptools? - The checker should probably be externally callable only as needed, but how do we avoid reinventing the wheel? - How about a Django management command? This sounds like overkill at first, but it would allow us to leverage both Django's database connectivity and NetBox's settings validation/parsing rather than duplicating those functions P.S., for PostgreSQL, how about using [SHOW SERVER_VERSION](https://www.postgresql.org/docs/7.4/sql-show.html)? Less work to extract the numeric version that way!
Author
Owner

@stale[bot] commented on GitHub (Oct 23, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Oct 23, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@stale[bot] commented on GitHub (Nov 7, 2020):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@stale[bot] commented on GitHub (Nov 7, 2020): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3928