paws icon indicating copy to clipboard operation
paws copied to clipboard

Windows Path problems with paws sts.

Open ssefick opened this issue 7 months ago • 3 comments

Hello, I have used the saml authentication example as inspiration for a few functions to authenticate, and write to the credentials file.

I developed the on *nix, so I didn't find this issue until helping a colleague today on a windows machine.

sts seems to be mangling the path when trying to find .aws/config and .aws/credentials.

Like this C:\Users\name/.aws/config. Please let me know what else I can provide to help.

Any thoughts?

ssefick avatar Jul 17 '25 02:07 ssefick

When you say the path is getting mangled what do mean? For window machines paws looks in the USERPROFILE directory. This is recommended by aws file location.

https://github.com/paws-r/paws/blob/main/paws.common/R/config.R#L130C1-L167C2

Can you provide example of the mangled path please?

DyfanJones avatar Jul 17 '25 11:07 DyfanJones

Yes, the errors are saying that the config and credentials files do not exist at a path like:

C:\Users\name/.aws/config

It looks like the path is a mix of back slashes and forward slashes.

Please let me know if you need anything else.

ssefick avatar Jul 17 '25 11:07 ssefick

Interesting:

The first part C:\Users\name is coming from USERPROFILE environmental variable. From memory window machines don't like a single \ and prefer a \\ instead.

The second part /.aws/config is coming form the base R function file.path that builds the file path using the .Platform$file.sep (this is default). I believe windows accepts / for it's file path.

For windows I would of expected something like this:

C:\\Users\\name/.aws/config

It looks weird but window machines accepts this as a valid file paths 🤷

First can you double check if the .aws/config is in the C:\\Users\\name/.aws/config location. If so then I would advice making sure your USERPROFILE is set correctly.

DyfanJones avatar Jul 17 '25 11:07 DyfanJones