Stack traces and tracebacks

When an unexpected error occurs in Deephaven, it is often presented as an exception with a stack trace. In Python, a stack trace is referred to as a "traceback." To effectively debug a query, it is essential to learn how to read an exception. An exception can emanate from Python or Java. Because the Deephaven engine is Java under the hood, many Python exceptions are embedded in a Java stack trace and some Python exceptions may also contain an embedded Java exception.

This guide first describes the components of a Java exception. Next, it describes a Python trace back wrapped in a Java exception. Finally, it describes a Python traceback with an embedded Java exception, which is a common pattern when calling Deephaven query methods. Python users should read all three sections; Groovy/Java users can read only the first.

Java exception

In the following query, the table two_rows has more than one row for Key=1, therefore the engine cannot determine what value to use for the right-hand side of the natural join. So, the invalid query generates a stack trace:

twoRows = emptyTable(2).updateView("Key=1", "Value=2")
leftSide = emptyTable(1).updateView("Key=1").naturalJoin(two_rows, "Key")

The stack trace is reproduced below, with line numbers to aid in exposition. Java exceptions consist of four parts:

  1. A type, in this case java.lang.IllegalStateException (on line 1).
  2. A message, in this case, Natural Join found duplicate right key for 1 (on line 1). Not all exceptions have a message.
  3. A stack trace, which contains the file name, function name, and line number of each function call leading to the exception.
    • The stack trace begins on line 2 with the StaticHashedNaturalJoinStateManager.errorOnDuplicates method. Next come several methods within the natural join implementation.
    • Lines 15-21 are part of the Groovy language runtime.
    • Lines 22-32 are the Deephaven gRPC server invoking the runCode call.
    • The remainder of the stack trace is the web server machinery for the gRPC call ending on line 41 with the Thread.run method.
  4. Optionally, one or more causes or suppressed exceptions that each include another Exception and stack trace. No caused by or suppressed exception is included in this example.
 1	r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: java.lang.IllegalStateException: Natural Join found duplicate right key for 1
 2		at io.deephaven.engine.table.impl.naturaljoin.StaticHashedNaturalJoinStateManager.errorOnDuplicates(StaticHashedNaturalJoinStateManager.java:109)
 3		at io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase.errorOnDuplicatesSingle(StaticNaturalJoinStateManagerTypedBase.java:274)
 4		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoinInternal(NaturalJoinHelper.java:244)
 5		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoin(NaturalJoinHelper.java:39)
 6		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoin(NaturalJoinHelper.java:32)
 7		at io.deephaven.engine.table.impl.QueryTable.naturalJoinInternal(QueryTable.java:2221)
 8		at io.deephaven.engine.table.impl.QueryTable.lambda$naturalJoinImpl$56(QueryTable.java:2211)
 9		at io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder.withNugget(QueryPerformanceRecorder.java:302)
10		at io.deephaven.engine.table.impl.QueryTable.naturalJoinImpl(QueryTable.java:2209)
11		at io.deephaven.engine.table.impl.QueryTable.naturalJoin(QueryTable.java:2200)
12		at io.deephaven.engine.table.impl.QueryTable.naturalJoin(QueryTable.java:98)
13		at io.deephaven.api.TableOperationsDefaults.naturalJoin(TableOperationsDefaults.java:123)
14		at io.deephaven.api.TableOperationsDefaults$naturalJoin.call(Unknown Source)
15		at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
16		at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
17		at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
18		at io.deephaven.dynamic.Script_7.run(Script_7.groovy:3)
19		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:427)
20		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:461)
21		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:436)
22		at io.deephaven.engine.util.GroovyDeephavenSession.lambda$evaluate$0(GroovyDeephavenSession.java:352)
23		at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:51)
24		at io.deephaven.engine.util.GroovyDeephavenSession.evaluate(GroovyDeephavenSession.java:352)
25		at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$0(AbstractScriptSession.java:165)
26		at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:196)
27		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:207)
28		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:195)
29		at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:165)
30		at io.deephaven.enterprise.dnd.modules.GroovyConsoleSessionWithDatabaseModule$ScriptSessionWrapper.evaluateScript(GroovyConsoleSessionWithDatabaseModule.java:117)
31		at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:72)
32		at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:75)
33		at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$4(ConsoleServiceGrpcImpl.java:193)
34		at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
35		at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
36		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
37		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
38		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
39		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
40		at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
41		at java.base/java.lang.Thread.run(Thread.java:840)

The following invalid query demonstrates an exception with a cause. The row position value ii is a Java long 64-bit integer, but the Integer.toString only accepts an int 32-bit value.

evalError=emptyTable(1).update("X=Integer.toString(ii)")

