Flank/flank

Flank fails to run when using a proxy

inktomi opened this issue · 4 comments

Describe the bug
When running the latest version of Flank in our environment, which requires a proxy, we get the following error. This happens on Flank v22.03.0 but not on v21.09.0. I suspect it's related to the work done in #2176

Warning: Failed to make bucket for ...our-bucket...
Cause: java.lang.NullPointerException: Cannot read field "seconds" because "otherDuration" is null
java.lang.RuntimeException: java.lang.NullPointerException: Cannot read field "seconds" because "otherDuration" is null
        at ftl.client.google.IosCatalog.iosDeviceCatalog(IosCatalog.kt:58)
        at ftl.client.google.IosCatalog.getModels(IosCatalog.kt:21)
        at ftl.client.google.AndroidCatalog.isVirtualDevice(AndroidCatalog.kt:51)
        at ftl.args.PrepareAndroidCommonConfigKt.resolveDeviceType(PrepareAndroidCommonConfig.kt:14)
        at ftl.args.PrepareAndroidCommonConfigKt.prepareAndroidCommonConfig(PrepareAndroidCommonConfig.kt:10)
        at ftl.args.CreateAndroidArgsKt.createAndroidArgs$default(CreateAndroidArgs.kt:15)
        at ftl.domain.RunTestAndroidKt.invoke(RunTestAndroid.kt:46)
        at ftl.presentation.cli.firebase.test.android.AndroidRunCommand.run(AndroidRunCommand.kt:58)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
        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 ftl.Main$main$1.invoke(Main.kt:12)
        at ftl.Main$main$1.invoke(Main.kt:10)
        at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:28)
        at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:17)
        at ftl.Main.main(Main.kt:10)
Caused by: java.lang.NullPointerException: Cannot read field "seconds" because "otherDuration" is null
        at java.base/java.time.Duration.compareTo(Duration.java:1411)
        at com.google.auth.oauth2.OAuth2Credentials.getState(OAuth2Credentials.java:342)
        at com.google.auth.oauth2.OAuth2Credentials.asyncFetch(OAuth2Credentials.java:207)
        at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:170)
        at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96)
        at ftl.http.HttpTimeoutIncrease.initialize(HttpTimeoutIncrease.kt:10)
        at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:91)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:404)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
        at ftl.http.ExecuteWithRetryKt$executeWithRetry$$inlined$withRetry$1.invokeSuspend(ExecuteWithRetry.kt:52)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at ftl.http.ExecuteWithRetryKt.executeWithRetry(ExecuteWithRetry.kt:52)
        at ftl.client.google.IosCatalog.iosDeviceCatalog(IosCatalog.kt:53)
        ... 20 more

The newer version throws this error consistently on both of our VPNs, which both require a proxy. The older version fails on our more restrictive VPN, but not on one that's less locked down.

To Reproduce
Try to run flank in a proxied environment.

Details (please complete the following information):
I think this is likely an upstream issue, and I'm happy to report it there if you can direct me to the proper place.

@inktomi You might want to try reporting the upstream issue here https://github.com/googleapis/google-auth-library-java

Thank you! I'll report it there, and then I'll open a new issue here once it's resolved upstream.

We can leave this issue open here since it's not fixed in Flank yet. I agree it's likely an upstream issue based on the stack trace.

I flagged this to the FTL product manager.