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

DispatchException caused by "Can't overwrite cause with ..." #933

Closed
detouched opened this issue Jan 14, 2019 · 1 comment
Closed

DispatchException caused by "Can't overwrite cause with ..." #933

detouched opened this issue Jan 14, 2019 · 1 comment
Labels

Comments

@detouched
Copy link

I get a reproducible error which is related to exception copying during stack trace recovery in continuation.

Is it me doing something wrong or an actual bug?

kotlinx.coroutines.DispatchException: Unexpected exception running DispatchedContinuation[BlockingEventLoop@d8773a7, Continuation at com/atlassian/bitbucket/cloud/rest/oauth/OAuth$refreshTokens$2$2.invokeSuspend(feature.kt:75)@3df03bfc]
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:237)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:76)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:53)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:35)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.atlassian.bitbucket.linky.actions.snippet.CreateSnippetAction$actionPerformed$1$run$1$1.invokeSuspend(create-snippet.kt:73)
	at com.atlassian.bitbucket.linky.actions.snippet.CreateSnippetAction$actionPerformed$1$run$1$1.invoke(create-snippet.kt)
	at com.atlassian.bitbucket.linky.actions.authenticated.DefaultCloudAuthenticator$invoke$2.invokeSuspend(cloud-authentication.kt:34)
	at com.atlassian.bitbucket.linky.actions.authenticated.DefaultCloudAuthenticator$invoke$2.invoke(cloud-authentication.kt)
	at com.atlassian.bitbucket.linky.actions.authenticated.DefaultCloudAuthenticator.invoke(cloud-authentication.kt:39)
	at com.atlassian.bitbucket.linky.actions.snippet.CreateSnippetAction$actionPerformed$1$run$1.invokeSuspend(create-snippet.kt:52)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:76)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:53)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:35)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.atlassian.bitbucket.linky.actions.snippet.CreateSnippetAction$actionPerformed$1.run(create-snippet.kt:51)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:710)
	at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:179)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:568)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:519)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:128)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:309)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Can't overwrite cause with com.atlassian.bitbucket.cloud.rest.oauth.OAuthNotConfiguredException: OAuth is not configured
	at java.lang.Throwable.initCause(Throwable.java:457)
	at kotlinx.coroutines.internal.ExceptionsConstuctorKt$tryCopyException$3.invoke(ExceptionsConstuctor.kt:38)
	at kotlinx.coroutines.internal.ExceptionsConstuctorKt$tryCopyException$3.invoke(ExceptionsConstuctor.kt)
	at kotlinx.coroutines.internal.ExceptionsConstuctorKt.tryCopyException(ExceptionsConstuctor.kt:44)
	at kotlinx.coroutines.internal.StackTraceRecoveryKt.recoverFromStackFrame(StackTraceRecovery.kt:59)
	at kotlinx.coroutines.internal.StackTraceRecoveryKt.recoverStackTrace(StackTraceRecovery.kt:48)
	at kotlinx.coroutines.internal.ScopeCoroutine.onCompletionInternal$kotlinx_coroutines_core(Scopes.kt:25)
	at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:305)
	at kotlinx.coroutines.JobSupport.tryFinalizeFinishingState(JobSupport.kt:230)
	at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:799)
	at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:742)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:117)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:45)
	at kotlinx.coroutines.ResumeModeKt.resumeUninterceptedWithExceptionMode(ResumeMode.kt:56)
	at kotlinx.coroutines.TimeoutCoroutine.onCompletionInternal$kotlinx_coroutines_core(Timeout.kt:96)
	at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:305)
	at kotlinx.coroutines.JobSupport.tryFinalizeFinishingState(JobSupport.kt:230)
	at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:799)
	at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:742)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:117)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:45)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:285)
	... 34 more
Caused by: com.atlassian.bitbucket.cloud.rest.oauth.OAuthNotConfiguredException: OAuth is not configured
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	... 55 more
@qwwdfsad qwwdfsad added the bug label Jan 14, 2019
@qwwdfsad
Copy link
Collaborator

This a bug, which is reproduced when initCause of exception throws another exception.
Thanks for reporting!

qwwdfsad added a commit that referenced this issue Jan 15, 2019
…to avoid DispatchException when initCause throws

Fixes #933
qwwdfsad added a commit that referenced this issue Jan 31, 2019
…to avoid DispatchException when initCause throws

Fixes #933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants