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

Reva create error when upload empty file when TUS is enabled #1104

Closed
JarCz opened this issue Aug 19, 2020 · 1 comment · Fixed by #1111
Closed

Reva create error when upload empty file when TUS is enabled #1104

JarCz opened this issue Aug 19, 2020 · 1 comment · Fixed by #1111
Assignees

Comments

@JarCz
Copy link
Contributor

JarCz commented Aug 19, 2020

I tried to upload empty file to Reva when TUS is enabled.
It’s necessary because JupyterLab try to upload empty file when create new file.

Riva version: commit 55bfeb6
Default config from: examples/ocmd/ocmd-server-1.toml

Step to reproduce:

touch zero.txt
echo "Test" > non_zero.txt
./reva --insecure login basic

Creates an error:

./reva --insecure upload ./zero.txt /home/zero.txt
Local file size: 0 bytes
Data server: http://localhost:19001/data/da4b3114-672d-4bf7-9495-484e41816973
Allowed checksums: [type:RESOURCE_CHECKSUM_TYPE_MD5 priority:100  type:RESOURCE_CHECKSUM_TYPE_UNSET priority:1000 ]
Checksum selected: RESOURCE_CHECKSUM_TYPE_MD5
Local XS: RESOURCE_CHECKSUM_TYPE_MD5:d41d8cd98f00b204e9800998ecf8427e
 0 B / ? [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=] 0s
error: code=CODE_NOT_FOUND msg="file not found" support_trace="ec271773afd25787ea2b3b5ca7d6d688"

It’s works:

./reva --insecure upload ./non_zero.txt /home/non_zero.txt
Local file size: 5 bytes
Data server: http://localhost:19001/data/5e159493-7bf0-4aed-8f6f-b27ead52ad7f
Allowed checksums: [type:RESOURCE_CHECKSUM_TYPE_MD5 priority:100  type:RESOURCE_CHECKSUM_TYPE_UNSET priority:1000 ]
Checksum selected: RESOURCE_CHECKSUM_TYPE_MD5
Local XS: RESOURCE_CHECKSUM_TYPE_MD5:2205e48de5f93c784733ffcca841d2b5
 5 B / 5 B [=====================================================================================================================================================================================================================] 100.00% 0s
File uploaded: 123e4567-e89b-12d3-a456-426655440000:fileid-einstein%2Fnon_zero.txt 5 /home/non_zero.txt
@labkode labkode changed the title Riva create error when upload empty file when TUS is enabled Reva create error when upload empty file when TUS is enabled Aug 19, 2020
@ishank011
Copy link
Contributor

For zero size files, this condition fails and so UploadChunk is never called. I'll add a condition to handle this specific case.

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

Successfully merging a pull request may close this issue.

2 participants