Aborted connection <x> to db

I have a spring boot app, and a mysql DB running on VMs.
Whenever i deploy my spring boot app, the app often shuts down when trying to connect to DB but eventually gets sorted out after several restarts and redeploys

Spring boot rebooting logs:

2022-11-09T09:33:37.875 app[5fdb27bf] waw [info] 2022-11-09 09:33:37.874 INFO 520 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}

2022-11-09T09:33:38.916 app[5fdb27bf] waw [info] 2022-11-09 09:33:38.915 INFO 520 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect

2022-11-09T09:33:39.713 app[5fdb27bf] waw [info] 2022-11-09 09:33:39.713 WARN 520 --- [ main] org.hibernate.id.UUIDHexGenerator : HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead

2022-11-09T09:34:04.893 runner[5fdb27bf] waw [info] Shutting down virtual machine

2022-11-09T09:34:05.109 app[5fdb27bf] waw [info] Sending signal SIGINT to main child process w/ PID 520

2022-11-09T09:34:05.512 app[5fdb27bf] waw [info] Starting clean up.

mysql server logs

2022-11-09T09:34:05.324 app[af14cf68] dfw [info] 2022-11-09T09:34:05.322891Z 324 [Note] Aborted connection 324 to db: 'app' user: 'root' host: <host> (Got an error reading communication packets)

2022-11-09T09:34:05.324 app[af14cf68] dfw [info] 2022-11-09T09:34:05.323063Z 323 [Note] Aborted connection 323 to db: 'app' user: 'root' host: <host> (Got an error reading communication packets)

The user, password and other db details should be correct as the same values usually work eventually.