The first three parts of the exception are still present:

  1. The exception type, io.deephaven.engine.table.impl.select.FormulaCompilationException, is on line 1.
  2. The exception message, Formula compilation error for: Integer.toString(ii), is also on line 1.
  3. Lines 2-46 contain the Exception's stack trace.

On line 47, we see the fourth optional component - the exception's cause, indicated by Caused by. In this case, the exception type is io.deephaven.engine.table.impl.lang.QueryLanguageParser$QueryLanguageParseException:. This exception has a very long message split over lines 48-52, but the relevant portion is Cannot find method toString(long) in class java.lang.Integer. The stack trace is on lines 53-62. Of note is that instead of duplicating the entire stack trace that was present in lines 2-46, the common method calls are elided with the text ... 44 more taking their place. This greatly reduces the size of nested stack traces, making them easier to read.

 1	r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: io.deephaven.engine.table.impl.select.FormulaCompilationException: Formula compilation error for: Integer.toString(ii)
 2		at io.deephaven.engine.table.impl.select.DhFormulaColumn.initDef(DhFormulaColumn.java:201)
 3		at io.deephaven.engine.table.impl.select.SwitchColumn.initDef(SwitchColumn.java:64)
 4		at io.deephaven.engine.table.impl.select.analyzers.SelectAndViewAnalyzer.createContext(SelectAndViewAnalyzer.java:128)
 5		at io.deephaven.engine.table.impl.QueryTable.lambda$selectOrUpdate$34(QueryTable.java:1527)
 6		at io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder.withNugget(QueryPerformanceRecorder.java:369)
 7		at io.deephaven.engine.table.impl.QueryTable.lambda$selectOrUpdate$35(QueryTable.java:1509)
 8		at io.deephaven.engine.table.impl.QueryTable.memoizeResult(QueryTable.java:3646)
 9		at io.deephaven.engine.table.impl.QueryTable.selectOrUpdate(QueryTable.java:1508)
10		at io.deephaven.engine.table.impl.QueryTable.update(QueryTable.java:1487)
11		at io.deephaven.engine.table.impl.QueryTable.update(QueryTable.java:98)
12		at io.deephaven.api.TableOperationsDefaults.update(TableOperationsDefaults.java:94)
13		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
15		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16		at java.base/java.lang.reflect.Method.invoke(Method.java:568)
17		at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:48)
18		at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:186)
19		at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:51)
20		at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
21		at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
22		at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
23		at io.deephaven.dynamic.Script_9.run(Script_9.groovy:2)
24		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:427)
25		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:461)
26		at groovy.lang.GroovyShell.evaluate(GroovyShell.java:436)
27		at io.deephaven.engine.util.GroovyDeephavenSession.lambda$evaluate$0(GroovyDeephavenSession.java:352)
28		at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:51)
29		at io.deephaven.engine.util.GroovyDeephavenSession.evaluate(GroovyDeephavenSession.java:352)
30		at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$0(AbstractScriptSession.java:165)
31		at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:196)
32		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:207)
33		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:195)
34		at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:165)
35		at io.deephaven.enterprise.dnd.modules.GroovyConsoleSessionWithDatabaseModule$ScriptSessionWrapper.evaluateScript(GroovyConsoleSessionWithDatabaseModule.java:117)
36		at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:72)
37		at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:75)
38		at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$4(ConsoleServiceGrpcImpl.java:193)
39		at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
40		at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
41		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
42		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
43		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
44		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
45		at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
46		at java.base/java.lang.Thread.run(Thread.java:840)
47	Caused by: io.deephaven.engine.table.impl.lang.QueryLanguageParser$QueryLanguageParseException:

48	Having trouble with the following expression:
49	Full expression           : Integer.toString(ii)
50	Expression having trouble :
51	Exception type            : io.deephaven.engine.table.impl.lang.QueryLanguageParser$ParserResolutionFailure
52	Exception message         : Cannot find method toString(long) in class java.lang.Integer

53		at io.deephaven.engine.table.impl.lang.QueryLanguageParser.getMethod(QueryLanguageParser.java:673)
54		at io.deephaven.engine.table.impl.lang.QueryLanguageParser.visit(QueryLanguageParser.java:2350)
55		at io.deephaven.engine.table.impl.lang.QueryLanguageParser.visit(QueryLanguageParser.java:133)
56		at com.github.javaparser.ast.expr.MethodCallExpr.accept(MethodCallExpr.java:116)
57		at io.deephaven.engine.table.impl.lang.QueryLanguageParser.<init>(QueryLanguageParser.java:319)
58		at io.deephaven.engine.table.impl.lang.QueryLanguageParser.<init>(QueryLanguageParser.java:212)
59		at io.deephaven.engine.table.impl.select.codegen.FormulaAnalyzer.parseFormula(FormulaAnalyzer.java:240)
60		at io.deephaven.engine.table.impl.select.codegen.FormulaAnalyzer.parseFormula(FormulaAnalyzer.java:122)
61		at io.deephaven.engine.table.impl.select.DhFormulaColumn.initDef(DhFormulaColumn.java:181)
62		... 44 more

