jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

`jhipster jdl blog-oauth2` doesn't work with JHipster 8.5.0 #26319

Closed mraible closed 4 months ago

mraible commented 4 months ago
Overview of the issue

The MySQL container doesn't start in Docker.

$ docker compose -f src/main/docker/mysql.yml up
WARN[0000] Found orphan containers ([blog-keycloak-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 1/0
 ✔ Container blog-mysql-1  Created                                                                                 0.0s
Attaching to mysql-1
mysql-1  | 2024-05-31 03:52:01+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | 2024-05-31 03:52:01+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql-1  | 2024-05-31 03:52:01+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1  | 2024-05-31T03:52:01.259326Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1  | 2024-05-31T03:52:01.379597Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
mysql-1  | 2024-05-31T03:52:01.379690Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
mysql-1  | 2024-05-31T03:52:01.381140Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=10485760. Please use innodb_redo_log_capacity instead.
mysql-1  | 2024-05-31T03:52:01.381844Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1  | 2024-05-31T03:52:03.857959Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql-1  | 2024-05-31T03:52:03.920948Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
mysql-1  | 2024-05-31T03:52:03.921905Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
mysql-1  |
mysql-1  | InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 772024-05-31T03:52:03.986881Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql-1  | 2024-05-31T03:52:03.986906Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql-1  |  78 79 802024-05-31T03:52:03.989212Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql-1  |  81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1002024-05-31T03:52:04.008497Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
mysql-1  | 2024-05-31T03:52:04.302669Z 8 [Warning] [MY-011302] [Server] Plugin mysqlx reported: 'Failed at SSL configuration: "SSL context is not usable without certificate and private key"'
mysql-1  | 2024-05-31T03:52:04.302914Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql-1 exited with code 139
Motivation for or Use Case

It worked with previous versions.

Reproduce the error
jhipster jdl blog-oauth2
docker compose -f src/main/docker/mysql.yml up
Related issues

https://github.com/jhipster/generator-jhipster/pull/26026

Suggest a Fix

Changing src/main/docker/mysql.yml to use image: mysql:8.3.0 seems to fix it.

JHipster Version(s)

8.5.0

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "blog",
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "devServerPort": 4200,
    "entities": [
      "Blog",
      "Post",
      "Tag"
    ],
    "jhipsterVersion": "8.5.0",
    "languages": [
      "en"
    ],
    "lastLiquibaseTimestamp": 1717126951000,
    "nativeLanguage": "en",
    "packageFolder": "com/jhipster/demo/blog",
    "packageName": "com.jhipster.demo.blog",
    "prodDatabaseType": "mysql",
    "skipUserManagement": true,
    "testFrameworks": [
      "cypress"
    ]
  }
}
Environment and Tools

openjdk version "21.0.2" 2024-01-16 OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

git version 2.39.3 (Apple Git-146)

node: v20.13.0 npm: 10.8.0

Docker version 26.1.1, build 4cf5afa

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
@ChangelogDate("20240531034031")
entity Blog {
  name String required minlength(3)
  handle String required minlength(2)
}
@ChangelogDate("20240531034131")
entity Post {
  title String required
  content TextBlob required
  date Instant required
}
@ChangelogDate("20240531034231")
entity Tag {
  name String required minlength(2)
}

relationship ManyToOne {
  Blog{user(login)} to User with builtInEntity
  Post{blog(name)} to Blog
}
relationship ManyToMany {
  Post{tag(name)} to Tag{entry}
}

search Blog, Post, Tag with no
paginate Post, Tag with infinite-scroll

mraible commented 4 months ago

@qmonmert Are you able to get MySQL working in a JHipster 8.5.0 app? I haven't been able to, but maybe it's my local environment (macOS M3).

mshima commented 4 months ago

Same here on MacOS.

qmonmert commented 4 months ago

@mraible same on MacOS M1

qmonmert commented 4 months ago

@mraible if you add --skip-mysqlx on command: command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp it seems to start

mraible commented 4 months ago

@qmonmert Thanks! I was able to use this locally and things work. PR at https://github.com/jhipster/generator-jhipster/pull/26359.

Screenshot 2024-06-04 at 4 28 07 PM