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

re-augmentation causes information to get lost in 2.0.0.CR2 #17592

Closed
renegrob opened this issue Jun 1, 2021 · 10 comments · Fixed by #17689
Closed

re-augmentation causes information to get lost in 2.0.0.CR2 #17592

renegrob opened this issue Jun 1, 2021 · 10 comments · Fixed by #17689
Labels
area/core kind/bug Something isn't working
Milestone

Comments

@renegrob
Copy link
Contributor

renegrob commented Jun 1, 2021

Describe the bug

Some of the generated code in /quarkus-app/quarkus/generated-bytecode.jar gets lost if the project is re-augmented after the build.

Expected behavior

I can run re-augmentation any number of time and will always get the original if no build time properties have changed.

Actual behavior

The augmentation output after re-augmentation is reduced and leads to a different runtime behavior.

To Reproduce

  • Checkout https://github.com/renegrob/reproducer-base/tree/reaugmentation-issue
  • build project with ./gradlew clean :app:quarkusBuild -Dquarkus.package.type=mutable-jar
  • Copy the augmentation output in app/build/quarkus-app/quarkus/ away.
  • Run re-augmentation without changing the configuation: java -jar -Dquarkus.launch.rebuild=true app/build/quarkus-app/quarkus-run.jar

If you compare the initial augmentation output and the one after re-augmentation you notice that:

  • open-api-doc is empty after re-augmentation: reproducer-base/app/build/quarkus-app/quarkus/generated-bytecode.jar!/META-INF/quarkus-generated-openapi-doc.YAML

(See also https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/2.2E0.2E0.2ECR2.20NullPointerExceptions.20after.20Reagumentation)

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
https://github.com/renegrob/reproducer-base/tree/reaugmentation-issue

Or attach an archive containing the reproducer to the issue.

Environment (please complete the following information):

Output of uname -a or ver

Linux automatix 5.8.0-53-generic #60~20.04.1-Ubuntu

Output of java -version

openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment Zulu11.48+21-CA (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.48+21-CA (build 11.0.11+9-LTS, mixed mode)

GraalVM version (if different from Java)

n/a

Quarkus version or git rev

2.0.0.CR2

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

------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------

Build time:   2020-06-30 06:32:47 UTC
Revision:     66bc713f7169626a7f0134bf452abde51550ea0a

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.11 (Azul Systems, Inc. 11.0.11+9-LTS)
OS:           Linux 5.8.0-53-generic amd64

Additional context

n/a

@renegrob renegrob added the kind/bug Something isn't working label Jun 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 1, 2021

/cc @evanchooly

@gsmet
Copy link
Member

gsmet commented Jun 1, 2021

@stuartwdouglas looks like something for you.

@stuartwdouglas
Copy link
Member

I just tested the reproducer and it appeared to work fine.

@renegrob
Copy link
Contributor Author

renegrob commented Jun 4, 2021

Hi @stuartwdouglas,
Sorry, maybe I didn't describe it that good. I couldn't reproduce the real issue with the RuntimeExcpetion yet. Yes, the reproducer will run "correctly" before and after re-augmentation. What the reproducer shows is that some beans and other information such as the quarkus-generated-openapi-doc are missing or contain much less information after re-augmentation. That's what this issue is about. Re-augmentation - at least in my point of view - should produce the same output as the augmentation step during the build (except for IDs and timestamps that are produced on the fly), at least there shouldn't be anything missing.
However if you did the steps described in the section "To Reproduce", was your re-augmentation output not different from the original output (except for random / time-based content)? If yes, did you build it against 2.0.0.RC2or a newer build?
I know that it may sound unessential to fix something that doesn't lead to a reproducible error. In our real world project many beans disappear after re-augmentation (see: https://zulip-uploads.s3.amazonaws.com/11321/EnisxqygcnOWXcp2OVyMFykC/image.png?AWSAccessKeyId=AKIAIEVMBCAT2WD3M5KQ&Signature=zgGk7TYU2UYLjgJObHmUoMqkp1s%3D&Expires=1622786951) and I think when we know why the re-augmentation produces a different output, we'll know how to fix it.
For me it is a big blocker to move to Quarkus 2.x but I understand that it only affects users that do re-augmentation and maybe not even all of them.

@renegrob
Copy link
Contributor Author

renegrob commented Jun 4, 2021

What I can reproduce though is:
Do a clean build

./gradlew clean :app:quarkusBuild -Dquarkus.package.type=mutable-jar

Start Quarkus

java -jar app/build/quarkus-app/quarkus-run.jar
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-06-04 08:27:16,804 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (main) Agroal does not support detecting if a connection is still usable after an exception for database kind: other
2021-06-04 08:27:16,961 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose start
2021-06-04 08:27:16,962 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose synched
2021-06-04 08:27:16,974 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose script done
2021-06-04 08:27:16,986 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose end
2021-06-04 08:27:17,349 INFO  [io.quarkus] (main) app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.0.CR2) started in 1.357s. Listening on: http://0.0.0.0:8080
2021-06-04 08:27:17,351 INFO  [io.quarkus] (main) Profile prod activated. 
2021-06-04 08:27:17,351 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, config-yaml, hibernate-orm, hibernate-orm-panache, hibernate-validator, jdbc-postgresql, micrometer, narayana-jta, rest-client, rest-client-jackson, resteasy, resteasy-jackson, scheduler, security, smallrye-context-propagation, smallrye-health, smallrye-openapi, spring-data-jpa, spring-di, swagger-ui]
executing scheduled task...
com.github.renegrob.SlowBean@b9fc178
test: true
^C2021-06-04 08:27:21,872 INFO  [io.quarkus] (Shutdown thread) app stopped in 0.046s

Do re-augmentation

java -jar -Dquarkus.launch.rebuild=true app/build/quarkus-app/quarkus-run.jar

Start Quarkus

java -jar app/build/quarkus-app/quarkus-run.jar
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-06-04 08:29:42,993 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:42,993 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false
2021-06-04 08:29:42,993 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true
2021-06-04 08:29:42,993 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true
2021-06-04 08:29:42,994 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:42,994 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false
2021-06-04 08:29:42,994 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true
2021-06-04 08:29:42,994 DEBUG [org.jbo.res.res.i18n] (main) RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true
2021-06-04 08:29:43,016 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:43,016 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:43,017 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:43,017 DEBUG [org.jbo.res.res.i18n] (main) Provider : org.jboss.resteasy.plugins.providers.DocumentProvider,  Method : DocumentProvider
2021-06-04 08:29:43,130 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (main) Agroal does not support detecting if a connection is still usable after an exception for database kind: other
2021-06-04 08:29:43,286 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose start
2021-06-04 08:29:43,286 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose synched
2021-06-04 08:29:43,299 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose script done
2021-06-04 08:29:43,309 INFO  [hsq.db.HSQ.ENGINE] (agroal-11) checkpointClose end
2021-06-04 08:29:43,666 INFO  [io.quarkus] (main) app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.0.CR2) started in 1.287s. Listening on: http://0.0.0.0:8080
2021-06-04 08:29:43,666 INFO  [io.quarkus] (main) Profile prod activated. 
2021-06-04 08:29:43,667 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, config-yaml, hibernate-orm, hibernate-orm-panache, hibernate-validator, jdbc-postgresql, micrometer, narayana-jta, rest-client, rest-client-jackson, resteasy, resteasy-jackson, scheduler, security, smallrye-context-propagation, smallrye-health, smallrye-openapi, spring-data-jpa, spring-di, swagger-ui]
executing scheduled task...

-> There are RESTEAY DEBUG logs due to the missing RestEasyConfigSupport bean. The NPE is catched and swallowed so the application still runs. Unfortunately on my real world project more essential beans are missing.

@stuartwdouglas
Copy link
Member

I build the reproducer as-is and looked at the openapi document, and it seemed to be the same before and after.

@stuartwdouglas
Copy link
Member

Ok, I see the beans change.

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jun 4, 2021
stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jun 4, 2021
@stuartwdouglas
Copy link
Member

Can you test out #17689 and see if it fixes your issue?

@renegrob
Copy link
Contributor Author

renegrob commented Jun 4, 2021

Yes, I will as soon as I can.

@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 4, 2021
@renegrob
Copy link
Contributor Author

renegrob commented Jun 4, 2021

I tried to retest. Unfortunately on 999-SNAPSHOT the re-augmentation didn't work for other reasons (see Zulip Chat).

@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final Jun 7, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 7, 2021
Fixes quarkusio#17592

(cherry picked from commit 2e28b51)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants