-
Notifications
You must be signed in to change notification settings - Fork 179
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
[tools] Tool failures #9611
base: main
Are you sure you want to change the base?
[tools] Tool failures #9611
Conversation
@jeffersoncasimir these seem to be mostly the CandID changes (with 1 or 2 lorisInstance ones). Can you review? |
@skarya22 PHPCS is failing.
|
@skarya22 This PR appears to be based on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, none of these errors seem caused by these changes, but this PR is shining a light on many existing issues.
All scripts were tested with valid inputs with each of their different forks (ex: tosql
, confirm
). They were not tested with "invalid inputs" (ex: non-existing IDs). Non-mentions can be assumed to be tested and functional (no fatal errors).
I ran tools/data_integrity/data_deletion/delete_candidate.php
with confirm
and got the following error:
Dropping all DB entries for candidate CandID: 648507 And PSCID: DRV0005
PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`jcasimir_test_26`.`dataquery_run_results`, CONSTRAINT `dataquery_run_results_ibfk_1` FOREIGN KEY (`CandidateID`) REFERENCES `candidate` (`ID`)) in /var/www/Loris/php/libraries/Database.class.inc:630
Stack trace:
#0 /var/www/Loris/php/libraries/Database.class.inc(630): PDO->exec()
#1 /var/www/Loris/tools/data_integrity/data_deletion/delete_candidate.php(367): Database->delete()
#2 /var/www/Loris/tools/data_integrity/data_deletion/delete_candidate.php(118): deleteCandidate()
#3 {main}
thrown in /var/www/Loris/php/libraries/Database.class.inc on line 630
I ran tools/data_integrity/data_deletion/delete_timepoint.php
with tosql
and got the following error:
PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php:503
Stack trace:
#0 /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php(503): fwrite()
#1 /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php(460): _exportSQL()
#2 /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php(120): deleteTimepoint()
#3 {main}
thrown in /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php on line 503
I ran tools/data_integrity/data_deletion/delete_timepoint.php
with confirm
and got the following error:
PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`jcasimir_test_26`.`physiological_file`, CONSTRAINT `FK_session_ID` FOREIGN KEY (`SessionID`) REFERENCES `session` (`ID`)) in /var/www/Loris/php/libraries/Database.class.inc:630
Stack trace:
#0 /var/www/Loris/php/libraries/Database.class.inc(630): PDO->exec()
#1 /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php(365): Database->delete()
#2 /var/www/Loris/tools/data_integrity/data_deletion/delete_timepoint.php(120): deleteTimepoint()
#3 {main}
thrown in /var/www/Loris/php/libraries/Database.class.inc on line 630
tools/detect_conflicts.php
has this error, when used with -i
:
PHP Fatal error: Uncaught TypeError: getCurrentUnresolvedConflicts(): Return value must be of type array, LORIS\Database\Query returned in /var/www/Loris/tools/detect_conflicts.php:358
Stack trace:
#0 /var/www/Loris/tools/detect_conflicts.php(190): getCurrentUnresolvedConflicts()
#1 {main}
thrown in /var/www/Loris/tools/detect_conflicts.php on line 358
detect_duplicated_commentids.php
has an error, similar to the previous:
PHP Fatal error: Uncaught Error: Cannot use object of type LORIS\Database\Query as array in /var/www/Loris/tools/detect_duplicated_commentids.php:199
Stack trace:
#0 /var/www/Loris/tools/detect_duplicated_commentids.php(127): getCommentIDs()
#1 {main}
thrown in /var/www/Loris/tools/detect_duplicated_commentids.php on line 199
Not sure what to make of this: php fix_timepoint_date_problems.php add_instrument 300001 1 aosi
Error: failed to add the instrument aosi for timepoint (1):
Error: Database user named lorisadmin does not exist. Please create and then retry script
I otherwise approve of the code changes.
@jeffersoncasimir Thank you for catching those! Resolved them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran tools/data_integrity/data_deletion/delete_candidate.php
with tosql
and got the following error:
PHP Fatal error: Uncaught TypeError: preg_match_all(): Argument #2 ($subject) must be of type string, array given in /var/www/Loris/tools/data_integrity/data_deletion/delete_candidate.php:201
I ran tools/data_integrity/data_deletion/delete_candidate.php
with confirm
and got the following error:
PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`jcasimir_test_26`.`physiological_event_file`, CONSTRAINT `FK_physio_file_ID` FOREIGN KEY (`PhysiologicalFileID`) REFERENCES `physiological_file` (`PhysiologicalFileID`)) in /var/www/Loris/php/libraries/Database.class.inc:630
I ran tools/data_integrity/data_deletion/delete_timepoint.php
with confirm
and got the following error (same as delete_candidate
right above -- tosql
is now functional):
PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`jcasimir_test_26`.`physiological_event_file`, CONSTRAINT `FK_physio_file_ID` FOREIGN KEY (`PhysiologicalFileID`) REFERENCES `physiological_file` (`PhysiologicalFileID`)) in /var/www/Loris/php/libraries/Database.class.inc:630
I am struggling to test tools/detect_conflicts.php
in a meaningful way. The previous error is gone, but I can't get it to work with any instrument; it always results in: the instrument is not set or there are no commentids
. When I do -i all
it will fail at this error that will be addressed by another PR:
PHP Fatal error: Uncaught OutOfBoundsException: Invalid field Examiner for instrument bmi in /var/www/Loris/php/libraries/NDB_BVL_Instrument.class.inc:1412
I ran tools/detect_duplicated_commentids.php
and got the following error:
PHP Fatal error: Uncaught DomainException: Attempt to use pselectRow on a query that returns multiple rows in /var/www/Loris/php/libraries/Database.class.inc:848
tools/fix_timepoint_date_problems.php
appears to work as expected!
Brief summary of changes
Closes #9629
Closes #9631
Closes #9633
Testing instructions (if applicable)