bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
764 stars 304 forks source link

Error while applying com.jetbrains.python.run.PythonTracebackFilter on decorator-gen in #6652

Closed ilanKeshet closed 2 months ago

ilanKeshet commented 2 months ago

Description of the bug:

In IntelliJ IDEA 2024.2.0.1 (Ultimate Edition) when com.google.idea.bazel.ijwb (2024.07.30.0.1-api-version-242)

com.intellij.execution.filters.CompositeFilter$ApplyFilterException: Error while applying com.jetbrains.python.run.PythonTracebackFilter@2d87e61c to 'File "<decorator-gen-4>", line 2, in _handle_select
'
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:73)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeLine(AsyncFilterRunner.java:230)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeNextLine(AsyncFilterRunner.java:219)
    at com.intellij.execution.impl.AsyncFilterRunner.runTasks(AsyncFilterRunner.java:149)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:840)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:872)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:138)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:135)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:466)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$2(NonBlockingReadActionImpl.java:481)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:212)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NumberFormatException: For input string: "<decorator-gen-4>"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
    at java.base/java.lang.Integer.parseInt(Integer.java:662)
    at java.base/java.lang.Integer.parseInt(Integer.java:778)
    at com.google.idea.blaze.python.run.BlazePyTracebackParser.findLinkInTrace(BlazePyTracebackParser.java:38)
    at com.jetbrains.python.traceBackParsers.TraceBackParserAdapter.findLinkInTrace(TraceBackParserAdapter.java:41)
    at com.jetbrains.python.run.PythonTracebackFilter.applyFilter(PythonTracebackFilter.kt:29)
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:67)
    ... 41 more

Which category does this issue belong to?

Intellij

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Issue reproduces when switching in and out of the ide (like Cmd + Tab to go to a different application and come back) , or when executing tests.

import prometheus_client

_VALIDATION_TIME = prometheus_client.Summary(
    "metric_name",
    "some description",
    ("command",),
)

@_VALIDATION_TIME.labels("insert").time()
def _handle_insert(statement):
    pass

Which Intellij IDE are you using? Please provide the specific version.

IntelliJ IDEA 2024.2.0.1 (Ultimate Edition)

What programming languages and tools are you using? Please provide specific versions.

Python 3.9.2

What Bazel plugin version are you using?

024.07.30.0.1-api-version-242

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

Environment

IntelliJ IDEA 2024.2.0.1 (Ultimate Edition)
Build #IU-242.20224.387, built on August 13, 2024
Licensed to <Reducted>
Subscription is active until April 24, 2025.
Runtime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.5
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 6096M
Cores: 16
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.jetbrains.plugins.ini4idea (242.20224.385)
  com.ultrahob.zerolength.plugin (0.95)
  artsiomch.meson.syntax (203.1.0)
  org.jetbrains.plugins.go (242.20224.300)
  com.tabnine.TabNine (1.122.0)
  com.intellij.grazie.pro (0.3.326)
  info.fluffos.idea_bison (20230902.02)
  ir.msdehghan.plugins.ansible (0.92)
  name.kropp.intellij.makefile (242.20224.155)
  org.ermadan.kafkalytic (0.10.5)
  org.intellij.plugins.hcl (242.20224.159)
  PythonCore (242.20224.300)
  aws.toolkit.core (3.23-242)
  com.jetbrains.space (242.20224.155)
  org.jetbrains.plugins.ruby (242.20224.387)
  org.jetbrains.plugins.go-template (242.20224.155)
  idea.goyacc (0.1.0)
  Pythonid (242.20224.387)
  com.koxudaxi.pydantic (0.4.14)
  com.intellij.ml.llm (242.20224.393)
  net.seesharpsoft.intellij.plugins.csv (3.4.0-242)
  uk.co.ben-gibson.remote.repository.mapper (4.4.0)
  mobi.hsz.idea.gitignore (4.5.3)
  com.intellij.bigdatatools.core (242.20224.387)
  izhangzhihao.rainbow.brackets.lite (1.2.0)
  org.intellij.scala (2024.2.20)
  com.google.idea.bazel.ijwb (2024.07.30.0.1-api-version-242)
  amazon.q (3.23-242)
  com.github.copilot (1.5.20.6554)
  aws.toolkit (3.23-242)
