Skip to content
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

Serving plain-text files with S3 Backend not working #1939

Closed
djgeary opened this issue Jul 31, 2021 · 4 comments
Closed

Serving plain-text files with S3 Backend not working #1939

djgeary opened this issue Jul 31, 2021 · 4 comments

Comments

@djgeary
Copy link

djgeary commented Jul 31, 2021

We are trying to migrate our Spring Cloud Config Server from a Git Backend to S3. This is working fine for the normal configuration yaml files, but we also use it to serve plain text files and are having problems getting that working.

This is documented here https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#spring-cloud-config-serving-plain-text-aws-s3, but its not clear what URL format to use.

With Git we used
https://config-host/a/b/master/myfile.txt

For S3 I've tried
https://config-host/test/b/c/myfile.txt

which results in this in the logs

2021-07-30 17:46:35.787  WARN 1 --- [  XNIO-1 task-3] o.s.c.config.server.support.PathUtils    : Resource path "https://s3.us-west-2.amazonaws.com/my-bucket/test" was successfully resolved but resource "https://s3.us-west-2.amazonaws.com/my-bucket/test%2Fmyfile.txt" is neither under the current location "https://s3.us-west-2.amazonaws.com/my-bucket/test" nor under any of the allowed locations [Amazon s3 resource [bucket='my-bucket' and object='test']]

(after putting myfile.txt in the test folder in my-bucket)

Possibly there is an issue with the encoding here - ie test%2Fmyfile.txt?

We are using spring-cloud 2020.0.3 and spring-cloud-aws 2.3.0

Originally raised on stack overflow https://stackoverflow.com/questions/68595665/serving-plain-text-files-from-spring-cloud-config-server-with-s3-backend

@ithinkisam
Copy link

I'm also hoping to move away from Git to S3 (we're migrating our config server from on-prem to AWS).

This Spring Cloud Config reference guide suggests that serving plain text via AWS S3 is possible, but the "additional endpoint" of /{application}/{profile}/{label}/{path} described here does not appear to work with the S3 backend and results in a 404.

@ryanjbaxter
Copy link
Contributor

Could you try with 2021.0.3?

@ryanjbaxter
Copy link
Contributor

@hpoettker it appears you may have looked into this issue, is this only possible now with the AWS v2 SDK?

@ryanjbaxter
Copy link
Contributor

Duplicates #2216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants