0

When I run my Jhipster application in docker with a MySQL database, the data will be deleted after some time.

Looking at the MySQL logs, I can see that the MySQL database recieves a SHUTDOWN command from the root user, then goes through an initialization phase.

[System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.29).
[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29)  MySQL Community Server - GPL.
[Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
[Note] [Entrypoint]: Switching to dedicated user 'mysql'
[Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
[Warning] [MY-011068] [Server] The syntax '--ssl=off' is deprecated and will be removed in a future release. Please use --tls-version=invalid instead.
[System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
[System] [MY-013576] [InnoDB] InnoDB initialization has started.
[System] [MY-013577] [InnoDB] InnoDB initialization has ended.
[Warning] [MY-011302] [Server] Plugin mysqlx reported: 'Failed at SSL configuration: "SSL context is not usable without certificate and private key"'
[System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
[System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.29'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.

When it comes back online, my JHipster app doesn't have any application data saved to the database even though I have made a docker volume for MySQL and have it attached. This includes entity data and user data, so I am unable to login.

Restarting the JHipster app will give a clean install of the database connected to the application, but doing this everytime I notice MySQL has failed is not a good long-term solution.

I'm not sure if this is an error from MySQL crashing or if JHipster is somehow clearing the database with liquibase. Any help would be appreciated.

srcapezz
  • 21
  • 1
  • I think there is a configuration that control the behavior, you have to change it – Hi computer Jul 13 '22 at 04:00
  • Do you know which file this configuration is in? I'm not sure if this would be from docker, jhipster, liquibase, MySQL, or something else. – srcapezz Jul 13 '22 at 13:53
  • if you have config like spring.jpa.hibernate.ddl-auto=create-drop, the data will be cleared. Check this https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#configurations-hbmddl – Hi computer Jul 14 '22 at 06:47
  • or this one https://stackoverflow.com/questions/42135114/how-does-spring-jpa-hibernate-ddl-auto-property-exactly-work-in-spring – Hi computer Jul 14 '22 at 06:53
  • At the moment, it looks like that setting is set to none, which I think is what I want for production. – srcapezz Jul 15 '22 at 00:53

0 Answers0