Python traceback wrapped in a Java exception

In the following example, the Python urllib package retrieves robots.txt from an unknown host unknown-host and fails with a traceback.

import urllib3

resp = urllib3.request("GET", "http://unknown-host/robots.txt")
print(resp)

Because the Deephaven worker is a Java application, we start out with a Java exception. The components are:

  1. The type of the exception, java.lang.RuntimeException on line 1.
  2. The exception message begins with Error in Python interpreter: on line 1. It contains the full Python trace back from lines 2-17.
  3. The Java stack trace from lines 18-39.

The Python traceback is very much like a Java stack trace.

  • Line 2 tells us the type of the error, urllib3.exceptions.MaxRetryError.
  • On line 3, the message, HTTPConnectionPool(host='unknown-host', port=80): Max retries exceeded with url: /robots.txt (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f596aa04eb0>: Failed to resolve 'unknown-host' ([Errno -2] Name or service not known)")), tells us the cause of the error — that unknown-host could not be resolved.
  • Lines 4-6 are the actual file that raised the exception.
  • Lines 7-17 are the full traceback with the most recent calls last (as indicated on line 7).
  • Line 8 references <string> because when executing a statement from a Code Studio, it is not stored in a file.
 1	r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: java.lang.RuntimeException: Error in Python interpreter:
 2	Type: <class 'urllib3.exceptions.MaxRetryError'>
 3	Value: HTTPConnectionPool(host='unknown-host', port=80): Max retries exceeded with url: /robots.txt (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f596aa04eb0>: Failed to resolve 'unknown-host' ([Errno -2] Name or service not known)"))
 4	Line: 519
 5	Namespace: increment
 6	File: /usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/util/retry.py
 7	Traceback (most recent call last):
 8	  File "<string>", line 3, in <module>
 9	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/__init__.py", line 193, in request
10	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/_request_methods.py", line 135, in request
11	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/_request_methods.py", line 182, in request_encode_url
12	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/poolmanager.py", line 443, in urlopen
13	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/connectionpool.py", line 873, in urlopen
14	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/connectionpool.py", line 873, in urlopen
15	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/connectionpool.py", line 873, in urlopen
16	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
17	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment

18		at org.jpy.PyLib.executeCode(Native Method)
19		at org.jpy.PyObject.executeCode(PyObject.java:138)
20		at io.deephaven.engine.util.PythonEvaluatorJpy.evalScript(PythonEvaluatorJpy.java:73)
21		at io.deephaven.integrations.python.PythonDeephavenSession.lambda$evaluate$1(PythonDeephavenSession.java:205)
22		at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:51)
23		at io.deephaven.integrations.python.PythonDeephavenSession.evaluate(PythonDeephavenSession.java:205)
24		at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$0(AbstractScriptSession.java:165)
25		at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:196)
26		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:207)
27		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:195)
28		at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:165)
29		at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:72)
30		at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:75)
31		at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$4(ConsoleServiceGrpcImpl.java:193)
32		at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
33		at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
34		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
35		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
36		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
37		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
38		at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
39		at java.base/java.lang.Thread.run(Thread.java:840)

Java calling Python calling a query method

We return to the same example as we used to describe a Java Exception, but executed from a Python worker in the following invalid query. The table two_rows has more than one row for Key=1, therefore the engine cannot determine what value to use for the right-hand side of the natural join:

from deephaven import empty_table

two_rows = empty_table(2).update_view(["Key=1", "Value=2"])
left_side = empty_table(1).update_view("Key=1").natural_join(two_rows, "Key")

The stack trace is reproduced below, with line numbers to aid in exposition:

 1	r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: java.lang.RuntimeException: Error in Python interpreter:
 2	Type: <class 'deephaven.dherror.DHError'>
 3	Value: table natural_join operation failed. : RuntimeError: java.lang.IllegalStateException: Natural Join found duplicate right key for 1
 4	Traceback (most recent call last):
 5	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py", line 1387, in natural_join
 6	    j_table=self.j_table.naturalJoin(table.j_table, ",".join(on))
 7	RuntimeError: java.lang.IllegalStateException: Natural Join found duplicate right key for 1
 8		at io.deephaven.engine.table.impl.naturaljoin.StaticHashedNaturalJoinStateManager.errorOnDuplicates(StaticHashedNaturalJoinStateManager.java:109)
 9		at io.deephaven.engine.table.impl.naturaljoin.StaticNaturalJoinStateManagerTypedBase.errorOnDuplicatesSingle(StaticNaturalJoinStateManagerTypedBase.java:274)
