opendcim / openDCIM

An open source (GPL v3) Data Center Inventory Management (DCIM) application.
http://opendcim.org
306 stars 205 forks source link

Modifying the number of ports on a device is trying to recreate existing ports, throwing Error 500 #1393

Closed samilliken closed 1 year ago

samilliken commented 1 year ago

Take any device in DCIM and try to increase the number of ports (or change the devicetype, etc).

[Tue Jul 11 08:38:31.082212 2023] [php:error] [pid 22] [client 10.42.208.10:50304] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7-1' for key 'fac_Ports.PRIMARY' in /var/www/html/classes/DevicePorts.class.php:129\nStack trace:\n#0 /var/www/html/classes/DevicePorts.class.php(129): PDO->query()\n#1 /var/www/html/classes/DevicePorts.class.php(204): DevicePorts->createPort()\n#2 /var/www/html/classes/Device.class.php(860): DevicePorts::createPorts()\n#3 /var/www/html/devices.php(707): Device->UpdateDevice()\n#4 {main}\n thrown in /var/www/html/classes/DevicePorts.class.php on line 129, referer: https://dcim.cadmuslabs.net/devices.php?DeviceID=7 10.42.208.10 - - [11/Jul/2023:08:38:30 -0400] "POST /devices.php?DeviceID=7 HTTP/1.1" 500 295 "https://dcim.cadmuslabs.net/devices.php?DeviceID=7" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"