Usage of emoji in/as SSID #9560

Closed
opened 2025-12-29 21:18:58 +01:00 by adam · 4 comments
Owner

Originally created by @dduransseau on GitHub (Apr 30, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.6

Python Version

3.10

Steps to Reproduce

  1. Create a wifi lan with an emoji in the SSID

Expected Behavior

Emoji should be accepted as SSID since it's accepted by modern system.

Observed Behavior

<class 'django.db.utils.NotSupportedError'>

conversion between UTF8 and SQL_ASCII is not supported
LINE 1: ...id, 'create', 137, 1, NULL, NULL, '🙄', NULL,  E'{"created":...
                                                             ^

Python version: 3.10.12
NetBox version: 3.7.6
Plugins: None installed
Originally created by @dduransseau on GitHub (Apr 30, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.6 ### Python Version 3.10 ### Steps to Reproduce 1. Create a wifi lan with an emoji in the SSID ### Expected Behavior Emoji should be accepted as SSID since it's accepted by modern system. ### Observed Behavior ``` <class 'django.db.utils.NotSupportedError'> conversion between UTF8 and SQL_ASCII is not supported LINE 1: ...id, 'create', 137, 1, NULL, NULL, '🙄', NULL, E'{"created":... ^ Python version: 3.10.12 NetBox version: 3.7.6 Plugins: None installed ```
adam added the status: revisions needed label 2025-12-29 21:18:58 +01:00
adam closed this issue 2025-12-29 21:18:59 +01:00
Author
Owner

@arthanson commented on GitHub (Apr 30, 2024):

@dduransseau This looks like a database encoding issue, your database only supports ASCII, it needs to be changed to support unicode.

@arthanson commented on GitHub (Apr 30, 2024): @dduransseau This looks like a database encoding issue, your database only supports ASCII, it needs to be changed to support unicode.
Author
Owner

@peteeckel commented on GitHub (Apr 30, 2024):

Try the following:

(netbox) # /opt/netbox/netbox/manage.py dbshell
psql (15.5)
Type "help" for help.

netbox=# \l
                                                   List of databases
     Name      |  Owner   | Encoding |   Collate   |    Ctype    | ICU Locale | Locale Provider |   Access privileges   
---------------+----------+----------+-------------+-------------+------------+-----------------+-----------------------
 netbox        | netbox   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | 
 postgres      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | 
 template0     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
               |          |          |             |             |            |                 | postgres=CTc/postgres
 template1     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +
               |          |          |             |             |            |                 | postgres=CTc/postgres
(4 rows)

How does the result look like on your server? Normally the NetBox installation guide is correct, and it does not say anything about specifying the encoding of the database, but if you are using a database server that is not installed specifically for NetBox the encoding of the template1 database might have been changed.

In this case the procedure in the NetBox installation guide will lead to the netbox database having the wrong encoding, which can lead to all kinds of problems.

Maybe that would count as a documentation issue.

@peteeckel commented on GitHub (Apr 30, 2024): Try the following: ``` (netbox) # /opt/netbox/netbox/manage.py dbshell psql (15.5) Type "help" for help. netbox=# \l List of databases Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges ---------------+----------+----------+-------------+-------------+------------+-----------------+----------------------- netbox | netbox | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | =c/postgres + | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | =c/postgres + | | | | | | | postgres=CTc/postgres (4 rows) ``` How does the result look like on your server? Normally the NetBox installation guide is correct, and it does not say anything about specifying the encoding of the database, **but** if you are using a database server that is not installed specifically for NetBox the encoding of the `template1` database might have been changed. In this case the procedure in the NetBox installation guide will lead to the `netbox` database having the wrong encoding, which can lead to all kinds of problems. Maybe that would count as a documentation issue.
Author
Owner

@peteeckel commented on GitHub (Apr 30, 2024):

@dduransseau This looks like a database encoding issue, your database only supports ASCII, it needs to be changed to support unicode.

The only reasonably safe way to change the encoding of the database is to export and delete it, then recreate with the correct encoding and collation sequences.

@peteeckel commented on GitHub (Apr 30, 2024): > @dduransseau This looks like a database encoding issue, your database only supports ASCII, it needs to be changed to support unicode. The only reasonably safe way to change the encoding of the database is to export and delete it, then recreate with the correct encoding and collation sequences.
Author
Owner

@dduransseau commented on GitHub (May 1, 2024):

Hi @arthanson and @peteeckel you was right this was a database encoding issue, the encoding was "SQL_ASCII", I exported and created back the DB with UTF8 and this solve the issue.
The postgresql instance that I used for netbox is a shared one so as you mention I didn't pay attention on encoding during creation. Thanks anyway for the guidance.

@dduransseau commented on GitHub (May 1, 2024): Hi @arthanson and @peteeckel you was right this was a database encoding issue, the encoding was "SQL_ASCII", I exported and created back the DB with UTF8 and this solve the issue. The postgresql instance that I used for netbox is a shared one so as you mention I didn't pay attention on encoding during creation. Thanks anyway for the guidance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9560