hashicorp / go-getter

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

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

Closed Subhajit97 closed 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.

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

crw commented 1 year ago

Duplicate of #441.

(Note that #441 seems to have slightly more detail, so closing this in favor of that.)