Closed awangseason closed 7 years ago
I used ./mvnw package -Pprod docker:build to create duckor image: In bootstrap-prod.yml:
spring:
cloud:
config:
fail-fast: true
retry:
initial-interval: 1000
max-interval: 2000
max-attempts: 100
uri: http://admin:${jhipster.registry.password}@localhost:8761/config
# name of the config server's property source (file.yml) that we want to use
name: fwmapp
profile: prod # profile(s) of the property source
label: master # toggle to switch to a different version of the configuration as stored in git
# it can be set to any label, branch or commit of the configuration source Git repository
jhipster:
registry:
password: admin
I don't understand why your registry is on localhost
, and not on jhipster-registry
- how did you generate your Docker Compose file, did you use our docker-compose sub-generator?
because my jhipster registry is running in a docker container on my laptop. Docker log: Application 'jhipster-registry' is running! Access URLs: jhipster-registry_1 | Local: http://localhost:8761 jhipster-registry_1 | External: http://172.18.0.4:8761 jhipster-registry_1 | Profile(s): [dev]
So I change the config in in app.yml, from jhipster-registry to localhost.
@awangseason This is not how docker works. When you run docker-compose up
, docker will create a virtual "bridge" network. So from inside your fwmapp-app
container the registry address would be jhipster-registry:8761
. However when accessing from your host (outside docker) the address is indeed localhost:8761
.
This should be properly configured by JHipster.
https://docs.docker.com/compose/networking/
Thanks. May I ask how to pass the variable ${jhipster.registry.password} to app.yml?
Hi, this is the ticket system: if you have a bug with our docker-compose sub-generator, we will try to solve it. If you have a general question, on your own custom configuration, then you should go to Stack Overflow. We're there too, and you will get help there.
This ticket has been closed as the guidelines are not followed.
Tickets must follow our Guidelines, as mentioned in:
We have also created a template on the "create a new ticket" page to help you follow those guidelines.
Open a new issue with proper details or update this issue with all details and request to reopen. Issues opened without proper details will be closed without explanation.
If you have a question please use Stack Overflow for that. Tag the question with jhipster and someone will help you out there.
This helps us to keep our issue tracker clean. Also, Stack Overflow will give your query a larger audience.
man if we're already here just answer the question...
Overview of the issue
I'm running my application in Docker, but my app couldn't get spring cloud config file at http://localhost:8761/config/fwmapp/prod/master but my jhipster-registry is running successfully at http://localhost:8761 Application 'jhipster-registry' is running! Access URLs: fwmapp-mysql_1 | 2017-09-06T03:25:10.761345Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. jhipster-registry_1 | Local: http://localhost:8761 jhipster-registry_1 | External: http://172.18.0.4:8761 jhipster-registry_1 | Profile(s): [dev]
fwmapp-app_1 | 2017-09-06 05:54:06.843 ERROR 8 --- [ main] o.s.boot.SpringApplication : Application startup failed fwmapp-app_1 | fwmapp-app_1 | java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing fwmapp-app_1 | at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:132) fwmapp-app_1 | at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:93) fwmapp-app_1 | at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567) fwmapp-app_1 | at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338) fwmapp-app_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) fwmapp-app_1 | at com.delta.it.fwm.FwmappApp.main(FwmappApp.java:68) fwmapp-app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) fwmapp-app_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) fwmapp-app_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) fwmapp-app_1 | at java.lang.reflect.Method.invoke(Method.java:498) fwmapp-app_1 | at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) fwmapp-app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) fwmapp-app_1 | at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) fwmapp-app_1 | at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59) fwmapp-app_1 | Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/fwmapp/prod/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused) fwmapp-app_1 | at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666) fwmapp-app_1 | at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613) fwmapp-app_1 | at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:531) fwmapp-app_1 | at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:172) fwmapp-app_1 | at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:93) fwmapp-app_1 | ... 13 common frames omitted
Motivation for or Use Case
I currently used JHipster to generate an application.
Reproduce the error
use standard steps to generate a JHipster application in app.yml:
in application.yml(under central-server-config/docker-config, central-server-config/localhost-config ): -- I'm not sure if this file is used by docker, and when it will be used
Related issues
https://github.com/jhipster/generator-jhipster/issues/3176
Suggest a Fix
I've notice that "jhipster.registry.password" was introduced in below issue, but how to set this property is not indicated in anywhere. I've change it back to 'admin'. https://github.com/jhipster/generator-jhipster/issues/4905
JHipster Version(s)
generator-jhipster@4.7.0
JHipster configuration
Using JHipster version installed locally in current project's node_modules Executing jhipster:info Options: Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
##### **Environment and Tools** java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) git version 2.11.0 (Apple Git-81) node: v6.11.2 npm: 3.10.10 yeoman: 2.0.0 Docker version 17.06.1-ce, build 874a737 docker-compose version 1.14.0, build c7bdf9e ##### **Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory** not an error during an entity creation or associated with a specific entity ##### **Browsers and Operating System** not a problem with all browsers - [ ] Checking this box is mandatory (this is just to show you read everything)