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

deephaven_server.Server fails when handling bindTable gRPC calls #5848

Closed
jnumainville opened this issue Jul 25, 2024 · 0 comments · Fixed by #5850
Closed

deephaven_server.Server fails when handling bindTable gRPC calls #5848

jnumainville opened this issue Jul 25, 2024 · 0 comments · Fixed by #5850
Assignees
Labels
bug Something isn't working core Core development tasks python-client
Milestone

Comments

@jnumainville
Copy link
Contributor

jnumainville commented Jul 25, 2024

Description

Calling bind_table on pydeephaven session fails.

Steps to reproduce

  1. Start deephaven via python, either with

    $ deephaven server
    

    or by running python

    $ python
    > from deephaven_server import Server
    > Server().start()
    

    etc.

  2. From some gRPC client, attempt to bind a table to a scoped name

    from pydeephaven import Session
    
    session = Session(
        auth_type="io.deephaven.authentication.psk.PskAuthenticationHandler",
        auth_token="token",
    )
    
    table = session.time_table(period=1000000000).update(formulas=["Col1 = i % 2"])
    session.bind_table(name="my_table", table=table)
    

    Can also achieve this effect by using the web IDE's "upload CSV" functionality. Bidirectional plugins are also likely to trigger this, by sending an object from the client to the server.

Expected results

The table is bound without error

Actual results
The following errors (the first in the jupyter console, the second on the server)

---------------------------------------------------------------------------
_MultiThreadedRendezvous                  Traceback (most recent call last)
File ~/Documents/deephaven-ipywidgets/.venvexamples/lib/python3.8/site-packages/pydeephaven/_console_service.py:54, in ConsoleService.bind_table(self, table, variable_name)
     53 try:
---> 54     self.session.wrap_rpc(
     55         self._grpc_console_stub.BindTableToVariable,
     56         console_pb2.BindTableToVariableRequest(
     57             console_id=self.console_id,
     58             table_id=table.ticket,
     59             variable_name=variable_name))
     60 except Exception as e:

File ~/Documents/deephaven-ipywidgets/.venvexamples/lib/python3.8/site-packages/pydeephaven/session.py:264, in Session.wrap_rpc(self, stub_call, *args, **kwargs)
    263 # Now block until we get the result (or an exception)
--> 264 return future.result()

File ~/Documents/deephaven-ipywidgets/.venvexamples/lib/python3.8/site-packages/grpc/_channel.py:883, in _MultiThreadedRendezvous.result(self, timeout)
    882 else:
--> 883     raise self

_MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "Details Logged w/ID '1677cedf-6c33-48bd-8891-a40da151a3ac'"
	debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2024-07-25T14:21:44.4664-05:00", grpc_status:3, grpc_message:"Details Logged w/ID \'1677cedf-6c33-48bd-8891-a40da151a3ac\'"}"
>

The above exception was the direct cause of the following exception:

DHError                                   Traceback (most recent call last)
Cell In[6], line 9
      3 session = Session(
      4     auth_type="io.deephaven.authentication.psk.PskAuthenticationHandler",
      5     auth_token="token",
      6 )
      8 table = session.time_table(period=1000000000).update(formulas=["Col1 = i % 2"])
----> 9 session.bind_table(name="my_table", table=table)

File ~/Documents/deephaven-ipywidgets/.venvexamples/lib/python3.8/site-packages/pydeephaven/session.py:573, in Session.bind_table(self, name, table)
    563 def bind_table(self, name: str, table: Table) -> None:
    564     """Binds a table to the given name on the server so that it can be referenced by that name.
    565 
    566     Args:
   (...)
    571         DHError
    572     """
--> 573     self.console_service.bind_table(table=table, variable_name=name)

File ~/Documents/deephaven-ipywidgets/.venvexamples/lib/python3.8/site-packages/pydeephaven/_console_service.py:61, in ConsoleService.bind_table(self, table, variable_name)
     54     self.session.wrap_rpc(
     55         self._grpc_console_stub.BindTableToVariable,
     56         console_pb2.BindTableToVariableRequest(
     57             console_id=self.console_id,
     58             table_id=table.ticket,
     59             variable_name=variable_name))
     60 except Exception as e:
---> 61     raise DHError("failed to bind a table to a variable on the server.") from e

DHError: failed to bind a table to a variable on the server.
ERROR r-Scheduler-Serial-1 | i.d.s.s.SessionService    | Internal Error '1677cedf-6c33-48bd-8891-a40da151a3ac' java.lang.RuntimeException: Error in Python interpreter:
Type: <class 'ValueError'>
Value: Java class 'io.deephaven.json.Value' not found
Line: 98
Namespace: <module>
File: /Users/josephnumainville/Documents/deephaven-plugins/.venv/lib/python3.8/site-packages/deephaven/json/__init__.py
Traceback (most recent call last):
  File "/Users/josephnumainville/Documents/deephaven-plugins/.venv/lib/python3.8/site-packages/deephaven/_wrapper.py", line 191, in wrap_j_object
  File "/Users/josephnumainville/Documents/deephaven-plugins/.venv/lib/python3.8/site-packages/deephaven/_wrapper.py", line 115, in _lookup_wrapped_class
  File "/Users/josephnumainville/Documents/deephaven-plugins/.venv/lib/python3.8/site-packages/deephaven/_wrapper.py", line 37, in _recursive_import
  File "/opt/homebrew/Cellar/python@3.8/3.8.16/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pkgutil.py", line 92, in walk_packages
  File "/Users/josephnumainville/Documents/deephaven-plugins/.venv/lib/python3.8/site-packages/deephaven/json/__init__.py", line 98, in <module>

	at org.jpy.PyLib.callAndReturnObject(Native Method)
	at org.jpy.PyObject.call(PyObject.java:449)
	at io.deephaven.integrations.python.PythonObjectWrapper.wrap(PythonObjectWrapper.java:41)
	at io.deephaven.integrations.python.PythonDeephavenSession.lambda$setVariable$2(PythonDeephavenSession.java:286)
	at org.jpy.PyLib.ensureGil(Native Method)
	at io.deephaven.integrations.python.PythonDeephavenSession.setVariable(PythonDeephavenSession.java:272)
	at io.deephaven.engine.util.AbstractScriptSession$ScriptSessionQueryScope.putParam(AbstractScriptSession.java:366)
	at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$bindTableToVariable$5(ConsoleServiceGrpcImpl.java:294)
	at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1537)
	at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:995)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at io.deephaven.server.runner.scheduler.SchedulerModule$ThreadFactory.lambda$newThread$0(SchedulerModule.java:100)
	at java.base/java.lang.Thread.run(Thread.java:1589)

Versions
Engine Version: 0.35.2
Web UI Version: 0.85.3
Java Version: 19.0.1
Barrage Version: 0.6.0
Browser Name: Chrome 126
OS Name: macOS 10.15.7
@deephaven/js-plugin-ui: 0.18.0
@deephaven/js-plugin-plotly-express: 0.11.1
@deephaven/js-plugin-matplotlib: 0.4.1

@jnumainville jnumainville added bug Something isn't working triage labels Jul 25, 2024
@rcaudy rcaudy added this to the 0.36.0 milestone Jul 26, 2024
@rcaudy rcaudy added core Core development tasks python-client and removed triage labels Jul 26, 2024
@niloc132 niloc132 changed the title Calling bind_table on pydeephaven session fails deephaven_server.Server fails when handling bindTable gRPC calls Jul 26, 2024
niloc132 added a commit to niloc132/deephaven-core that referenced this issue Jul 26, 2024
devinrsmith pushed a commit to devinrsmith/deephaven-core that referenced this issue Aug 7, 2024
devinrsmith added a commit that referenced this issue Aug 7, 2024
Fixes #5848
Cherry-pick of #5850

Co-authored-by: Colin Alworth <colinalworth@deephaven.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Core development tasks python-client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants