Windows: in my .aws\credentials file I had credentials with a header [somename]. It wored OK when I added the header [default]. In the default header I copied the same values from the [somename]
So, when you use AWS functions that automatically get credentials from .aws\credentials, those function are looking for the credentials under the header [default].