peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.69k stars 239 forks source link

sync: Getting "NoSuckKey" error for a file that contains a space. #660

Open skylenet opened 1 year ago

skylenet commented 1 year ago

Listing the files:

s5cmd ls 's3://sourcify-backup-s3/stable/repository/contracts/full_match/1/0xaF137b471523D26ab14eD2a24C1471958A3372d9/sources/contracts/'
# Returns
2023/09/02 03:14:53             22346  ERC721A.sol
2023/09/02 03:14:53              2664  RatGuys .sol

When running sync:

s5cmd sync 's3://sourcify-backup-s3/stable/repository/contracts/full_match/1/0xaF137b471523D26ab14eD2a24C1471958A3372d9/sources/contracts/*' '/data'
# Returns
ERROR "cp s3://sourcify-backup-s3/stable/repository/contracts/full_match/1/0xaF137b471523D26ab14eD2a24C1471958A3372d9/sources/contracts/RatGuys\\u00a0.sol /data/RatGuys\\u00a0.sol": NoSuchKey: The specified key does not exist. status code: 404, request id: XXXXXXXXXX, host id: XXXXXXXXX
cp s3://sourcify-backup-s3/stable/repository/contracts/full_match/1/0xaF137b471523D26ab14eD2a24C1471958A3372d9/sources/contracts/ERC721A.sol /data/ERC721A.sol

\\u00a0 is a space. The relevant file is available here.

seruman commented 1 year ago

Hi @skylenet,

Thanks for the report, we'll look into this.

ms-jpq commented 9 months ago

seems like ~ doesn't work when in file name either. The logic for escaping / unescaping seems be be flawed.

Edit:

After further investigation:

This is actually be due to my S3 provider not correctly normalizing paths.

Since there are many S3 providers, maybe the bug is just that. server implementation error.