quarkiverse / quarkus-roq

An extension to generate/publish static pages from your Quarkus web-app
https://pages.quarkiverse.io/quarkus-roq/
Apache License 2.0
22 stars 11 forks source link

Exception when `layout` front matter is incorrect (Jekyll-ish) #243

Closed dmlloyd closed 3 weeks ago

dmlloyd commented 4 weeks ago

Porting my blog over from Jekyll, I encountered an exception:

2024-11-01 12:04:51,193 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (Aesh InputStream Reader) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor#prepareData threw an exception: java.lang.IllegalStateException: Invalid layout: layouts/post in 2014-02-28-detecting-jni-architecture-is-a-pain-in-the.md
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.mergeParents(RoqFrontMatterDataProcessor.java:90)
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.prepareData(RoqFrontMatterDataProcessor.java:41)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
    at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:499)

    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:354)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:286)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:62)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:200)
    at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:183)
    at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:555)
    at io.quarkus.deployment.console.ConsoleStateManager.forceRestart(ConsoleStateManager.java:175)
    at io.quarkus.deployment.console.ConsoleStateManager.lambda$installBuiltins$0(ConsoleStateManager.java:112)
    at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:77)
    at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:49)
    at io.quarkus.deployment.console.AeshConsole.lambda$setup$1(AeshConsole.java:278)
    at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
    at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
    at org.aesh.terminal.io.Decoder.write(Decoder.java:133)
    at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:216)
    at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor#prepareData threw an exception: java.lang.IllegalStateException: Invalid layout: layouts/post in 2014-02-28-detecting-jni-architecture-is-a-pain-in-the.md
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.mergeParents(RoqFrontMatterDataProcessor.java:90)
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.prepareData(RoqFrontMatterDataProcessor.java:41)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
    at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:499)

    at io.quarkus.builder.Execution.run(Execution.java:124)
    at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
    at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:161)
    at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:350)
    ... 18 more
Caused by: java.lang.IllegalStateException: Invalid layout: layouts/post in 2014-02-28-detecting-jni-architecture-is-a-pain-in-the.md
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.mergeParents(RoqFrontMatterDataProcessor.java:90)
    at io.quarkiverse.roq.frontmatter.deployment.data.RoqFrontMatterDataProcessor.prepareData(RoqFrontMatterDataProcessor.java:41)
    at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
    at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    at org.jboss.threads.JBossThread.run(JBossThread.java:499)

The underlying cause is that my Jekyll-ish posts have layout: post, whereas Roq wants it to be layout: :theme/post. It would be better to provide a nice error instead, or perhaps a warning, and automatically transliterate it.

ia3andy commented 4 weeks ago

@dmlloyd layout: post would work if you have templates/layouts/posts in your project, :theme/post is only to use the theme one..

I agree that the errors and log should be better!