New installation of Netbox on Ubuntu 18 with Apache - Unable to add Power Feeds or Panels #3892

Closed
opened 2025-12-29 18:31:50 +01:00 by adam · 0 comments
Owner

Originally created by @nathanaelpearson on GitHub (Jul 24, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6.9
  • NetBox version: v2.8.8

Steps to Reproduce

  1. New installation on Ubuntu 18 with Apache
  2. click 'Add' on Power Feeds or Power Panels
  3. Error received

Expected Behavior

This error means that I could not use/access the page

Observed Behavior

Internal Server Error: /dcim/power-feeds/add/
UnicodeDecodeError at /dcim/power-feeds/add/ 'ascii' codec can't decode byte 0xe2 in position 280: ordinal not in range(128)

Resolution Steps

In /opt/netbox/netbox/utilities/templatetags/helpers.py around line 174 where the exception is raised:
with open(path) as docfile:
content = docfile.read()

Changed to:
with open(path, encoding="utf-8") as docfile:
content = docfile.read()

with the above change I am now able to open the page successfully.

Originally created by @nathanaelpearson on GitHub (Jul 24, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6.9 * NetBox version: v2.8.8 ### Steps to Reproduce 1. New installation on Ubuntu 18 with Apache 2. click 'Add' on Power Feeds or Power Panels 3. Error received ### Expected Behavior This error means that I could not use/access the page ### Observed Behavior Internal Server Error: /dcim/power-feeds/add/ UnicodeDecodeError at /dcim/power-feeds/add/ 'ascii' codec can't decode byte 0xe2 in position 280: ordinal not in range(128) ### Resolution Steps In /opt/netbox/netbox/utilities/templatetags/helpers.py around line 174 where the exception is raised: with open(path) as docfile: content = docfile.read() Changed to: with open(path, encoding="utf-8") as docfile: content = docfile.read() with the above change I am now able to open the page successfully.
adam added the type: bugstatus: accepted labels 2025-12-29 18:31:50 +01:00
adam closed this issue 2025-12-29 18:31:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3892