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

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

Open
NShaforostov opened this issue Nov 6, 2019 · 2 comments
Assignees
Labels
kind/bug Something isn't working kind/question Further information is requested

Comments

@NShaforostov
Copy link
Collaborator

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:

  • Cloud Provider: N/A
  • Version: 0.16.0.3326.baa436998d5541afca887e14746c1db3bc8bcd39
  • Browser: chrome, Mozilla Firefox, MS Edge
@AleksandrGorodetskii
Copy link
Collaborator

AleksandrGorodetskii commented Dec 11, 2019

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
Copy link
Collaborator

This issue is partially fixed by #836 pull request.

  • Added check for error validation inside Blob object.
  • If there is status: error in Blob - file prevent to be generated and downloaded to user's PC. User will see warning popover instead.
  • Double downloads fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants