epam / cloud-pipeline

Cloud agnostic genomics analysis, scientific computation and storage platform
https://cloud-pipeline.com
Apache License 2.0
146 stars 59 forks source link

Attempt to use the "Generate" function over the `docx` document from the pipeline DOCUMENTS tab throws an error #795

Open NShaforostov opened 5 years ago

NShaforostov commented 5 years ago

Describe the bug When trying to use the "Generate" function over the docx document from the pipeline DOCUMENTS tab - two files are downloaded to the local machine, both with the same name, one file is the same as the original docx document and the second contains only the error instead of the document content

To Reproduce Steps to reproduce the behavior:

  1. Open any pipeline, select the DOCUMENTS tab
  2. Upload the document with docx extension
  3. Click the Generate button next to the uploaded document
  4. Wait until files will be downloaded
  5. Open the smaller file in any text editor
  6. See the error: {"message":"Error while executing command python /usr/lib/python2.7/site-packages/scripts/deps_graph.py /opt/api/workspace/git7009710166274989972 config.json: \nTraceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/scripts/deps_graph.py\", line 108, in <module>\n main_file, main_class = parse_config(config, config_name)\n File \"/usr/lib/python2.7/site-packages/scripts/deps_graph.py\", line 91, in parse_config\n return get_main_file_class(item['configuration'])\n File \"/usr/lib/python2.7/site-packages/scripts/deps_graph.py\", line 96, in get_main_file_class\n return config['main_file'][:-3], config['main_class']\nKeyError: 'main_file'","status":"ERROR"}

Expected behavior More convenient and clear error message

Environment:

AleksandrGorodetskii commented 4 years ago

It looks like the request to generate file is correct. The reason why two different files were downloaded was event bubbling from issue #793 (each click to Generate button triggers generate and download methods simultaneously).

The file with content should not be downloaded by clicking on Generate button (the Download button is responsible for this, and click event on Row (which contain buttons) itself). The broken .docx file (with error message as content) downloaded due to the fact that a server response contains error message as a binary Blob object, instead of binary file content. Then this Blob object converted to .docx file.

Request and response body on the picture below:

docx bug

AleksandrGorodetskii commented 4 years ago

This issue is partially fixed by #836 pull request.