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

Qute template detection has changed on Windows for templates in project dependencies #42571

Closed
michalvavrik opened this issue Aug 15, 2024 · 9 comments · Fixed by #42588
Closed
Assignees
Labels
area/qute The template engine env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Aug 15, 2024

Describe the bug

I have app that has Jakarta REST resources and Qute templates in separate Maven project and imports this project as dependency to Quarkus application. Now I can see that template is not detected anymore in 999-SNAPSOT. It seems like behavior has changed in last 24 hours. I have looked to merge commits and only thing that seems related by description is #42492 (cc @gsmet ) but I didn't try it. I checked io.quarkus.qute.deployment.QuteProcessor#collectTemplates though and it seems like that PR touched related code.

Expected behavior

Behavior on Linux and Windows should be same or differences should be documented.

Actual behavior

Build fails and exception is raised:

2024-08-15T10:41:59.2320281Z [ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (build) on project qute-test: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
2024-08-15T10:41:59.2325699Z [ERROR] 	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: jakarta.enterprise.inject.spi.DeploymentException: io.quarkus.qute.TemplateException: No template found for path [page] defined at parameter 'page' of io.quarkus.ts.qute.api.MyQuteResource constructor
2024-08-15T10:41:59.2327938Z [ERROR] 	- available templates: []
2024-08-15T10:41:59.2328556Z [ERROR] 	at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1551)
2024-08-15T10:41:59.2329473Z [ERROR] 	at io.quarkus.arc.processor.BeanProcessor.processValidationErrors(BeanProcessor.java:187)
2024-08-15T10:41:59.2330356Z [ERROR] 	at io.quarkus.arc.deployment.ArcProcessor.generateResources(ArcProcessor.java:520)
2024-08-15T10:41:59.2331355Z [ERROR] 	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
2024-08-15T10:41:59.2332160Z [ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:854)
2024-08-15T10:41:59.2332913Z [ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
2024-08-15T10:41:59.2333699Z [ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2024-08-15T10:41:59.2334923Z [ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
2024-08-15T10:41:59.2336112Z [ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
2024-08-15T10:41:59.2336962Z [ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
2024-08-15T10:41:59.2337650Z [ERROR] 	at java.base/java.lang.Thread.run(Thread.java:840)
2024-08-15T10:41:59.2338195Z [ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:483)
2024-08-15T10:41:59.2339710Z [ERROR] Caused by: io.quarkus.qute.TemplateException: No template found for path [page] defined at parameter 'page' of io.quarkus.ts.qute.api.MyQuteResource constructor
2024-08-15T10:41:59.2341103Z [ERROR] 	- available templates: []
2024-08-15T10:41:59.2341844Z [ERROR] 	at io.quarkus.qute.deployment.QuteProcessor.validateTemplateInjectionPoints(QuteProcessor.java:2241)
2024-08-15T10:41:59.2342526Z [ERROR] 	... 9 more
2024-08-15T10:41:59.2342807Z [ERROR] -> [Help 1]

How to Reproduce?

Steps to reproduce the behavior:

  1. git clone git@github.com:quarkus-qe/quarkus-test-suite.git
  2. cd quarkus-test-suite/qute/multimodule
  3. mvn clean verify

Output of uname -a or ver

Microsoft Windows Server 2022 10.0.20348

Output of java -version

Temurin 17.0.12+7

Quarkus version or git rev

999-SNAPSHOT

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

Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)

Additional information

You can see logs here: https://github.com/quarkus-qe/quarkus-test-suite/actions/runs/10401726443/job/28805582860
And previous runs here: https://github.com/quarkus-qe/quarkus-test-suite/actions/workflows/daily.yaml

@michalvavrik michalvavrik added kind/bug Something isn't working area/qute The template engine labels Aug 15, 2024
@quarkus-bot quarkus-bot bot added the env/windows Impacts Windows machines label Aug 15, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 15, 2024

/cc @mkouba (qute)

@gsmet gsmet self-assigned this Aug 16, 2024
@gsmet
Copy link
Member

gsmet commented Aug 16, 2024

Yeah there's a good chance that it's related.

@gsmet
Copy link
Member

gsmet commented Aug 16, 2024

Ah it's on Windows... very nice...

@gsmet
Copy link
Member

gsmet commented Aug 16, 2024

@aloubyansky I think this is probably related to what you made me change in my patch to use the container path instead of the root path for getRoots().

In PathTreeUtils, you are actually visiting the roots without the proper PathTree API and thus it won't scan it given we just return the path to the zip and not the ZipPath:

https://github.com/quarkusio/quarkus/blob/main/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTreeUtils.java#L49-L98

Either we go back to what I initially did or PathTreeUtils needs a fix.

Note that I don't have Windows so I wasn't able to reproduce the issue but I'm pretty sure that's the issue here.

@gsmet
Copy link
Member

gsmet commented Aug 16, 2024

@michalvavrik I created #42588 to get back to the initial behavior of my patch. Any chance you could check if it fixes the issue on Windows?

@michalvavrik
Copy link
Member Author

@michalvavrik I created #42588 to get back to the initial behavior of my patch. Any chance you could check if it fixes the issue on Windows?

Technically it's not a problem (it's just setting up CI or creating OpenStack or AWS instance), but I am fighting with time for next 5 days. Ideally, I can just confirm when it is merged (rerun CI).

@gsmet
Copy link
Member

gsmet commented Aug 16, 2024

@michalvavrik sure, let's do that, I think it's very likely that it is the issue.

@michalvavrik
Copy link
Member Author

Fix did the trick and Windows CI is fixed. Thank you.

@gsmet
Copy link
Member

gsmet commented Aug 17, 2024

Awesome! Thanks for the detailed report and the confirmation!

@gsmet gsmet modified the milestones: 3.16 - main, 3.13.3 Aug 19, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Aug 19, 2024
The container path is the path of the container (could be a directory or
an archive and shouldn't be used for browsing.
The root path is the path of the root. In the case of an archive, it's
actually a ZipPath, which can be used to browse the archive.

Fixes quarkusio#42571

(cherry picked from commit 6dd6150)
gsmet added a commit to gsmet/quarkus that referenced this issue Aug 20, 2024
The container path is the path of the container (could be a directory or
an archive and shouldn't be used for browsing.
The root path is the path of the root. In the case of an archive, it's
actually a ZipPath, which can be used to browse the archive.

Fixes quarkusio#42571

(cherry picked from commit 6dd6150)
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
The container path is the path of the container (could be a directory or
an archive and shouldn't be used for browsing.
The root path is the path of the root. In the case of an archive, it's
actually a ZipPath, which can be used to browse the archive.

Fixes quarkusio#42571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants