-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is profile prefix deprecated or required? #1707
Comments
This is a definite pain point. It's surprisingly difficult to create a file that makes both the CLI and Java SDK happy. This is fixed in the Java SDK 2.0, but is hard to fix in 1.11, because 1.11 uses the same code path for the ~/.aws/config (that MUST have the prefix) and the ~/.aws/credentials (that MUST NOT have the prefix). See this issue for more discussion on incompatibilities: #803 If you're willing to work with pre-GA software, you could add a dependency on V2's Otherwise we can update the warning log to not say it's deprecated (since it's not technically deprecated anymore - it was at one point which points to the chaos around these files), but we'll still need the log to say to use the 'profile' prefix when specifying the credentials provider. |
@millems thank you for the clarification. I really appreciate it. I totally understand how this can happen. Lots of fast-moving independent groups doing awesome things and then an undocumented file format sneaks in between you all. I think updating the message to say it's not deprecated would reduce confusion. |
How is "Your profile name includes a 'profile ' prefix. This prefix is considered part of the profile name in the Java SDK, so you will need to include this prefix in your profile name when it is referenced from your Java code."? |
That’s great wording! Thank you. |
We have a fix for this upstream and it should be part of the next release. |
Hi @millems. I don't use profiles via the Java SDK (I only use them with other CLI tools). Since this warning was introduced, I now see it repeated 10 times every time I run an app or library that uses the SDK:
I understand there was a desire to make things clear, but the fix is really obtrusive. Configuring log4j in every app/library I use to turn this off isn't really an option. Could this warning be replaced with a change in the docs somewhere? Even the comments on this GitHub issue are likely enough that Google will now provide the answer if anyone is confused. |
I agree with @joelittlejohn. |
I have to use both v1 and v2 SDKs in the same application with a custom profile, that is the only way I've found to make it work:
[custom]
region=eu-west-1
[profile custom]
region=eu-west-1 But I'm having annoying contradictory warn messages from both SDKs
Is there anything that can be done to avoid this? I think there's also an issue in the BasicProfileConfigLoader: it builds a map of profile properties using the profile name as key, but it does not remove the |
@laymain Sorry that this is annoying. V2 had to be changed to be more compatible with other SDKs, which broke some compatibility with V1 itself. For a temporary workaround, when you're using both in the same application, you could use the V2 profile credentials provider with the V1 SDK by implementing V1's We could see about adding a "forward compatibility" flag with the V1 SDK that allows it to behave consistently with the V2 SDK/CLI/etc. |
@millems Thank you for your answer. To implement your workaround, I also have to implement a wrapper for V1's aws-sdk-java/aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java Lines 69 to 95 in 1f21df5
|
@laymain Yeah, unfortunately region providers are an internal concept right now. Since regions don't expire like credentials, we didn't really ever plan to make them external, since configuring a region provider should be the same as configuring the region from that provider. |
@millems For now I will stick with my ugly workaround. log4j.logger.software.amazon.awssdk.profiles.internal.ProfileFileReader=ERROR
log4j.logger.com.amazonaws.auth.profile.internal.BasicProfileConfigLoader=ERROR It will be nice to have this "forward compatibility" flag. |
Oh god, so true |
Can't you just remove this log? |
For the love of God please remove this error. |
Today's release should hopefully fix the log spam. The 1.x SDK will now fall back to "profile X" if there is no "X" profile defined and the SDK is configured to look for profile X. There is no longer a warning if a "profile X" exists in the file. |
still happening in |
like @justinTM also happening in Oddly enough, this didn't happen with |
Also happens in image for Glue: amazon/aws-glue-libs:glue_libs_3.0.0_image_01 Part of the log: 23/01/26 06:08:03 WARN MetricsConfig: Cannot locate configuration: tried hadoop-metrics2-s3a-file-system.properties,hadoop-metrics2.properties |
You folks say that profile prefix is deprecated:
https://github.com/aws/aws-sdk-java/blame/46c00efdd9240d2d20d734f806dcc71506af6e0f/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/internal/BasicProfileConfigLoader.java#L96-L99
botocore (AWS Python SDK) says that the profile prefix is required:
https://github.com/boto/botocore/blob/d00ee27528efad227ad46d3db9fd2f80f802803f/botocore/configloader.py#L208-L222
Between you, it is seemingly impossible to write ~/.aws/config in a compliant way.
The text was updated successfully, but these errors were encountered: