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

Truncated USS file downloaded #1170

Open
Tracked by #1544
plavjanik opened this issue Oct 19, 2021 · 5 comments
Open
Tracked by #1544

Truncated USS file downloaded #1170

plavjanik opened this issue Oct 19, 2021 · 5 comments
Assignees
Labels
Blocked bug Something isn't working priority-medium Not functioning - next quarter if capacity permits zosmf Issues in z/OSMF that surface in Zowe CLI

Comments

@plavjanik
Copy link

I am downloading a binary file using the following command:

zowe zos-files dl uf /a/mydir/sca.jar -f sca.jar --binary

The download seems to be successful:

USS file downloaded successfully.
Destination: sca.jar

But the file is corrupted. It has been created using jar tool:

cd /usr/lpp/zosmf/installableApps
jar cvf /a/plape03/sca.jar izuCA.ear

But it cannot be opened using jar nor unzip on my computer.

When I have used zftp plugin to download it, I am getting a different size of the file:

-rw-r--r--   1 myuser  staff   9282652 Oct 19 13:24 sca.jar
-rw-r--r--   1 myuser  staff   9291928 Oct 19 11:59 sca3.jar

and the FTP transferred file is ok.

They seem to differ only at the end:
image

@t1m0thyj t1m0thyj self-assigned this Jan 7, 2022
@t1m0thyj
Copy link
Member

I've been able to reproduce this issue when downloading binary data sets or USS files thru z/OSMF.

The issue is not specific to Zowe CLI as cURL also truncates the end of the file. It only happens when the "Accept-Encoding: gzip" header is passed and the REST response is compressed.

We plan to file an issue with z/OSMF about this, and in the interim to disable gzip compression in Zowe CLI for binary downloads.

@plavjanik
Copy link
Author

Thank you for working on a workaround and reporting it to IBM.

Would not it be possible to activate the workaround based on the z/OSMF version in case that only some versions have this issue?

@t1m0thyj
Copy link
Member

t1m0thyj commented Sep 2, 2022

Sorry for not posting an update on this issue in so long. We have an ongoing case open with the z/OSMF team about this, and they are looking into it.

We have reproduced the issue with the following steps:

  • Create a 4KB file with random contents: dd if=/dev/urandom of=testfile bs=1024 count=4
  • Upload the file to a sequential data set: zowe files upload ftds testfile <dsname> --binary
  • Download the file with cURL
    • Uncompressed: curl -H "X-IBM-Data-Type: binary" "<zosmfUrl>/zosmf/restfiles/ds/<dsname>"
    • Compressed: pass the "Accept-Encoding: gzip" header and --compressed option
  • Notice that the downloaded file is truncated only when gzip compression is enabled

I've added a "Blocked" label for now. Once the issue with z/OSMF is resolved, we can reenable gzip compression in Zowe CLI for binary downloads which should allow us to close this issue.

@t1m0thyj t1m0thyj reopened this Sep 2, 2022
@t1m0thyj
Copy link
Member

t1m0thyj commented Sep 2, 2022

Would not it be possible to activate the workaround based on the z/OSMF version in case that only some versions have this issue?

I don't believe this is a version-specific bug. Gzip compression support is a fairly recent addition to z/OSMF so I think this bug is present in all versions of z/OSMF that support gzip compression.

@gejohnston gejohnston added priority-medium Not functioning - next quarter if capacity permits for-review-pm bug Something isn't working labels Oct 18, 2022
@github-actions
Copy link

Thank you for creating a bug report. If you haven't already, please ensure you have provided steps to reproduce it and as much context as possible.

@t1m0thyj t1m0thyj added the zosmf Issues in z/OSMF that surface in Zowe CLI label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked bug Something isn't working priority-medium Not functioning - next quarter if capacity permits zosmf Issues in z/OSMF that surface in Zowe CLI
Projects
Status: Medium Priority
Development

No branches or pull requests

4 participants