p2-inc / keycloak-themes

Themes and theme utilities meant for simple theme customization without deploying a packaged theme
https://phasetwo.io
Other
28 stars 11 forks source link

Need null check for temp folder delete #29

Closed xgp closed 4 months ago

xgp commented 4 months ago
...
2024-04-03 14:54:14,032 INFO  [io.phasetwo.keycloak.resources.EventsResourceProviderFactory] (main) initializing event roles following migration
2024-04-03 14:54:14,108 INFO  [io.quarkus] (main) Keycloak 24.0.2 on JVM (powered by Quarkus 3.8.3) started in 4.338s. Listening on:
2024-04-03 14:54:14,108 INFO  [io.quarkus] (main) Profile import_export activated.
2024-04-03 14:54:14,108 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-postgresql, keycloak, logging-gelf, narayana-jta, reacti
ve-routes, rest-client-reactive, rest-client-reactive-jackson, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]
2024-04-03 14:54:14,118 INFO  [io.phasetwo.keycloak.events.HttpSenderEventListenerProviderFactory] (main) Shutting down scheduler
2024-04-03 14:54:14,118 INFO  [io.phasetwo.keycloak.events.WebhookSenderEventListenerProviderFactory] (main) Shutting down scheduler
2024-04-03 14:54:14,119 WARN  [io.phasetwo.keycloak.themes.theme.AttributeThemeProviderFactory] (main) Error removing tmpdir: java.lang.NullPointerException: Ca
nnot invoke "java.io.File.toPath()" because "dir" is null
        at io.phasetwo.keycloak.themes.theme.AttributeThemeProviderFactory.deleteRecursively(AttributeThemeProviderFactory.java:48)
        at io.phasetwo.keycloak.themes.theme.AttributeThemeProviderFactory.close(AttributeThemeProviderFactory.java:41)
        at org.keycloak.services.DefaultKeycloakSessionFactory.close(DefaultKeycloakSessionFactory.java:403)
        at org.keycloak.services.resources.KeycloakApplication.shutdown(KeycloakApplication.java:159)
        at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.onShutdownEvent(QuarkusKeycloakApplication.java:50)
        at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication_Observer_onShutdownEvent_twTBYFGt8XmSD26Lx0ni0jbf_WY.notify(Unknown Source)
        at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:346)
        at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:328)
        at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:82)
        at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:155)
        at io.quarkus.arc.runtime.ArcRecorder$2.run(ArcRecorder.java:111)
        at io.quarkus.runtime.StartupContext.runAllInReverseOrder(StartupContext.java:84)
        at io.quarkus.runtime.StartupContext.close(StartupContext.java:73)
        at io.quarkus.runner.ApplicationImpl.doStop(Unknown Source)
        at io.quarkus.runtime.Application.stop(Application.java:208)
        at io.quarkus.runtime.Application.stop(Application.java:155)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:228)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
        at org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:117)
        at org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:33)
        at org.keycloak.quarkus.runtime.cli.command.AbstractExportImportCommand.run(AbstractExportImportCommand.java:47)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:125)
        at org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:107)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)

2024-04-03 14:54:14,142 INFO  [io.quarkus] (main) Keycloak stopped in 0.031s
xgp commented 4 months ago

First reported here https://github.com/p2-inc/keycloak-orgs/issues/216 so it happens during an import/export.

xgp commented 4 months ago

This is just a warning. It is caught and doesn't propagate.