hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.65k stars 232 forks source link

S3 URL fails with `failed to get directory specified by the source ...: relative paths require a module with a pwd` #441

Open Subhajit97 opened 1 year ago

Subhajit97 commented 1 year ago

I am trying to download files from an S3 URL, but I'm getting the below error.

failed to get directory specified by the source <bucket>.s3-<region>.amazonaws.com/ghost/: relative paths require a module with a pwd

Note: I haven't provided any forced getter (i.e. s3::) before the source URL.

The order in the package to detect the source type seems incorrect since the Detect method checks for FileGetter before the actual detect method used for S3 URLs. Hence, it can't find any pwd value in the source.

Note: The same source worked when I tried using go-getter v1.7.1 but using go-getter v2.2.1, it fails with the above error.

Workaround: Mentioning forced getter (i.e. s3::) solves the issue.