CSV import/export broken #5332

Closed
opened 2025-12-29 19:26:49 +01:00 by adam · 3 comments
Owner

Originally created by @androck on GitHub (Sep 7, 2021).

NetBox version

v3.0.1

Python version

3.9

Steps to Reproduce

  1. We used Docker image "netboxcommunity/netbox:v3.0" with docker-compose.override.yml:
    version: '3.4'
    services:
    netbox:
    ports:

    • 9999:8080
  2. Frontend is showing version "5801d8a29311 (v3.0.1)"

  3. Use Export button to get CSV File (e.g. Sites, Racks, Current View or All Data)

  4. Try to import data again via Copy&Paste Field or CSV File Upload
    Example CSV:
    Name,Slug,Status,Facility,Region,Group,Tenant,ASN,Time zone,Description,Physical address,Shipping address,Latitude,Longitude,Contact name,Contact phone,Contact E-mail,Tags
    FFM158,ffm158,Active,,MUC,,,,,,,,,,,,,

Expected Behavior

I would expect that I can export and reimport CSV data for backups purposes.

Observed Behavior

Import fails via copy & paste field or CSV file upload.
In case of file upload, no error message but unsuccesful.
In case of copy & paste, error message is "Row 1 status: Select a valid choice. Active is not one of the available choices."

It is quite obvious that this is a case-sensitive problem. Version 2 export is lowercase. Version 3 changed to leading uppercase.
When I change the column line to lowercase, as well as fixed values ("Active" -> "active"), the import is successful again.

Originally created by @androck on GitHub (Sep 7, 2021). ### NetBox version v3.0.1 ### Python version 3.9 ### Steps to Reproduce 1. We used Docker image "netboxcommunity/netbox:v3.0" with docker-compose.override.yml: version: '3.4' services: netbox: ports: - 9999:8080 2. Frontend is showing version "5801d8a29311 (v3.0.1)" 3. Use Export button to get CSV File (e.g. Sites, Racks, Current View or All Data) 4. Try to import data again via Copy&Paste Field or CSV File Upload Example CSV: Name,Slug,Status,Facility,Region,Group,Tenant,ASN,Time zone,Description,Physical address,Shipping address,Latitude,Longitude,Contact name,Contact phone,Contact E-mail,Tags FFM158,ffm158,Active,,MUC,,,,,,,,,,,,, ### Expected Behavior I would expect that I can export and reimport CSV data for backups purposes. ### Observed Behavior Import fails via copy & paste field or CSV file upload. In case of file upload, no error message but unsuccesful. In case of copy & paste, error message is "Row 1 status: Select a valid choice. Active is not one of the available choices." It is quite obvious that this is a case-sensitive problem. Version 2 export is lowercase. Version 3 changed to leading uppercase. When I change the column line to lowercase, as well as fixed values ("Active" -> "active"), the import is successful again.
adam added the type: bug label 2025-12-29 19:26:49 +01:00
adam closed this issue 2025-12-29 19:26:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 7, 2021):

The output of the export function is not necessarily compatible with the import function, and in many cases cannot be for various reasons. Please search for other issues in which this has already been discussed if you're interested in learning more.

@jeremystretch commented on GitHub (Sep 7, 2021): The output of the export function is not necessarily compatible with the import function, and in many cases cannot be for various reasons. Please search for other issues in which this has already been discussed if you're interested in learning more.
Author
Owner

@androck commented on GitHub (Sep 7, 2021):

I understand the complexity of exporting/importing this type of data.
But an inconsistent use of lower and uppercases is propably not that hard to fix...

@androck commented on GitHub (Sep 7, 2021): I understand the complexity of exporting/importing this type of data. But an inconsistent use of lower and uppercases is propably not that hard to fix...
Author
Owner

@jeremystretch commented on GitHub (Sep 7, 2021):

The difference in casing (and punctuation) is intentional. Export data is intended for human consumption, whereas import data is expected to be in a "machine-friendly" (minimized) format.

@jeremystretch commented on GitHub (Sep 7, 2021): The difference in casing (and punctuation) is intentional. Export data is intended for human consumption, whereas import data is expected to be in a "machine-friendly" (minimized) format.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5332