opendcim/openDCIM

23.04 bulk Cabinet importer is broken - bulk_cabinet.php

Closed this issue · 1 comments

23.04 DCIM - Bulk Cabinet importer fails after processing upload file

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://dev.opendcim.org/index.php and login dcim/dcim
  2. Attached is a single line bulk import csv file to add a cabinet to your datacenter "Test"
  3. Go to Bulk Importer and select Bulk Cabinet import.
  4. Upload the attached csv file
  5. verify the contents and then hit process.
  6. It fails with a ----- This page isn’t workingdev.opendcim.org is currently unable to handle this request.
    HTTP ERROR 500

Looked at bulk_importer.php and found...

From bulk_cabinets.php original (v.23.04): lines 139 to 144
• Fails to load cabinets from clean file that demonstrated clean import on v21.*
• Fails with an http 500 error.
dcim_bulk_cabinets_php.png

Then added these lines from bulk_importer.php
else {
$row[$fname] = "";
}

From bulk_importer.php original (v23.04): lines 165 to 173
• Works loading devices
dcim_bulk_cabinets_fix.png

Modified the bulk_cabinets.php file to match the bulk_importer.php snippet and demonstrated a clean adding of cabinets using the exact file that it had failed on previously.

Is this a good fix? What say you guys?

Please let us know...

Chris B.

On another note:
I have a big dataset ~44000 lines and couldn't get the report_assets_Excel.php report to work. I edited line 151 of this file and increased my memory for the file to 2048M and now the report works effortlessly.

dcim_bulk_cabinets_php

dcim_bulk_cabinets_php_fix