NAL-i5K / tripal_eutils

ncbi loader via the eutils interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect parameters passed to tripal_report_error()

dsenalik opened this issue · comments

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

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

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

@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.

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.

@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.

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?

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.

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