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

The difference between written and read binary files #2195

Closed
aseev-xx opened this issue Jul 14, 2021 · 9 comments
Closed

The difference between written and read binary files #2195

aseev-xx opened this issue Jul 14, 2021 · 9 comments

Comments

@aseev-xx
Copy link

Sponsors SeaweedFS via Patreon https://www.patreon.com/seaweedfs
Report issues here. Ask questions here https://stackoverflow.com/questions/tagged/seaweedfs
Please ask questions in https://github.com/chrislusf/seaweedfs/discussions

example of a good issue report:
#1005
example of a bad issue report:
#1008

Describe the bug
We write a binary file, download it - we get completely different hashes, sizes and contents.
For text files, there seems to be no such problem, for the rest I did not check.

System Setup

# export ENDPOINT_URL=http://hostname:8333
# aws --endpoint-url $ENDPOINT_URL s3 cp s5cmd s3://trash/
upload: ./s5cmd to s3://trash/s5cmd                               
# aws --endpoint-url $ENDPOINT_URL s3 cp s3://trash/s5cmd s5cmd.2
download: s3://trash/s5cmd to ./s5cmd.2   

# md5sum s5cmd*
92bd7cbc454596957dc33ac18dada8ed  s5cmd
6275f8dd48e75ebe1841f8b6225e9aeb  s5cmd.2
# du s5cmd*
17036	s5cmd
652	s5cmd.2
# md5sum nude-net.onnx && du nude-net.onnx
99f5f1a1004eb5ede313b931b529c845  nude-net.onnx
81540	nude-net.onnx

# aws --endpoint-url $ENDPOINT_URL s3 cp nude-net.onnx s3://trash/
upload: ./nude-net.onnx to s3://trash/nude-net.onnx               
# aws --endpoint-url $ENDPOINT_URL s3 cp s3://trash/nude-net.onnx nude-net.onnx.2
download: s3://trash/nude-net.onnx to ./nude-net.onnx.2      
   
# md5sum nude-net.onnx.2 && du nude-net.onnx.2
f39e68c0ccae70fed0d7e3ddd160c5f0  nude-net.onnx.2
7812	nude-net.onnx.2

Expected behavior
Identity of written and subtracted files

Additional context

# cassandra -v
3.11.6
# weed version
version 8000GB 2.58 297b412 linux amd64
@chrislusf
Copy link
Collaborator

did you configure the credentials?

@aseev-xx
Copy link
Author

aseev-xx commented Jul 14, 2021

did you configure the credentials?

No (besides, as i mentioned, for a non binary file (i checked text ones) the problem is not reproducible)

@chrislusf
Copy link
Collaborator

please configure the credentials. It is related to how the client works.

@aseev-xx
Copy link
Author

please configure the credentials. It is related to how the client works.

I configured the credentials and it did not affect in any way, the problem remained

@mr-ichelyshkin
Copy link

@chrislusf Hi, anything new?

@aseev-xx
Copy link
Author

How to reproduce step by step:

# apg -a 1 -m 20 -n 1 -M NCL
klQPFA67Z2g5X2rofMGV
# apg -a 1 -m 40 -n 1 -M NCL
9WsHCPuWRFRdrMRlpxc8JHcC4ynPufdc8hXU9RcP
# ps ax | grep s3
140880 ?        Ssl    0:00 /usr/local/sbin/weed -v=3 -logdir=/var/log/seaweedfs s3 -port=8333 -filer=HOSTNAME:8888 -config=/etc/seaweedfs/config.json
# export AWS_SECRET_ACCESS_KEY=some_secret_key1
# export AWS_ACCESS_KEY_ID=some_access_key1
#
# aws --endpoint-url $ENDPOINT_URL s3 cp nude-net.onnx s3://trash/
upload failed: ./nude-net.onnx to s3://trash/nude-net.onnx An error occurred (InvalidAccessKeyId) when calling the CreateMultipartUpload operation: The access key ID you provided does not exist in our records.
# aws --endpoint-url $ENDPOINT_URL s3 cp s3://trash/nude-net.onnx nude-net.onnx.2
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden
#
# export AWS_SECRET_ACCESS_KEY=9WsHCPuWRFRdrMRlpxc8JHcC4ynPufdc8hXU9RcP
# export AWS_ACCESS_KEY_ID=klQPFA67Z2g5X2rofMGV
#
# aws --endpoint-url $ENDPOINT_URL s3 cp nude-net.onnx s3://trash/
upload: ./nude-net.onnx to s3://trash/nude-net.onnx               
# aws --endpoint-url $ENDPOINT_URL s3 cp s3://trash/nude-net.onnx nude-net.onnx.2
download: s3://trash/nude-net.onnx to ./nude-net.onnx.2       
#
# md5sum nude-net.onnx* && du nude-net.onnx*
99f5f1a1004eb5ede313b931b529c845  nude-net.onnx
f39e68c0ccae70fed0d7e3ddd160c5f0  nude-net.onnx.2
81540	nude-net.onnx
7812	nude-net.onnx.2

@chrislusf chrislusf reopened this Jul 15, 2021
@chrislusf
Copy link
Collaborator

Thanks for reporting! This is a bug introduced from 2.51.

@aseev-xx
Copy link
Author

Thank you for the prompt solution of the problem.

It is strange that no one noticed this before, it looks like a very serious problem for those who use it, for example, to store important data.

In the near future I will definitely check and write down the result.

@aseev-xx
Copy link
Author

@chrislusf Thanks again for the promptness, everything works, the problem does not reproduce on my data and tests

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

No branches or pull requests

3 participants