-
Notifications
You must be signed in to change notification settings - Fork 863
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
Expected a profile or property definition on line 190 #2994
Comments
Hi @giacomoarru I can see the error too. When a line starts with spaces, the Java SDK expects it to be a continuation of a configuration from the previous line. Can you use the credentials file without spaces in the meantime? |
Hi @debora-ito, I have removed the initial spaces in my credentials file. Thank you, |
The same problem, still actual |
@giacomoarru I'm going to close this issue, this won't be prioritized soon. The "Shared config file" reference guide show examples of lines where indentation is used to indicate a subsetting. The Java SDK is following what is documented. The workaround is to not use indentation before a setting name. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
AWS SDK 2.17.118
My credentials file is valid and the profiles all work with aws cli.
When a the ~/.aws/credentials file contains a credential in this format (parameters indented with spaces)
[profile_name]
(4 space indentation)region = region_name
(4 space indentation)credential_process = ....................
I get this exception:
java.lang.IllegalArgumentException: Expected a profile or property definition on line 190
at software.amazon.awssdk.utils.Validate.isTrue(Validate.java:76)
at software.amazon.awssdk.profiles.internal.ProfileFileReader.readPropertyContinuationLine(ProfileFileReader.java:167)
at software.amazon.awssdk.profiles.internal.ProfileFileReader.parseLine(ProfileFileReader.java:76)
at software.amazon.awssdk.profiles.internal.ProfileFileReader.lambda$parseFile$0(ProfileFileReader.java:58)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at software.amazon.awssdk.profiles.internal.ProfileFileReader.parseFile(ProfileFileReader.java:58)
at software.amazon.awssdk.profiles.ProfileFile$BuilderImpl.build(ProfileFile.java:266)
at software.amazon.awssdk.profiles.ProfileFile.lambda$addCredentialsFile$0(ProfileFile.java:142)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at software.amazon.awssdk.profiles.ProfileFile.addCredentialsFile(ProfileFile.java:139)
at software.amazon.awssdk.utils.builder.SdkBuilder.applyMutation(SdkBuilder.java:61)
at software.amazon.awssdk.profiles.ProfileFile.defaultProfileFile(ProfileFile.java:90)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.mergeGlobalDefaults(SdkDefaultClientBuilder.java:205)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:158)
at software.amazon.awssdk.services.s3.DefaultS3ClientBuilder.buildClient(DefaultS3ClientBuilder.java:27)
at software.amazon.awssdk.services.s3.DefaultS3ClientBuilder.buildClient(DefaultS3ClientBuilder.java:22)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:133)
Expected behavior
The SDK should bootstrap with no exceptions.
Current behavior
An exception is thrown at initialization.
Steps to Reproduce
Indent the configuration in a aws profile, credentials file ~/.aws/credentials
Possible Solution
Trim the parameters
Context
My software stopped bootstrapping after I added a new AWS profile.
AWS Java SDK version used
2.17.118
JDK version used
16
Operating System and version
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: