spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

S3 backed AWS Config server does not read default property file

Open allanslim opened this issue 5 years ago • 8 comments

Describe the bug I created a Cloud Config Server that is backed by S3, but when I curl for the properties, it does not read the content of the default (application.yml) file. With the Git version, it reads the content of application.yml and {application-name}-{profiles}.yml one after the other. I looked at the code (AwsS3EnvironmentRepository) and I don't think it has functionality to read any files from S3 other than what than the {application-name}-{profiles}.yml file that it is being requested. Does anyone have a solution for this? The goal is to avoid common properties to be replicated per clients. Any help will be great appreciated. Thanks!

allanslim avatar May 01 '20 22:05 allanslim

I am also facing the same issue. We are trying to switch from using a Git-backed config service to an S3-backed service, and this is causing us issues. It would be great if the AwsS3EnvironmentRepository could behave in the same way as the Git one.

Also - the AwsS3EnvironmentRepository does not throw any sort of exception when the bucket name is wrong, or cannot be accessed. This is because it swallows all exceptions in the getS3ConfigFile method without logging anything and eventually just returns an empty environment. This is not super helpful when trying to figure out environmental / permissions issues in AWS. Could this also be improved? Let me know if I should open a separate request. Thanks!

mattmonksdlg avatar May 19 '20 15:05 mattmonksdlg

This is especially important for people who are migrating from Git based configurations to S3 based configurations and they are not compatible. The responses should stay consistent to allow switching different storage without changes to clients.

divinedragon avatar Jul 20 '20 15:07 divinedragon

I am also facing the same/similar issue where it behaves differently from NativeEnvironmentRepository. For NativeEnvironmentRepository, if a {label} is included as part of the client request the config server will return a union of configuration that is from the default properties (application.yml), service properties (service.yml) and the labelled version of those files ({label}/application.yml, {label}/service.yml). For AwsS3EnvironmentRepository it just returns the labelled version of the service properties ( {label}/service.yml ).

rodfrancisco avatar Jan 20 '21 19:01 rodfrancisco

I am also having this problem - is anyone working on this ?

amathias avatar Apr 09 '21 10:04 amathias

I also see this problem. Is someone working to solve this bug ?! it's totally wrong behaviour and it's different than the git behaviour. Is there a workaround to this issue?

avnerstr avatar May 23 '21 17:05 avnerstr

Yes we're also seeing this issue, would be great to have this fixed, as the behavior is different from GIT-based. In the meantime we are running our app with both profiles default,something and having an appName-default.yml file in S3.

claraccio avatar May 27 '21 04:05 claraccio

Can you share sample code at least to read {application}-{profile}.properties/yml?. Thanks in advance.

No proper documentation from spring team.

jaganm2018 avatar May 31 '21 10:05 jaganm2018

Sorry I didn’t understand.. is there any sample or need to implement?. it seems some body already done

jaganm2018 avatar Jun 01 '21 19:06 jaganm2018

Hello, i saw the PR still not merged. This issue still prevents us to keep configuration files in AWS S3. Tried with current latest version 2022.0.1.

Is there any other solution?

hckorkmaz avatar Jan 27 '23 11:01 hckorkmaz