New Install - current database's encoding is not supported with this provider #11281

Closed
opened 2025-12-29 21:42:54 +01:00 by adam · 3 comments
Owner

Originally created by @kaboddy on GitHub (Jun 12, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.12

Steps to Reproduce

Same issue as this:
https://github.com/netbox-community/netbox/issues/18416

Expected Behavior

Database works. :)

Observed Behavior

Applying dcim.0195_interface_vlan_translation_policy... OK
Applying dcim.0196_qinq_svlan... OK
Applying dcim.0197_natural_sort_collation...Traceback (most recent call last):

File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
psycopg.errors.FeatureNotSupported: current database's encoding is not supported with this provider

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/netbox-4.3.2/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 353, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 255, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/contrib/postgres/operations.py", line 226, in database_forwards
self.create_collation(schema_editor)
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/contrib/postgres/operations.py", line 200, in create_collation
schema_editor.execute(
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/postgresql/schema.py", line 48, in execute
return super().execute(sql, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 204, in execute
cursor.execute(sql, params)
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.NotSupportedError: current database's encoding is not supported with this provider

Originally created by @kaboddy on GitHub (Jun 12, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.3.2 ### Python Version 3.12 ### Steps to Reproduce Same issue as this: https://github.com/netbox-community/netbox/issues/18416 ### Expected Behavior Database works. :) ### Observed Behavior Applying dcim.0195_interface_vlan_translation_policy... OK Applying dcim.0196_qinq_svlan... OK Applying dcim.0197_natural_sort_collation...Traceback (most recent call last): File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute return self.cursor.execute(sql) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute raise ex.with_traceback(None) psycopg.errors.FeatureNotSupported: current database's encoding is not supported with this provider The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/netbox-4.3.2/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper res = handle_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 353, in handle post_migrate_state = executor.migrate( ^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate state = self._migrate_all_forwards( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards state = self.apply_migration( ^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 255, in apply_migration state = migration.apply(state, schema_editor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply operation.database_forwards( File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/contrib/postgres/operations.py", line 226, in database_forwards self.create_collation(schema_editor) File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/contrib/postgres/operations.py", line 200, in create_collation schema_editor.execute( File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/postgresql/schema.py", line 48, in execute return super().execute(sql, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/base/schema.py", line 204, in execute cursor.execute(sql, params) File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute return self._execute_with_wrappers( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers return executor(sql, params, many, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute with self.db.wrap_database_errors: File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute return self.cursor.execute(sql) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.3.2/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute raise ex.with_traceback(None) django.db.utils.NotSupportedError: current database's encoding is not supported with this provider
adam added the type: bug label 2025-12-29 21:42:54 +01:00
adam closed this issue 2025-12-29 21:42:54 +01:00
Author
Owner

@jnovinger commented on GitHub (Jun 12, 2025):

@kaboddy , what exactly is the new bug here?

You mention this is a duplicate of #18416, which was closed as fixed--the docs were updated around the time of the v4.2.3 release. What am I missing?

@jnovinger commented on GitHub (Jun 12, 2025): @kaboddy , what exactly is the new bug here? You mention this is a duplicate of #18416, which was closed as fixed--the [docs](https://netboxlabs.com/docs/netbox/installation/postgresql/#:~:text=Use%20UTF8%20Encoding) were updated around the time of the v4.2.3 release. What am I missing?
Author
Owner

@kaboddy commented on GitHub (Jun 12, 2025):

I followed the instructions, and they didn't mention anything about the locale settings.

  • Just went back and noticed the SQL_ASCII warning was a subcategory of the Use a Strong Password notice. Guess I missed it.

My postgre install defaulted to SQL_ASCII. Had to apply the fix and add the locale to the OS (Ubuntu) using the locale-gen command.

@kaboddy commented on GitHub (Jun 12, 2025): I followed the instructions, and they didn't mention anything about the locale settings. * Just went back and noticed the SQL_ASCII warning was a subcategory of the Use a Strong Password notice. Guess I missed it. My postgre install defaulted to SQL_ASCII. Had to apply the fix and add the locale to the OS (Ubuntu) using the locale-gen command.
Author
Owner

@jnovinger commented on GitHub (Jun 12, 2025):

Glad to hear you were able to get it sorted.

Just went back and noticed the SQL_ASCII warning was a subcategory of the Use a Strong Password notice.

Oh, that's a good point, I hadn't noticed. I think that's a rendering issue on our docs hub. I'll pass it along.

@jnovinger commented on GitHub (Jun 12, 2025): Glad to hear you were able to get it sorted. > Just went back and noticed the SQL_ASCII warning was a subcategory of the Use a Strong Password notice. Oh, that's a good point, I hadn't noticed. I think that's a rendering issue on our docs hub. I'll pass it along.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11281