Skip to content
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

Blast returns "The search completed and returned 0 hits" when it fails to run #398

Closed
kennyAgricultureVic opened this issue Jul 5, 2024 · 3 comments
Assignees

Comments

@kennyAgricultureVic
Copy link
Contributor

kennyAgricultureVic commented Jul 5, 2024

Errors are not being passed back to the front end

Image


Introduction

There are 2 concerns here :

  • errors in the process of Blast search are causing an empty result.
    The error causes were investigated, identified in DNA Sequence Search (Blast) getting errors and returning an empty result to the GUI #401, which records their resolution.

  • the errors were logged in the blast server log file, but not propagated to the GUI, which is the focus of this issue.
    The goal is to ensure that server configuration errors do not present as empty search results, which is misleading. By displaying the error message the Pretzel administrators of the system and the data configuration are enabled to solve the error more readily.


Testing

The errors can be simulated by making one of the Blast database files unreadable, and then performing a DNA Sequence search of that dataset using the Pretzel GUI.
The server log error message will be displayed in the GUI.

@Don-Isdale
Copy link
Collaborator

Don-Isdale commented Jul 12, 2024

Deliver errors from blastServer micro-service to web application GUI

The Flask server by default does not deliver error status and error messages on stderr in the reply.
Code will be added to receive error status and error messages on stderr and convey them in the reply message.

  • capture error status and error message from blastn_cont.bash in blastServer.py , and send them in the reply message.
  • set this up on the test server for testing
    Tested OK. It was initially displaying just 'Error' instead of the message text, but a fix for the following has been prototyped to address that :
    • the server is sending back text/html instead of application/json
      • Added header : accept: 'application/json'
      • extract the error message text from the html response

Progress

To make it easier to propagate the error information back through the layers of the blast server the blastn_cont.bash has been converted to Python blastn_cont.py so it can be called directly as a library function within the blast server, instead of via Flask-Shell2HTTP which then calls out to a bash command process. This is working, and results are shown following.
As an alternative, the other script called in the blast server, dnaSequenceLookup.bash, has a facility to return errors and warning messages by including them in stdout, prepended with Error: or Warning:. If this works for dnaSequenceSearch.bash then it may be the easiest solution, with fairly limited local changes.


request_json {"args": ["@query.fasta", "Hordeum_vulgare_RGT_Planet_v1"]}
/local-ssd/blast/datasetId
/local-ssd/blast/datasetId/Hordeum_vulgare_RGT_Planet_v1.dbName
Hordeum_vulgare_RGT_Planet_v1.dir/190509_RGT_Planet_pseudomolecules_V1.fasta
127.0.0.1 - - [16/Jul/2024 17:34:46] "POST /blastn HTTP/1.1" 200 -

{
  "status": 0,
  "stderrText": "",
  "stdoutText": "WAPO1\tchr7H\t94.086\t186\t8\t2\t1\t183\t466297873\t466297688\t3.55e-73\t279\t183\t632401812\n"
}

curl -X POST -H 'Accept: application/json' -H 'Content-Type: multipart/form-data' -F query.fasta=@queries/f569bbfa.query.fasta -F 'request_json={"args": ["@query.fasta", "XXX"]}' http://localhost:4010/blastn

request_json {"args": ["@query.fasta", "XXX"]}
/local-ssd/blast/datasetId
/local-ssd/blast/datasetId/XXX.dbName
127.0.0.1 - - [16/Jul/2024 17:36:16] "POST /blastn HTTP/1.1" 500 -

{
  "error": "[Errno 2] No such file or directory: '/local-ssd/blast/datasetId/XXX.dbName'"
}


Commits

[feature/workingGroup3_383_GenotypeSearch 051950c] closes #398 : display blast errors in GUI to distinguish errors from empty results

Don-Isdale added a commit that referenced this issue Jul 22, 2024
…empty results

feature.js : dnaSequenceSearch() : searchDataOut() : use ErrorStatus() to include status 400 in the error passed back.
blastServer.py : allow path of pretzel worktree to be configured - use os.getenv('pretzelDir') in place of /home/ec2-user/pretzel.
blastn_cont.bash : discard stdout of which blastn as only the status is required.

blastn_request.bash :
Handle ~/log being a soft link by appending /. in -d expression.
Add variable errorFile : blastn.error.
Move definitions of resultDir and resultFile before the first curl so they can be used there also. resultFile : use basename because  may be a path.
Introduce hostIpDefault to enable FLASK_PORT to be used to override the default 4000.
From feature/blastn_contPy 34652180 in .A3 : split up the curl command pipelines to access the exit status of curl.
If the curl result has a non-empty .error field, output it prefixed by 'Error:'.
Use --no-progress-meter instead of -s to suppress the progress-meter, so that error messages are output.

dnaSequenceSearch.bash : in defining blastn in the container case : if resourcesDir is not an absolute path, prefix blastn with serverDir; this was used in development, with servers running from the command line.
@Don-Isdale
Copy link
Collaborator

Complete

The listed items for this task are complete and were tested on the test server and then committed.
They will be tested again when that commit is built on the test server, and this issue can be re-opened as necessary.

@gabrielkg
Copy link
Member

Merged into feature/upgradeFrontend2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants