local data source no longer working after v3.5.9 to v3.6.0 migration #8558

Closed
opened 2025-12-29 20:38:11 +01:00 by adam · 4 comments
Owner

Originally created by @chris240189 on GitHub (Sep 1, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v.3.6.0

Python version

3.8

Steps to Reproduce

  1. setup a local folder with a testfile on the machine running netbox
  2. create a data source using that local folder
  3. sync the data source and try to display content of the file

Expected Behavior

the file and its contents displayed in gui.

Observed Behavior

netbox runs into a server error.
<class 'TypeError'>

encoding without a string argument

image

Originally created by @chris240189 on GitHub (Sep 1, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v.3.6.0 ### Python version 3.8 ### Steps to Reproduce 1. setup a local folder with a testfile on the machine running netbox 2. create a data source using that local folder 3. sync the data source and try to display content of the file ### Expected Behavior the file and its contents displayed in gui. ### Observed Behavior netbox runs into a server error. <class 'TypeError'> encoding without a string argument ![image](https://github.com/netbox-community/netbox/assets/48352307/d9da2fd1-e3a9-4b7f-bd5e-70b81a028caa)
adam added the type: bugstatus: acceptedseverity: high labels 2025-12-29 20:38:11 +01:00
adam closed this issue 2025-12-29 20:38:11 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 1, 2023):

It seems that the content returned by a BinaryField has changed in Django 4.2, though I'm not sure why:

# Django 4.1
>>> f = DataFile.objects.first()
>>> f.data
<memory at 0x7f6fbeaede40>

# Django 4.2
>>> f = DataFile.objects.first()
>>> f.data
b"I'm a test file\n"
@jeremystretch commented on GitHub (Sep 1, 2023): It seems that the content returned by a BinaryField has changed in Django 4.2, though I'm not sure why: ``` # Django 4.1 >>> f = DataFile.objects.first() >>> f.data <memory at 0x7f6fbeaede40> # Django 4.2 >>> f = DataFile.objects.first() >>> f.data b"I'm a test file\n" ```
Author
Owner

@bitcollector1 commented on GitHub (Sep 1, 2023):

I can now read the files when I click on them but sync is still failing :(

@bitcollector1 commented on GitHub (Sep 1, 2023): I can now read the files when I click on them but sync is still failing :(
Author
Owner

@jeremystretch commented on GitHub (Sep 1, 2023):

@bitcollector1 please open a new bug report with complete reproduction steps.

@jeremystretch commented on GitHub (Sep 1, 2023): @bitcollector1 please open a new bug report with complete reproduction steps.
Author
Owner

@bitcollector1 commented on GitHub (Sep 1, 2023):

It's working now, I had (2) different issues that needed to be fixed

  1. Dulwich
  2. Edit the data model file
  3. rebuild
Screenshot 2023-09-01 at 08 54 24

Thanks for the quick assistance!

@bitcollector1 commented on GitHub (Sep 1, 2023): It's working now, I had (2) different issues that needed to be fixed 1) Dulwich 2) Edit the data model file 3) rebuild <img width="668" alt="Screenshot 2023-09-01 at 08 54 24" src="https://github.com/netbox-community/netbox/assets/50723251/62fe9b79-5549-4c19-a391-1fedcbd95d90"> Thanks for the quick assistance!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8558