question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jbang w/jib/kubernetes gives "could not find matching project info to read"

See original GitHub issue

Describe the bug similar to #11888 but this time not about class loading issues but about dekorate assuming ‘stuff’ we’ll need to fix/adapt to.

//usr/bin/env jbang "$0" "$@" ; exit $?
/**
 * Run this with `jbang -Dquarkus.container-image.build=true build quarkus.java`
 * and it builds a docker image.
 */
//DEPS io.quarkus:quarkus-resteasy:${q.v:1.8.0.CR1}
//DEPS io.quarkus:quarkus-container-image-jib:${q.v:1.8.0.CR1}
//DEPS io.quarkus:quarkus-kubernetes:${q.v:1.8.0.CR1}
//JAVA_OPTIONS -Djava.util.logging.manager=org.jboss.logmanager.LogManager
//Q:CONFIG quarkus.container-image.name=quarkusjbangdemo

import io.quarkus.runtime.Quarkus;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/hello")
@ApplicationScoped
public class quarkusjib {

    @GET
    public String sayHello() {
        return "hello from Quarkus with jbang.dev";
    }

    public static void main(String[] args) {
        Quarkus.run(args);
    }
}

run that with jbang --verbose -Dq.v=999-SNAPSHOT quarkusjib.java and you get:

dev.jbang.ExitException: Issue running postBuild()
	at dev.jbang.IntegrationManager.runIntegration(IntegrationManager.java:116)
	at dev.jbang.cli.Run.build(Run.java:206)
	at dev.jbang.cli.Run.doCall(Run.java:96)
	at dev.jbang.cli.BaseCommand.call(BaseCommand.java:59)
	at dev.jbang.cli.BaseCommand.call(BaseCommand.java:13)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at dev.jbang.Main.main(Main.java:14)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at dev.jbang.IntegrationManager.runIntegration(IntegrationManager.java:89)
	... 12 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at io.quarkus.launcher.JBangIntegration.postBuild(JBangIntegration.java:85)
	... 17 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.launcher.JBangIntegration.postBuild(JBangIntegration.java:77)
	... 17 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kubernetes.deployment.KubernetesProcessor#build threw an exception: java.lang.IllegalStateException: Could not find matching project info read
	at io.dekorate.project.FileProjectFactory.lambda$createInternal$0(FileProjectFactory.java:60)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.dekorate.project.FileProjectFactory.createInternal(FileProjectFactory.java:60)
	at io.dekorate.project.FileProjectFactory.create(FileProjectFactory.java:41)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.createProject(KubernetesProcessor.java:936)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.build(KubernetesProcessor.java:314)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

	at io.quarkus.bootstrap.JBangBuilderImpl.postBuild(JBangBuilderImpl.java:81)
	... 22 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kubernetes.deployment.KubernetesProcessor#build threw an exception: java.lang.IllegalStateException: Could not find matching project info read
	at io.dekorate.project.FileProjectFactory.lambda$createInternal$0(FileProjectFactory.java:60)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.dekorate.project.FileProjectFactory.createInternal(FileProjectFactory.java:60)
	at io.dekorate.project.FileProjectFactory.create(FileProjectFactory.java:41)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.createProject(KubernetesProcessor.java:936)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.build(KubernetesProcessor.java:314)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:132)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
	at io.quarkus.bootstrap.JBangBuilderImpl.postBuild(JBangBuilderImpl.java:78)
	... 22 more
Caused by: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kubernetes.deployment.KubernetesProcessor#build threw an exception: java.lang.IllegalStateException: Could not find matching project info read
	at io.dekorate.project.FileProjectFactory.lambda$createInternal$0(FileProjectFactory.java:60)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.dekorate.project.FileProjectFactory.createInternal(FileProjectFactory.java:60)
	at io.dekorate.project.FileProjectFactory.create(FileProjectFactory.java:41)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.createProject(KubernetesProcessor.java:936)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.build(KubernetesProcessor.java:314)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

	at io.quarkus.deployment.jbang.JBangAugmentorImpl.accept(JBangAugmentorImpl.java:119)
	at io.quarkus.deployment.jbang.JBangAugmentorImpl.accept(JBangAugmentorImpl.java:36)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
	... 24 more
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kubernetes.deployment.KubernetesProcessor#build threw an exception: java.lang.IllegalStateException: Could not find matching project info read
	at io.dekorate.project.FileProjectFactory.lambda$createInternal$0(FileProjectFactory.java:60)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.dekorate.project.FileProjectFactory.createInternal(FileProjectFactory.java:60)
	at io.dekorate.project.FileProjectFactory.create(FileProjectFactory.java:41)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.createProject(KubernetesProcessor.java:936)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.build(KubernetesProcessor.java:314)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

	at io.quarkus.builder.Execution.run(Execution.java:116)
	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:149)
	at io.quarkus.deployment.jbang.JBangAugmentorImpl.accept(JBangAugmentorImpl.java:97)
	... 26 more
Caused by: java.lang.IllegalStateException: Could not find matching project info read
	at io.dekorate.project.FileProjectFactory.lambda$createInternal$0(FileProjectFactory.java:60)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at io.dekorate.project.FileProjectFactory.createInternal(FileProjectFactory.java:60)
	at io.dekorate.project.FileProjectFactory.create(FileProjectFactory.java:41)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.createProject(KubernetesProcessor.java:936)
	at io.quarkus.kubernetes.deployment.KubernetesProcessor.build(KubernetesProcessor.java:314)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
aloubyanskycommented, Sep 15, 2020

There are:

  1. CurateOutcomeBuildItem.getEffectiveModel() that returns AppModel which contains the root plus all its deps (from the workspace or the repo)
  2. ApplicationArchivesBuildItem.getRootArchive(). Is that insufficient?
0reactions
geoandcommented, Jul 27, 2021

I recently added io.quarkus.kubernetes.spi.CustomProjectRootBuildItem for the purpose of supporting the @QuarkusProdModeTest, but it might be useful in this case as well. Basically, we just need to customize the build chain to add this build item when augmentation from JBang takes place

Read more comments on GitHub >

github_iconTop Results From Across the Web

Usage - JBang
A classname, can be anything when using jbang but to be valid java for most IDEs you'll want to name it the same...
Read more >
documentation add alias sample is incorrect #943 - GitHub
Page https://www.jbang.dev/documentation/guide/latest/alias_catalogs ... [jbang] [ERROR] Script or alias could not be found or read: 'hello' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found