Skip to content

Power supply error #377

Description

@dimm0

Describe the bug
dmidecode returns 0 W max power, which is producing an error in netbox agent

Expected behavior
Create the power supply with 0 W

Environment:

  • OS: Ubuntu 22.04
  • Netbox agent version: master

Additional context

Here's the output in dmidecode:

Handle 0x0063, DMI type 39, 22 bytes
System Power Supply
	Location: PSU1
	Name: G1236-3000WNG
	Manufacturer: GOSPOWER
	Serial Number: G1236302NG230400427
	Asset Tag: Not Specified
	Model Part Number: 25EP0-230005-G1S
	Revision: R02
	Max Power Capacity: 0 W
	Status: Present, Unknown
	Type: Unknown
	Input Voltage Range Switching: Unknown
	Plugged: Yes
	Hot Replaceable: No

Error log:

netbox-agent DEBUG:urllib3.connectionpool:https://netbox-4.nrp-nautilus.io:443 "POST /api/dcim/power-ports/ HTTP/1.1" 400 69
netbox-agent Traceback (most recent call last):
netbox-agent   File "/usr/local/bin/netbox_agent", line 8, in <module>
netbox-agent     sys.exit(main())
netbox-agent              ^^^^^^
netbox-agent   File "/usr/local/lib/python3.12/site-packages/netbox_agent/cli.py", line 63, in main
netbox-agent     return run(config)
netbox-agent            ^^^^^^^^^^^
netbox-agent   File "/usr/local/lib/python3.12/site-packages/netbox_agent/cli.py", line 56, in run
netbox-agent     server.netbox_create_or_update(config)
netbox-agent   File "/usr/local/lib/python3.12/site-packages/netbox_agent/server.py", line 435, in netbox_create_or_update
netbox-agent     self.power.create_or_update_power_supply()
netbox-agent   File "/usr/local/lib/python3.12/site-packages/netbox_agent/power.py", line 84, in create_or_update_power_supply
netbox-agent     nb_psu = nb.dcim.power_ports.create(**psu)
netbox-agent              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-agent   File "/usr/local/lib/python3.12/site-packages/pynetbox/core/endpoint.py", line 417, in create
netbox-agent     ).post(args[0] if args else kwargs)
netbox-agent       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-agent   File "/usr/local/lib/python3.12/site-packages/pynetbox/core/query.py", line 370, in post
netbox-agent     return self._make_call(verb="post", data=data)
netbox-agent            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-agent   File "/usr/local/lib/python3.12/site-packages/pynetbox/core/query.py", line 260, in _make_call
netbox-agent     raise RequestError(req)
netbox-agent pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'maximum_draw': ['Ensure this value is greater than or equal to 1.']}
stream closed EOF for netbox-agent/agent-9xbwp (netbox-agent)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions