Server Error Importing Cables via .csv #18196
-
I am getting the below error when trying to import .csv file into netbox via cable upload. Wondering if anyone else is getting this same error. Server Error The complete exception is provided below: <class 'UnicodeDecodeError'> 'utf-8' codec can't decode byte 0xa0 in position 165: invalid start byte Python version: 3.10.12 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The error tells you exactly what the problem is: your text file is not valid UTF-8. Specifically, it contains a byte (0xA0) which is not valid as the start of a character in UTF-8. Maybe your CSV file was created on a Windows box and uses some Windows-specific character set like Windows-1252, or on a system using ISO-8859-1. The character 0xA0 is a non-breaking space in both of those encodings. But if it were encoded in UTF-8, it would appear as the two-byte sequence 0xC2 0xA0. Either way, you need to convert the file into valid UTF-8 to fix this. Under Linux, the tool "iconv" can be used to do this. You need to specify the source encoding that you created the CSV file with, and the target encoding as UTF-8. Or, if you created the CSV file by exporting from a spreadsheet like Excel, select the encoding UTF-8 when you save it. |
Beta Was this translation helpful? Give feedback.
The error tells you exactly what the problem is: your text file is not valid UTF-8. Specifically, it contains a byte (0xA0) which is not valid as the start of a character in UTF-8.
Maybe your CSV file was created on a Windows box and uses some Windows-specific character set like Windows-1252, or on a system using ISO-8859-1. The character 0xA0 is a non-breaking space in both of those encodings. But if it were encoded in UTF-8, it would appear as the two-byte sequence 0xC2 0xA0.
Either way, you need to convert the file into valid UTF-8 to fix this. Under Linux, the tool "iconv" can be used to do this. You need to specify the source encoding that you created the CSV file with, and the targe…