NAL-i5K / tripal_eutils

ncbi loader via the eutils interface
GNU General Public License v3.0
4 stars 3 forks source link

Incorrect parameters passed to tripal_report_error() #228

Closed dsenalik closed 1 year ago

dsenalik commented 3 years ago

Example error message: Object of class TripalJob could not be converted to string tripal.notice.api.inc:135

In the file tripal_eutils.module there is a missing parameter in a call to tripal_report_error() and so if there is an error the actual message is lost and replaced with the example shown above

A simple fix though

Ferrisx4 commented 3 years ago

Hi @dsenalik, thanks for submitting. Do you have an example of what was going on when this error happened?

dsenalik commented 3 years ago

Example: Loading "Assembly" with "Create Linked Records" checked for GCA_902728035.1

The "real" error is then

INFO (TRIPAL_EUTILS): Inserting record into Chado: assembly: 6609631
Inserting record into Chado: assembly: 6609631
ERROR (TRIPAL_EUTILS): SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "program" violates not-null constraint
DETAIL:  Failing row contains (75, Apium_graveolens, , null, null, , SAMEA6463266, , , 2020-04-02 00:00:00).
[site http://default] [TRIPAL ERROR] [TRIPAL_EUTILS] SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "program" violates not-null constraint
mpoelchau commented 3 years ago

@dsenalik any ideas why that NCBI assembly record doesn't have an assembly method? Tripal Eutils searches for this and adds it to the (required) program and programversion fields in the analysis record. We assumed that NCBI assembly records would always include an assembly method, but it looks like we were wrong.

dsenalik commented 3 years ago

No idea, but weird records in NCBI are not that unusual. I will be submitting an additional commit to this pull request to create a default value if none is available, since the two problems were kind of related.

Ferrisx4 commented 3 years ago

@dsenalik thanks you for the changes for the call to tripal_report_error(). I tested it and was able to properly view the error (as you had).

The error with the null program value from NCBI does seem sufficiently different, so for the purposes of ongoing discussion and issue searching in the future, I propose to make it its own issue.

dsenalik commented 3 years ago

Oops I just added that commit. Should I undo that and create the new issue? Or just create an issue and point to this commit?

Ferrisx4 commented 3 years ago

That's OK. We can still create the issue and point it here. The only discussion I thought we might have is how to handle missing program values. Monica is on board with the placeholder text so I think we are set on this.

dsenalik commented 3 years ago

See Issue #230 for a separate issue describing the error from the missing Assembly method field.