wildfly / wildfly-github-bot

GitHub bot for WildFly project.
Apache License 2.0
3 stars 13 forks source link

LifeCycleProcessor blocks development when any installation is suspended #131

Closed xstefank closed 1 year ago

xstefank commented 1 year ago
2023-08-11 17:39:37,500 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
    at io.quarkus.runner.GeneratedMain.main(Unknown Source)
    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.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:104)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Unable to create a GitHub token for the installation 40616909
    at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:167)
    at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:156)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:183)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2677)
    at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2675)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2658)
    at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:58)
    at io.quarkiverse.githubapp.runtime.github.GitHubService.createInstallationClient(GitHubService.java:119)
    at io.quarkiverse.githubapp.runtime.github.GitHubService.getInstallationClient(GitHubService.java:75)
    at io.quarkiverse.githubapp.runtime.github.GitHubService_ClientProxy.getInstallationClient(Unknown Source)
    at io.xstefank.wildfly.bot.LifecycleProcessor.onStart(LifecycleProcessor.java:70)
    at io.xstefank.wildfly.bot.LifecycleProcessor_Observer_onStart_8cc56ca229df8209c2d59914dd9480d0e1f73dbf.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.handleLifecycleEvents(ArcRecorder.java:106)
    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
    ... 13 more
Caused by: org.kohsuke.github.HttpException: {"message":"This installation has been suspended","documentation_url":"https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app"}
    at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:62)
    at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:473)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:435)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:403)
    at org.kohsuke.github.Requester.fetch(Requester.java:85)
    at org.kohsuke.github.GHAppCreateTokenBuilder.create(GHAppCreateTokenBuilder.java:116)
    at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:163)

This block tests, even dev mode. So I had to disable this altogether - https://github.com/xstefank/wildfly-github-bot/blob/main/src/main/java/io/xstefank/wildfly/bot/LifecycleProcessor.java#L64-L66

xstefank commented 1 year ago

resolved by https://github.com/xstefank/wildfly-github-bot/pull/137