generator-jhipster icon indicating copy to clipboard operation
generator-jhipster copied to clipboard

it's time to make helm, postgresql and redis update to latest version

Open flyliu33 opened this issue 1 year ago • 4 comments

  1. Follow the installation of helm in markdown file, it would install the helm 3 version, but the structure of helm created by jhipster is obviously helm 2, which will be make confusing to developers. So the helm files are better to upgrade to helm 3 as well.
  2. The chart version of postgresql created by jhipster helm has been removed, and it is better to upgrade to the same version as docker compose file, postgresql.yml
  3. The redis configuration cannot be created automatically as postgresql while using jhipster helm
  4. It might exist some services like redis cannot be created automatically, and might like postgresql with deprecated version.
  5. Even though I try to change postgresql to latest one and changed configuration again and again, but there is still and aways an issue about wrong authentication. Whereas microservice in k8s can connect to postgresql deployed on host successfully. It might be my fault.
Overview of the issue

2024-08-02 10:06:50 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [com/jlzn/fc/config/LiquibaseConfiguration.class]: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "gateway" 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) 2024-08-02 10:06:50 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962) 2024-08-02 10:06:50 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) 2024-08-02 10:06:50 at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) 2024-08-02 10:06:50 at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) 2024-08-02 10:06:50 at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) 2024-08-02 10:06:50 at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) 2024-08-02 10:06:50 at com.jlzn.fc.GatewayApp.main(GatewayApp.java:70) 2024-08-02 10:06:50 Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "gateway" 2024-08-02 10:06:50 at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:259) 2024-08-02 10:06:50 at org.springframework.boot.autoconfigure.liquibase.DataSourceClosingSpringLiquibase.afterPropertiesSet(DataSourceClosingSpringLiquibase.java:46) 2024-08-02 10:06:50 at tech.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:128) 2024-08-02 10:06:50 at tech.jhipster.config.liquibase.AsyncSpringLiquibase.afterPropertiesSet(AsyncSpringLiquibase.java:91) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835) 2024-08-02 10:06:50 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) 2024-08-02 10:06:50 ... 14 common frames omitted 2024-08-02 10:06:50 Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "gateway" 2024-08-02 10:06:50 at liquibase.integration.spring.SpringLiquibase.lambda$afterPropertiesSet$0(SpringLiquibase.java:251) 2024-08-02 10:06:50 at liquibase.Scope.lambda$child$0(Scope.java:190) 2024-08-02 10:06:50 at liquibase.Scope.child(Scope.java:199) 2024-08-02 10:06:50 at liquibase.Scope.child(Scope.java:189) 2024-08-02 10:06:50 at liquibase.Scope.child(Scope.java:168) 2024-08-02 10:06:50 at liquibase.Scope.child(Scope.java:256) 2024-08-02 10:06:50 at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:242) 2024-08-02 10:06:50 ... 19 common frames omitted 2024-08-02 10:06:50 Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "gateway" 2024-08-02 10:06:50 at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:698) 2024-08-02 10:06:50 at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:207) 2024-08-02 10:06:50 at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262) 2024-08-02 10:06:50 at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54) 2024-08-02 10:06:50 at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273) 2024-08-02 10:06:50 at org.postgresql.Driver.makeConnection(Driver.java:446) 2024-08-02 10:06:50 at org.postgresql.Driver.connect(Driver.java:298) 2024-08-02 10:06:50 at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:137) 2024-08-02 10:06:50 at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:360) 2024-08-02 10:06:50 at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202) 2024-08-02 10:06:50 at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461) 2024-08-02 10:06:50 at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:550) 2024-08-02 10:06:50 at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:98) 2024-08-02 10:06:50 at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:111) 2024-08-02 10:06:50 at liquibase.integration.spring.SpringLiquibase.lambda$afterPropertiesSet$0(SpringLiquibase.java:246) 2024-08-02 10:06:50 ... 25 common frames omitted

