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

NPE when adding new registry in Quarkus CLI #22731

Closed
fedinskiy opened this issue Jan 7, 2022 · 8 comments · Fixed by #22744
Closed

NPE when adding new registry in Quarkus CLI #22731

fedinskiy opened this issue Jan 7, 2022 · 8 comments · Fixed by #22744
Assignees
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/jbang Issues related to when using jbang.dev with Quarkus kind/bug Something isn't working
Milestone

Comments

@fedinskiy
Copy link
Contributor

fedinskiy commented Jan 7, 2022

Describe the bug

When new registry is added into freshly installed Quarkus CLI, the operation fails with NullPointerException.

Expected behavior

New registry is added successfully.

Actual behavior

Exception in console:

java.lang.NullPointerException
	at io.quarkus.registry.config.RegistriesConfigMapperHelper.serialize(RegistriesConfigMapperHelper.java:45)
	at io.quarkus.registry.config.RegistriesConfig$Mutable.persist(RegistriesConfig.java:111)
	at io.quarkus.cli.RegistryAddCommand.call(RegistryAddCommand.java:54)
	at io.quarkus.cli.RegistryAddCommand.call(RegistryAddCommand.java:12)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at io.quarkus.cli.QuarkusCli.run(QuarkusCli.java:50)
	at io.quarkus.cli.QuarkusCli_ClientProxy.run(Unknown Source)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:125)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
	at io.quarkus.cli.Main.main(Main.java:9)

How to Reproduce?

Steps to reproduce:

  1. jbang app uninstall quarkus
  2. rm -r ~/.quarkus/
  3. jbang app install --fresh --force quarkus@quarkusio
$ quarkus version
2.6.1.Final # 2.5.2.Final worked as expected
  1. quarkus registry add registry.quarkus.redhat.com

Output of uname -a or ver

OS name: "linux", version: "5.15.6-100.fc34.x86_64"

Output of java -version

11.0.13, vendor: Eclipse Adoptium

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

@fedinskiy fedinskiy added the kind/bug Something isn't working label Jan 7, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 7, 2022

/cc @ebullient, @maxandersen, @quarkusio/devtools

@quarkus-bot quarkus-bot bot added area/cli Related to quarkus cli (not maven/gradle/etc.) area/jbang Issues related to when using jbang.dev with Quarkus labels Jan 7, 2022
@glefloch
Copy link
Member

glefloch commented Jan 7, 2022

The configYaml can be null


Is there a default value somewhere @ebullient ?

@ebullient
Copy link
Member

ebullient commented Jan 7, 2022

Yeow! how did this get by? Yikes. One sec

@gsmet
Copy link
Member

gsmet commented Jan 7, 2022

@ebullient I release 2.6.2.Final on Monday morning early Paris time so if it's an easy fix and you can get it by then, we can include it.

@glefloch
Copy link
Member

glefloch commented Jan 7, 2022

With some advice, I can give it a try @ebullient.

@ebullient
Copy link
Member

ebullient commented Jan 7, 2022

I have something building now

@glefloch
Copy link
Member

glefloch commented Jan 7, 2022

I pushed a pr but feel free to close it if you have something else. ;)

@ebullient
Copy link
Member

I did close it. I am trying to remove direct access to those Locators outside of the registry client package. Next thing on my list is making them package private. I can't do it just yet because we still have the flying spaghetti monster in there running amok

@ebullient ebullient self-assigned this Jan 7, 2022
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Jan 8, 2022
@gsmet gsmet modified the milestones: 2.7 - main, 2.6.2.Final Jan 8, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/jbang Issues related to when using jbang.dev with Quarkus kind/bug Something isn't working
Projects
None yet
4 participants