Kotlin: 242.20224.387-IJ
ilanKeshet commented 2 months ago

apparently they come in pairs of

java.lang.RuntimeException: com.intellij.execution.filters.CompositeFilter$ApplyFilterException: Error while applying com.jetbrains.python.run.PythonTracebackFilter@2d87e61c to 'File "<decorator-gen-4>", line 2, in _handle_select
'
    at com.intellij.execution.impl.AsyncFilterRunner.isQuick(AsyncFilterRunner.java:85)
    at com.intellij.execution.impl.AsyncFilterRunner.highlightHyperlinks(AsyncFilterRunner.java:64)
    at com.intellij.execution.impl.EditorHyperlinkSupport.highlightHyperlinksLater(EditorHyperlinkSupport.java:332)
    at com.intellij.execution.impl.ConsoleViewImpl.highlightHyperlinksAndFoldings(ConsoleViewImpl.java:945)
    at com.intellij.execution.impl.ConsoleViewImpl.flushDeferredText(ConsoleViewImpl.java:754)
    at com.intellij.execution.impl.ConsoleViewImpl$FlushRunnable.doRun(ConsoleViewImpl.java:1608)
    at com.intellij.execution.impl.ConsoleViewImpl$FlushRunnable.run(ConsoleViewImpl.java:1604)
    at com.intellij.util.Alarm$Request.lambda$runSafely$0(Alarm.java:371)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
    at com.intellij.util.Alarm$Request.lambda$runSafely$1(Alarm.java:369)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:255)
    at com.intellij.util.Alarm$Request.runSafely(Alarm.java:368)
    at com.intellij.util.Alarm$Request.run(Alarm.java:356)
    at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:383)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$1(AnyThreadWriteThreadingSupport.kt:184)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:183)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:836)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:425)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithImplicitRead(AnyThreadWriteThreadingSupport.kt:122)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1162)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:78)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:119)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$16(IdeEventQueue.kt:590)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithoutImplicitRead(AnyThreadWriteThreadingSupport.kt:117)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:590)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
    at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
    at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
    at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
    at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
    at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
    at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: com.intellij.execution.filters.CompositeFilter$ApplyFilterException: Error while applying com.jetbrains.python.run.PythonTracebackFilter@2d87e61c to 'File "<decorator-gen-4>", line 2, in _handle_select
'
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:73)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeLine(AsyncFilterRunner.java:230)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeNextLine(AsyncFilterRunner.java:219)
    at com.intellij.execution.impl.AsyncFilterRunner.runTasks(AsyncFilterRunner.java:149)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:840)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:872)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:138)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:135)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:466)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$2(NonBlockingReadActionImpl.java:481)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:212)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NumberFormatException: For input string: "<decorator-gen-4>"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
    at java.base/java.lang.Integer.parseInt(Integer.java:662)
    at java.base/java.lang.Integer.parseInt(Integer.java:778)
    at com.google.idea.blaze.python.run.BlazePyTracebackParser.findLinkInTrace(BlazePyTracebackParser.java:38)
    at com.jetbrains.python.traceBackParsers.TraceBackParserAdapter.findLinkInTrace(TraceBackParserAdapter.java:41)
    at com.jetbrains.python.run.PythonTracebackFilter.applyFilter(PythonTracebackFilter.kt:29)
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:67)
    ... 41 more

and