10		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoinInternal(NaturalJoinHelper.java:244)
11		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoin(NaturalJoinHelper.java:39)
12		at io.deephaven.engine.table.impl.NaturalJoinHelper.naturalJoin(NaturalJoinHelper.java:32)
13		at io.deephaven.engine.table.impl.QueryTable.naturalJoinInternal(QueryTable.java:2221)
14		at io.deephaven.engine.table.impl.QueryTable.lambda$naturalJoinImpl$56(QueryTable.java:2211)
15		at io.deephaven.engine.table.impl.perf.QueryPerformanceRecorder.withNugget(QueryPerformanceRecorder.java:302)
16		at io.deephaven.engine.table.impl.QueryTable.naturalJoinImpl(QueryTable.java:2209)
17		at io.deephaven.engine.table.impl.QueryTable.naturalJoin(QueryTable.java:2200)
18		at io.deephaven.engine.table.impl.QueryTable.naturalJoin(QueryTable.java:98)
19		at io.deephaven.api.TableOperationsDefaults.naturalJoin(TableOperationsDefaults.java:123)
20		at org.jpy.PyLib.executeCode(Native Method)
21		at org.jpy.PyObject.executeCode(PyObject.java:138)
22		at io.deephaven.engine.util.PythonEvaluatorJpy.evalScript(PythonEvaluatorJpy.java:73)
23		at io.deephaven.integrations.python.PythonDeephavenSession.lambda$evaluate$1(PythonDeephavenSession.java:205)
24		at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:51)
25		at io.deephaven.integrations.python.PythonDeephavenSession.evaluate(PythonDeephavenSession.java:205)
26		at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$0(AbstractScriptSession.java:165)
27		at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:196)
28		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:207)
29		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:195)
30		at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:165)
31		at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:72)
32		at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:75)
33		at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$4(ConsoleServiceGrpcImpl.java:193)
34		at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
35		at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
36		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
37		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
38		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
39		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
40		at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
41		at java.base/java.lang.Thread.run(Thread.java:840)


42	Line: 1390
43	Namespace: natural_join
44	File: /usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py
45	Traceback (most recent call last):
46	  File "<string>", line 4, in <module>
47	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py", line 1390, in natural_join

48		at org.jpy.PyLib.executeCode(Native Method)
49		at org.jpy.PyObject.executeCode(PyObject.java:138)
50		at io.deephaven.engine.util.PythonEvaluatorJpy.evalScript(PythonEvaluatorJpy.java:73)
51		at io.deephaven.integrations.python.PythonDeephavenSession.lambda$evaluate$1(PythonDeephavenSession.java:205)
52		at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:51)
53		at io.deephaven.integrations.python.PythonDeephavenSession.evaluate(PythonDeephavenSession.java:205)
54		at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$0(AbstractScriptSession.java:165)
55		at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:196)
56		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:207)
57		at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:195)
58		at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:165)
59		at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:72)
60		at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:75)
61		at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$4(ConsoleServiceGrpcImpl.java:193)
62		at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
63		at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
64		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
65		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
66		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
67		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
68		at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
69		at java.base/java.lang.Thread.run(Thread.java:840)

Line 1 contains a Java RuntimeException with a message that an error has occurred in the Python interpreter. The Java exception message contains the full text of the Python traceback.

 1	r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: java.lang.RuntimeException: Error in Python interpreter:

The Python traceback begins on line 2 and concludes on line 47.

  • Line 2 indicates that the Python exception is of type DHError.
  • The message on line 3 is a copy of the Java Exception message.
  • Line 4 begins a traceback; the most recent calls are first followed by the callers.
  • Line 5 shows the file and line where the error occurred, and line 6 shows the actual Python code being executed.
  • Line Lines 7-41 contain the full text of a Java Exception, including the Java stack trace.
  • Lines 42-47 are the rest of the Python trace back.
 2	Type: <class 'deephaven.dherror.DHError'>
 3	Value: table natural_join operation failed. : RuntimeError: java.lang.IllegalStateException: Natural Join found duplicate right key for 1
 4	Traceback (most recent call last):
 5	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py", line 1387, in natural_join
 6	    j_table=self.j_table.naturalJoin(table.j_table, ",".join(on))
 7	RuntimeError: java.lang.IllegalStateException: Natural Join found duplicate right key for 1
...
42	Line: 1390
43	Namespace: natural_join
44	File: /usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py
45	Traceback (most recent call last):
46	  File "<string>", line 4, in <module>
47	  File "/usr/illumon/coreplus/venv/latest/lib/python3.10/site-packages/deephaven/table.py", line 1390, in natural_join

Lines 48-69 are the remainder of the original RuntimeException that began on line 1 and contain the stack trace of the methods used by the Deephaven server to facilitate a gRPC request to execute a String as Python code.