-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Error Unauthorized: 401 while starting the application #2314
Comments
If you move the |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Hey, sorry about late. |
This is because when you have spring.config.import in an environment variable spring boot tries to load that configuration before it has even loaded your application.yaml, so it does not know the username or password. We made some changes recently so that the config server takes advantage of spring boots 2 part config data loading so that is why you might see this after the upgrade. |
Somewhat slightly related.
Notice the order in my (now) working client Compose environment snippet: |
Hi Spring Cloud team,
I am going to upgrade Spring cloud from 2022.0.2 to 2022.0.4. And I got an issue while starting my application.
Spring boot: v3.1.1
Spring cloud: v2022.0.4
In application.yml:
In helm-chart/dev.values.yaml:
Here is the error log:
It looks like the application couldn't get
username
in application.yml.I was trying to set it as an environment variable
SPRING_CLOUD_CONFIG_USERNAME
in helm-chart/dev.values.yml, and it starts successfully.Could you please help to check this case? In new Spring cloud version, do we have to set SPRING_CLOUD_CONFIG_USERNAME as an environment variable on each deployed environment? For example, I have 2 environments of
dev
andprod
Thanks for your help!
The text was updated successfully, but these errors were encountered: