Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qurakus Dev mode crash #17213

Closed
hrstoyanov opened this issue May 13, 2021 · 15 comments
Closed

Qurakus Dev mode crash #17213

hrstoyanov opened this issue May 13, 2021 · 15 comments
Labels
area/devmode area/kotlin kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@hrstoyanov
Copy link

hrstoyanov commented May 13, 2021

Describe the bug

@radcortez
The JVM crashes on starting in Quarkus Dev mode. This could be due to changes in smallrye config in Quarkus 1.13.4.FInal
and is a follow up to issues: #14847
Also see zulip chat

This could be due to the latest change in smallrye config (included in Quarkus.1.13.4.FInal) or Java 16. Note that issue is identical for x86 or ARM64 MacOs, if that matters.

To Reproduce

Find the attached forRoberto.zip ZIP file.
Save the config file (given below) somewhere (say /temp/config.yaml) and run:

./gradlew -p dbproxy clean quarkusBuild
./gradlew -p dbproxy -Dsuspend=true -Dsmallrye.config.locations=/temp/config.yaml

In your IDE, place a break point into Main.onStart . Instead of stopping there, the app crash and the JVM returns exits code 1.

Configuration

proxies:
#  encryption:
#    level: NOT_SUPPORTED
#    ssl_protocol: TLS
#    truststore:
#      location: /temp/keys
#      format: PCKS12
#      password: secret
    keystore:
      location: /temp/keys1
        format: PCKS12
        password: secret1
  -
      type: mssql
      name: first
      input:
        mssql:
          server: 192.168.1.10
          port: 1434
          user: 'test'
          password: 'test'
      read:
        regex: '(?i)^\s*select.*'
        mssql:
          server: 127.0.0.1
          port: 1433
          user: 'sa'
          password: 'Test!1234'
      write:
        mssql:
          server: 127.0.0.1
          port: 1433
          user: 'sa'
          password: 'Test!1234'
  -
      type: mssql
      name: second
      input:
        mssql:
          server: 192.168.1.10
          port: 1435
          user: 'test'
          password: 'test'
      read:
        regex: '(?i)^\s*select.*'
        mssql:
          server: 127.0.0.1
          port: 1433
          user: 'sa'
          password: 'Test!1234'
      write:
        mssql:
          server: 127.0.0.1
          port: 1433
          user: 'sa'
          password: 'Test!1234'

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

MacBook-Air.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64

Output of java -version

openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9)
OpenJDK 64-Bit Server VM (build 16.0.1+9, mixed mode)

Quarkus version or git rev

Quarkus.1.13.4.Final

Build tool (ie. output of mvnw --version or gradlew --version)


Gradle 7.0.1

Build time: 2021-05-10 16:08:58 UTC
Revision: 67e618faef187783dadd03a34fdab9dc71b85b19

Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 16.0.1 (BellSoft 16.0.1+9)
OS: Mac OS X 11.3.1 aarch64

Additional context

(Add any other context about the problem here.)

@hrstoyanov hrstoyanov added the kind/bug Something isn't working label May 13, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 13, 2021

/cc @evanchooly

@stuartwdouglas
Copy link
Member

Did it generate a dump file that shows what the threads were doing when it crashed?

@radcortez
Copy link
Member

I've tried to reproduce with the steps described, but everything worked for me. It would be great if you could provide us the dump files.

@radcortez
Copy link
Member

Nvm, I was able to reproduce it. Let me have a better look.

@radcortez
Copy link
Member

Here is the actual issue:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:57)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:65)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
Caused by: mapping values are not allowed here
 in 'reader', line 11, column 15:
            format: PCKS12
                  ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:890)

It seems that snakeyaml is not able to parse your YAML file. Because the Config instance is loaded before the application (and fails) the JVM just exists. I can probably adjust the YAML reader to log the exception instead of failing all together.

A way for you to see the exception for now is to just run the application jar (don't add the yaml file in the build, just add it when running the jar).

@hrstoyanov
Copy link
Author

Thanks @radcortez !
I can see the slight misalignment in my encryption section that is causing this ... Damn YAML!
If you think you can fix Quarkus to be more vocal and show the exception, that would help!

@radcortez
Copy link
Member

Yes, I'll try to figure something about it.

@hrstoyanov
Copy link
Author

hrstoyanov commented May 14, 2021

@radcortez
The problem is that when I run the app I get no errors at all:

hristo:~$java --enable-preview -jar dbproxy/build/quarkus-app/quarkus-run.jar -Dsmallrye.config.locations=/Users/hristo/my-setup-jdbc-tests.yaml
  ___                       _         _   ___  ___
 |   \ _  _ _ _  __ _ _ __ (_)_ _  __| | |   \| _ )_ __ _ _ _____ ___  _ 
 | |) | || | ' \/ _` | '  \| | ' \/ _` | | |) | _ \ '_ \ '_/ _ \ \ / || |
 |___/ \_, |_||_\__,_|_|_|_|_|_||_\__,_| |___/|___/ .__/_| \___/_\_\\_, |
       |__/                                       |_|               |__/


                                          Powered by Quarkus 1.13.4.Final
2021-05-14 09:30:29,979 INFO  [ai.dyn.dbp.mp] (main) Current directory: /Users/hristo/projects/gitlab/dynamind/dbproxy
2021-05-14 09:30:29,995 INFO  [ai.dyn.dbp.mp] (main) Hostname: 'Hristos-MacBook-Air.local', interface: name:lo0 (lo0)
2021-05-14 09:30:29,996 INFO  [ai.dyn.dbp.mp] (main) Java: 16.0.1+9
2021-05-14 09:30:29,996 INFO  [ai.dyn.dbp.mp] (main) System user:/Users/hristo
2021-05-14 09:30:29,998 INFO  [ai.dyn.dbp.mp] (main) Started 0 coordinator(s).
2021-05-14 09:30:30,061 INFO  [io.quarkus] (main) dbproxy 1.1.1 on JVM (powered by Quarkus 1.13.4.Final) started in 0.493s. Listening on: http://0.0.0.0:8080
2021-05-14 09:30:30,062 INFO  [io.quarkus] (main) Profile prod activated. 
2021-05-14 09:30:30,062 INFO  [io.quarkus] (main) Installed features: [cache, cdi, config-yaml, hibernate-validator, resteasy, smallrye-context-propagation]
^C2021-05-14 09:30:54,326 INFO  [ai.dyn.dbp.mp] (Shutdown thread) Stopping 0 coordinators...
2021-05-14 09:30:54,326 INFO  [ai.dyn.dbp.mp] (Shutdown thread) Stopped 0 coordinators.
2021-05-14 09:30:54,340 INFO  [io.quarkus] (Shutdown thread) dbproxy stopped in 0.025s
hristo:~$

The silent JVM crash only happens when I use DEVMODE in my IntelliJ setup, which launches the app via Gradle:
image

...So i never see any exception!

@radcortez
Copy link
Member

Because -D system properties with java command need to be passed before -jar. Try flipping the arguments.

@hrstoyanov
Copy link
Author

Aaargh .. you are right!

java  -Dsmallrye.config.locations=/Users/hristo/my-setup-jdbc-tests.yaml --enable-preview -jar dbproxy/build/quarkus-app/quarkus-run.jar

does show the real issue!

@radcortez
Copy link
Member

Great!

@hrstoyanov
Copy link
Author

Yes, I should have figured it out myself ... thanks for helping out with this, hopefully you can do something about it being more obvious why/when it fails in dev mode.

@radcortez
Copy link
Member

Yes , I'll have a look. Sorry for the inconvenience.

@geoand
Copy link
Contributor

geoand commented Aug 4, 2021

Is this still an issue?

@hrstoyanov
Copy link
Author

hrstoyanov commented Aug 5, 2021 via email

@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Aug 6, 2021
@geoand geoand closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode area/kotlin kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

4 participants