aces / Loris

LORIS is a web-accessible database solution for longitudinal multi-site studies.
GNU General Public License v3.0
141 stars 173 forks source link

[imaging_uploader] Auto-launch failure not reported in server process manager module #9290

Open nicolasbrossard opened 1 month ago

nicolasbrossard commented 1 month ago

This PR fixes both the imaging uploader and server process manager module so that the test case #19 in the imaging uploader's test plan succeeds:

Set the config setting 'ImagingUploader auto launch' to 'Yes'. Then, edit your prod file (in <LORIS MRI code dir>/dicom-archive/.loris-mri) and comment out the definition of the @db array. Once these operations are done, upload any valid scan: check in the server processes manager that this fails with an error code of 4. Now try to upload the scan again. When the system asks you if you want to overwrite the existing archive, answer 'Yes'. Check that this reupload fails with error code 4 (and not 2). Related to Redmine#14093 and PR#3555. [Manual Testing]

Fixes #8822

CamilleBeau commented 4 weeks ago

@nicolasbrossard I am getting this error when uploading a file:

image

[Thu Jun 06 10:28:11.349250 2024] [php:error] [pid 15234] [client 192.168.122.1:50644] PHP Fatal error: Uncaught ValueError: mime_content_type(): Argument #1 ($filename) cannot be empty in /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc:643\nStack trace:\n#0 /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc(643): mime_content_type()\n#1 /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc(296): LORIS\\imaging_uploader\\Imaging_Uploader->isCompressed()\n#2 /var/www/loris/php/libraries/File_Upload.class.inc(220): LORIS\\imaging_uploader\\Imaging_Uploader->isValid()\n#3 /var/www/loris/php/libraries/File_Upload.class.inc(110): File_Upload->callFileHandler()\n#4 /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc(252): File_Upload->processFiles()\n#5 /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc(149): LORIS\\imaging_uploader\\Imaging_Uploader->_saveFile()\n#6 /var/www/loris/php/libraries/NDB_Menu_Filter_Form.class.inc(82): LORIS\\imaging_uploader\\Imaging_Uploader->_process()\n#7 /var/www/loris/php/libraries/LorisForm.class.inc(1453): NDB_Menu_Filter_Form->_save()\n#8 /var/www/loris/php/libraries/NDB_Menu_Filter_Form.class.inc(50): LorisForm->process()\n#9 /var/www/loris/php/libraries/NDB_Menu_Filter_Form.class.inc(110): NDB_Menu_Filter_Form->save()\n#10 /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(247): NDB_Menu_Filter_Form->handle()\n#11 /var/www/loris/src/Middleware/PageDecorationMiddleware.php(58): LORIS\\Middleware\\UserPageDecorationMiddleware->process()\n#12 /var/www/loris/php/libraries/NDB_Page.class.inc(725): LORIS\\Middleware\\PageDecorationMiddleware->process()\n#13 /var/www/loris/php/libraries/Module.class.inc(321): NDB_Page->process()\n#14 /var/www/loris/src/Middleware/ResponseGenerator.php(50): Module->handle()\n#15 /var/www/loris/src/Middleware/AuthMiddleware.php(63): LORIS\\Middleware\\ResponseGenerator->process()\n#16 /var/www/loris/src/Router/ModuleRouter.php(74): LORIS\\Middleware\\AuthMiddleware->process()\n#17 /var/www/loris/src/Middleware/ExceptionHandlingMiddleware.php(54): LORIS\\Router\\ModuleRouter->handle()\n#18 /var/www/loris/src/Router/BaseRouter.php(132): LORIS\\Middleware\\ExceptionHandlingMiddleware->process()\n#19 /var/www/loris/src/Middleware/ResponseGenerator.php(50): LORIS\\Router\\BaseRouter->handle()\n#20 /var/www/loris/src/Middleware/ContentLength.php(52): LORIS\\Middleware\\ResponseGenerator->process()\n#21 /var/www/loris/htdocs/index.php(73): LORIS\\Middleware\\ContentLength->process()\n#22 {main}\n thrown in /var/www/loris/modules/imaging_uploader/php/imaging_uploader.class.inc on line 643, referer: https://cbeaudoin-dev.loris.ca/imaging_uploader/

I'm not sure if there is something wrong in my setup. This is how I tested:

  1. Checked out this PR
  2. Checkout out main branch for loris-MRI code
  3. Set autolaunch to "yes" in configuration
  4. Update imaging pipeline for correct paths in configuration
  5. Downloaded a scan from my 26 testing VM for DCC702 V3
  6. Deleted the upload for the scan that I downloaded
  7. Commented out the DB definition from my prod file
  8. tried to upload the .tar.gz file of dicoms for DCC702 V3

Let me know if there's something else I should try