com.intellij.execution.filters.CompositeFilter$ApplyFilterException: Error while applying com.jetbrains.python.run.PythonTracebackFilter@9278cab to 'File "<decorator-gen-4>", line 2, in _handle_select
'
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:73)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeLine(AsyncFilterRunner.java:230)
    at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeNextLine(AsyncFilterRunner.java:219)
    at com.intellij.execution.impl.AsyncFilterRunner.runTasks(AsyncFilterRunner.java:149)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:840)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:872)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:138)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:135)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:567)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:466)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$2(NonBlockingReadActionImpl.java:481)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:212)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NumberFormatException: For input string: "<decorator-gen-4>"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
    at java.base/java.lang.Integer.parseInt(Integer.java:662)
    at java.base/java.lang.Integer.parseInt(Integer.java:778)
    at com.google.idea.blaze.python.run.BlazePyTracebackParser.findLinkInTrace(BlazePyTracebackParser.java:38)
    at com.jetbrains.python.traceBackParsers.TraceBackParserAdapter.findLinkInTrace(TraceBackParserAdapter.java:41)
    at com.jetbrains.python.run.PythonTracebackFilter.applyFilter(PythonTracebackFilter.kt:29)
    at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:67)
    ... 41 more

image image

ilanKeshet commented 2 months ago

Correction to the above, I now realize that the error only reproduces after I execute tests.

Switching to to the terminal to execute, the command below and switch back to the IDE to reproduce. bazel test --test_output=streamed --curses=no --sandbox_default_allow_network //workspace/some/path/with/tests:some_test --test_arg="-sv" --test_arg=-- --test_arg="--testloglevel=INFO

ilanKeshet commented 1 month ago

Hi @tpasternak The issue still reproduces at 2024.08.27.0.1-api-version-242

image image
ilanKeshet commented 1 month ago

NVM, noticed it's only getting fixed at https://github.com/bazelbuild/intellij/releases/tag/v2024.09.10-rc-1

tpasternak commented 1 month ago

Yes, you can try beta

tpasternak commented 1 month ago

Out of curiosity @ilanKeshet what's the thing that you miss most when it comes to python support in the plugin?

ilanKeshet commented 1 month ago
  1. Having the IDE recognize the python pypi dependencies which we manage with rules_python. If sync a target, it sometimes recognizes them for a while, but not everywhere and not for long.
  2. BTW, Every time I click sync on a target, it changes the project SDK back to Java and i have to go and change it back to python, both of these cause the IDE to re-index.
  3. Auto-generate build targets when adding a python import (Yeah, i know its a lot to ask)
  4. Better support for executing test targets, especially bazel generated test targets. like, we have our own macro's which inject tests templated tests

Many thanks @tpasternak 🙏

tpasternak commented 1 month ago

Thank you for the feedback! You can also try the new plugin, however python is still in available behind feature flag / with caveats state

https://github.com/JetBrains/hirschgarten/blob/main/docs/feature_matrix.md

tpasternak commented 1 month ago
  1. Having the IDE recognize the python pypi dependencies which we manage with rules_python. If sync a target, it sometimes recognizes them for a while, but not everywhere and not for long.

Do you think it could get improved by this? https://github.com/bazelbuild/intellij/pull/6606

  1. BTW, Every time I click sync on a target, it changes the project SDK back to Java and i have to go and change it back to python, both of these cause the IDE to re-index.

Probably a low hanging fruit

  1. Auto-generate build targets when adding a python import (Yeah, i know its a lot to ask)

Yeah, that would be a big thing. But still you can reduce waiting time by using partial import

  1. Better support for executing test targets, especially bazel generated test targets. like, we have our own macro's which inject tests templated tests

For that, we would need a repro, but I can't guarantee it will be fixed in this plugin

ilanKeshet commented 1 month ago

Do you think it could get improved by this? https://github.com/bazelbuild/intellij/pull/6606

Actually, I've never faced that issue, we try to keep our package structure to a very strict yet simple use cases, basically each directory is also a bazel package, no gaps. and for the most part, no nesting (i.e. build file and source file share a directory)

tpasternak commented 1 month ago

@ilanKeshet One more thing. When comes to this item

Auto-generate build targets when adding a python import (Yeah, i know its a lot to ask)

you should probably take a look at gazelle https://github.com/bazelbuild/rules_python/blob/main/gazelle/README.md

this is exactly what you need, and compatible with the plugin