opendcim / openDCIM

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

Unable to delete devices,cabinet or datacenters #1489

Open WebTeccl opened 9 months ago

WebTeccl commented 9 months ago

Hello, I need you to help me with this problem, when trying to delete a cabinet or a device, or delete the entire datacenter, I get the following error

(I am using version 23.04)

Thank you

thrown in /home/websitec1b/dcim.website.com/cabinets.php on line 29 [14-Dec-2023 23:40:28 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:40:28 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:40:28 America/Santiago] PDO Error::DeleteCabinet: SQL=DELETE FROM fac_Cabinet WHERE CabinetID=0; [14-Dec-2023 23:40:28 America/Santiago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/websitec1b/dcim.website.com/cabinets.php:29 Stack trace:

0 {main}

thrown in /home/websitec1b/dcim.website.com/cabinets.php on line 29 [14-Dec-2023 23:43:01 America/Santiago] PHP Warning: scandir(./assets/drawings/): Failed to open directory: No such file or directory in /home/websitec1b/dcim.website.com/container.php on line 68 [14-Dec-2023 23:43:01 America/Santiago] PHP Warning: scandir(): (errno 2): No such file or directory in /home/websitec1b/dcim.website.com/container.php on line 68 [14-Dec-2023 23:43:01 America/Santiago] PHP Warning: foreach() argument must be of type array|object, bool given in /home/websitec1b/dcim.website.com/container.php on line 69 [14-Dec-2023 23:43:23 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:27 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:27 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:27 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:27 America/Santiago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/websitec1b/dcim.website.com/cabinets.php:29 Stack trace:

0 {main}

thrown in /home/websitec1b/dcim.website.com/cabinets.php on line 29 [14-Dec-2023 23:43:29 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:29 America/Santiago] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/websitec1b/dcim.website.com/classes/Cabinet.class.php on line 68 [14-Dec-2023 23:43:29 America/Santiago] PDO Error::DeleteCabinet: SQL=DELETE FROM fac_Cabinet WHERE CabinetID=1; [14-Dec-2023 23:43:29 America/Santiago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/websitec1b/dcim.website.com/cabinets.php:29 Stack trace:

0 {main}

thrown in /home/websitec1b/dcim.website.com/cabinets.php on line 29

image

wilpig commented 9 months ago

cabinets.php:29 This is setting a return code for the ajax response.

How you managed this one, I cannot fathom because there is no cabinet 0. That's the storage room classification.

[14-Dec-2023 23:40:28 America/Santiago] PDO Error::DeleteCabinet: SQL=DELETE FROM fac_Cabinet WHERE CabinetID=0;

Can you reproduce this error on dev.opendcim.org or demo.opendcim.org? Are there other devices in the cabinet that you are trying to delete with the cabinet? Is this the last cabinet in your datacenter?