Motivation for or Use Case
  1. execute command jhipster helm
  2. execute command bash helm-apply.sh
  3. error happened Error: INSTALLATION FAILED: An error occurred while checking for chart dependencies. You may need to run helm dependency build to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: postgresql
  4. modify service's Chart.yaml, upgrade the postgresql to ^15.5.20 and modify deployment.yml env: - name: SPRING_PROFILES_ACTIVE value: prod - name: SPRING_CLOUD_CONSUL_HOST value: consul-headless.default.svc.cluster.local - name: SPRING_CLOUD_CONSUL_PORT value: "8500" - name: SPRING_DATASOURCE_URL value: jdbc:postgresql://management-postgresql.default.svc.cluster.local:5432/management - name: SPRING_DATASOURCE_USERNAME value: management - name: SPRING_DATASOURCE_PASSWORD value: management {{/* valueFrom:*/}} {{/* secretKeyRef:*/}} {{/* name: management-postgresql*/}} {{/* key: password*/}} - name: JHIPSTER_CACHE_REDIS_SERVER value: redis://management-redis-master.default.svc.cluster.local:6379 - name: SPRING_LIQUIBASE_URL value: jdbc:postgresql://management-postgresql.default.svc.cluster.local:5432/management {{/* - name: SPRING_LIQUIBASE_USER*/}} {{/* value: management*/}} {{/* - name: SPRING_LIQUIBASE_PASSWORD*/}} {{/* value: management*/}} - name: MANAGEMENT_TRACING_BAGGAGE_REMOTE_FIELDS value: "x-request-id,x-ot-span-context" - name: JAVA_OPTS value: " -Xmx256m -Xms256m" - name: SERVER_SHUTDOWN value: graceful
  5. authentication about postgresql happened.
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

v8.6.0

JHipster configuration

microservices ` { "generator-jhipster": { "applicationType": "microservice", "authenticationType": "jwt", "baseName": "management", "buildTool": "maven", "cacheProvider": "redis", "clientFramework": "react", "clientTestFrameworks": ["cypress"], "clientTheme": "none", "creationTimestamp": 1722223074439, "cypressAudit": true, "cypressCoverage": null, "databaseType": "sql", "dbRandomPassword": "c69647240722cd5489726771b12e2e41fa5485e3b7c58db1a02ab590a19a", "devDatabaseType": "postgresql", "devServerPort": 9061, "enableHibernateCache": true, "enableSwaggerCodegen": true, "enableTranslation": true, "entities": ["Parent", "Child"], "feignClient": true, "jhipsterVersion": "8.6.0", "languages": ["zh-cn", "en"], "lastLiquibaseTimestamp": 1722224429000, "messageBroker": false, "microfrontend": null, "microfrontends": [], "nativeLanguage": "zh-cn", "packageName": "com.jlzn.fc", "prodDatabaseType": "postgresql", "reactive": false, "searchEngine": false, "serverPort": "8089", "serverSideOptions": ["enableSwaggerCodegen:true"], "serviceDiscoveryType": "consul", "skipUserManagement": true, "syncUserWithIdp": null, "testFrameworks": ["gatling", "cypress"], "websocket": false, "withAdminUi": false } }

`

jhipster helm ` { "generator-jhipster": { "appsFolders": ["gateway", "management"], "dbRandomPassword": "ae7d25eed0f5b1dcf1f0a5ed3445dfdca2ec430cf6c361ae27340dbf8bc3", "deploymentApplicationType": "microservice", "directoryPath": "../", "dockerPushCommand": "docker push", "dockerRepositoryName": "192.168.1.25:5000", "ingressDomain": null, "ingressType": null, "istio": false, "jhipsterVersion": "8.6.0", "kubernetesNamespace": "default", "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } }

`

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

版本 Windows 11 专业版 版本号 23H2 安装日期 ‎2024/‎4/‎23 操作系统版本 22631.3880 体验 Windows Feature Experience Pack 1000.22700.1020.0

default kubernetes v1.29.2 in windows docker desktop 4.32.0

  • [x] Checking this box is mandatory (this is just to show you read everything)

flyliu33 avatar Aug 02 '24 08:08 flyliu33

@flyliu33 Are you available to contribute with a PR?

DanielFran avatar Aug 06 '24 20:08 DanielFran

@DanielFran Sure.

flyliu33 avatar Aug 12 '24 07:08 flyliu33

Added bug bounty. Please submit a PR when it's convenient.

mraible avatar Sep 13 '24 03:09 mraible

@flyliu33 Any updates?

mraible avatar Sep 23 '24 04:09 mraible