Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding power connections to a device causes a 500 server error #1555

Open
abeeson opened this issue Aug 27, 2024 · 0 comments
Open

Adding power connections to a device causes a 500 server error #1555

abeeson opened this issue Aug 27, 2024 · 0 comments

Comments

@abeeson
Copy link

abeeson commented Aug 27, 2024

Describe the bug
Attempting to increase the power connections on a device by incrementing the value, either by manually typing then pressing update, or by hitting the arrow and having it dynamically load immediately results in a 500 error.

Looking in the PHP error log from our instance this is reported:
[27-Aug-2024 16:34:48 Australia/Sydney] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '401-1' for key 'PRIMARY' in /var/www/html/dciminf/classes/PowerPorts.class.php:106
Stack trace:
#0 /var/www/html/dciminf/classes/PowerPorts.class.php(106): PDO->query()
#1 /var/www/html/dciminf/classes/PowerPorts.class.php(152): PowerPorts->createPort()
#2 /var/www/html/dciminf/classes/Device.class.php(899): PowerPorts::createPorts()
#3 /var/www/html/dciminf/devices.php(723): Device->UpdateDevice()
#4 {main}
thrown in /var/www/html/dciminf/classes/PowerPorts.class.php on line 106

(The above PHP error was for device ID 401, adding power connection 2)

This is likely related to this issue: #1552 as the descriptions are similar.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a network device in a rack (https://demo.opendcim.org/devices.php?DeviceID=1)
  2. Click on the power connections field
  3. Press the up arrow to change it from 2 to 3
  4. See error 500 page that loads

Note: the value will increment and save, to return it back you need to reload the device, drop the value back down and then save the update.

To work around this to add/restore connections, you can delete all the power connections by setting it to 0 and pressing delete on them, then edit the value to the desired number by typing it and pressing save. This only works on initial creation of power connections, so fixing it requires blowing them all away and recreating.

Were you able to reproduce this on the dev or demo sites?
Yes, see demo device linked in reproduction steps

Expected behavior
Power connection adds like data ports does.

Screenshots
N/A, 500 error is essentially blank so nothing to show

Desktop (please complete the following information):

  • OS: Tested on OSX and Windows
  • Browser: Firefox and Chrome
  • Version: various
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant