sureshanaparti opened a new issue #4127:
URL: https://github.com/apache/cloudstack/issues/4127
### Description
<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and master branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete
the comments.
-->
The template download fails immediately with error msg: Steam closed for
templates with invalid file format. The proper error message has to be reported
when the download template/ISO fails due to invalid file format.
The file format is validated in SSVM using the output of cmd: "file
<template-file> | cut -d: -f2", after downloading atleast 1MB of data.
##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
* Improvement Request
##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
Template, SSVM
~~~
##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on master
branch.
-->
~~~
4.13.0
~~~
##### CONFIGURATION
<!--
Information about the configuration if relevant, e.g. basic network,
advanced networking, etc. N/A otherwise
-->
##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->
##### SUMMARY
<!-- Explain the problem/feature briefly -->
The Http template downloader in SSVM is aborting the connection immediately
for the templates with invalid file format, and the template download fails
with error msg: Stream closed as shown in below logs. The proper error message
has to be reported when the download template/ISO fails due to invalid file
format.
The file format is validated in SSVM using the output of cmd: "file
<template-file> | cut -d: -f2", after downloading atleast 1MB of data.
logs:
~~~
Jun 3 07:17:22 s-2-VM _run.sh[1312]: 07:17:22,750 INFO
HttpTemplateDownloader:207 - Starting download from http://***/****.ova to
/mnt/SecStorage/802dfb3b-f7ef-3aec-9f46-c3dc12358ac8/template/tmpl/2/210/dnld982911992150124927tmp_
remoteSize=17536495476 , max size=53687091200
Jun 3 07:17:23 s-2-VM _run.sh[1312]: 07:17:23,372 INFO
DownloadManagerImpl:270 - Download Completion for jobId:
0a4b329e-7698-4878-9d7d-0ea27c9796bd, status=UNRECOVERABLE_ERROR
Jun 3 07:17:23 s-2-VM _run.sh[1312]: 07:17:23,372 INFO
DownloadManagerImpl:271 - local:
/mnt/SecStorage/802dfb3b-f7ef-3aec-9f46-c3dc12358ac8/template/tmpl/2/210/dnld982911992150124927tmp_,
bytes=1104917, error=Stream closed, pct=0
~~~
##### STEPS TO REPRODUCE
<!--
For bugs, show exactly how to reproduce the problem, using a minimal
test-case. Use Screenshots if accurate.
For new features, show how the feature would be used.
-->
1) Take any invalid OVA/other template
Confirm the template is invalid using below steps:
- Check the template file format using cmd: "file <template-file> |
cut -d: -f2"
- Deploy VM from that template in the VMware/other respective
hypervisor directly
2) Register that template in CloudStack
<!-- Paste example playbooks or commands between quotes below -->
<!-- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
CloudStack should report error as "Invalid file format"
##### ACTUAL RESULTS
<!-- What actually happened? -->
CloudStack reports error as "Stream closed".
<!-- Paste verbatim command output between quotes below -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]