-
Hi Team,
2024-06-20T10:39:07.106Z WARN 1 --- [nio-8888-exec-7] o.s.c.c.s.e.EnvironmentController : Error getting the Environment with name=gcs-sparta-lock-and-alerts profiles=dev label=null includeOrigin=false org.springframework.cloud.config.server.environment.FailedToConstructEnvironmentException: Could not construct context for config=gcs-sparta-lock-and-alerts profile=dev label= includeOrigin=false; nested exception is org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'file [/tmp/config-repo-7761498588719393135/gcs-sparta-lock-and-alerts/gcs-sparta-lock-and-alerts-dev.yml]' is invalid in a profile specific resource [origin: URL [file:/tmp/config-repo-7761498588719393135/gcs-sparta-lock-and-alerts/gcs-sparta-lock-and-alerts-dev.yml] - 444:17] Please let me know whether I'm missing some thing , because I have tried with spring_profiles_active pass any env variable but still it didn't worked. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @Muni96, Sounds like you've configured the cloud config server ok since you say the container is up and answering requests. Looking at your error message, it sounds like you have a spring boot application with a configured What I can't see is your git repo, but it sounds like you either do not have a config file or it's improperly named. You should name your config file as specified in the Cloud Config Server documentation with Example to test with the url you specified...
The examples in the README and the examples inside the repo use this repo supplied by spring for testing. Your repo should be structured in a similar manner Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hello @Muni96,
Sounds like you've configured the cloud config server ok since you say the container is up and answering requests. Looking at your error message, it sounds like you have a spring boot application with a configured
spring.application.name
=gcs-sparta-lock-and-alerts
and are usng a profile nameddev
.What I can't see is your git repo, but it sounds like you either do not have a config file or it's improperly named. You should name your config file as specified in the Cloud Config Server documentation with
{application name}-{profile}.yml
, so in your case you would need a config file namedgcs-sparta-lock-and-alerts-dev.yml
Example to test with the url you specified...