Skip to content

s5cmd drops leading slashes in keys #352

@gusostow

Description

@gusostow

Version: v1.3.0-bb1775a

Steps to reproduce:

$ touch file.txt
$ s5cmd cat s3://bucket/file.txt
ERROR "cat s3://bucket/file.txt": NoSuchKey: The specified key does not exist. status code: 404, request id: Z...BMQB76, host id: Yy5Y9JW0D9Nvx....NMdpe9/dbE=
$ s5cmd cp file.txt s3://bucket//file.txt
cp file.txt s3://bucket/file.txt
$ s5cmd cat s3://bucket/file.txt
$

You can compare this behavior to the aws CLI:

$ aws s3 cp file.txt s3://bucket//file.txt
upload: ./file.txt to s3://bucket//filet.txt
$ aws s3 cp s3://bucket//file.txt .
download: s3://bucket//file.txt to ./file.txt

Even more problematic, if there's an existing key with a leading slash, s5cmd won't be able to address it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions