gRPC Python Client Error: grpc.framework.crust._control.Rendezvous object

672 views
Skip to first unread message

bhar...@gmail.com

unread,
Apr 22, 2016, 7:44:29 AM4/22/16
to grpc.io
Hi,

I have been able to build gRPC Async Client successfully with Python, Thanks a lot for the support. 

However I am getting error "<grpc.framework.crust._control.Rendezvous object at 0xb6fa1e6c>" while running Sync client using SubscribeRequest.

Please suggest if I am using wrong python code. Please let me know if you require some other information from my side.

Using below versions:
Protoc: 3.0.0
OS: Linux CentOS 6.4 32 bit
GRPC: 0.13.0

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ERROR:
Connecting to IP:10.11.12.156::10162

Subscribe: [path {
  element: "all"
}
]

subscriptionList: subscription {
  path {
    element: "all"
  }
}
prefix {
  element: "system/power"
}


OpenConfig_pb2.SubscribeRequest: subscribe {
  subscription {
    path {
      element: "all"
    }
  }
  prefix {
    element: "system/power"
  }
}

<grpc.framework.crust._control.Rendezvous object at 0xb6fa1e6c>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SOURCE CODE:
  channel = implementations.insecure_channel('10.11.12.156', 10162)
  stub = OpenConfig_pb2.beta_create_OpenConfig_stub(channel)

  try:
      prefix = OpenConfig_pb2.Path()
      prefix.element.append('system/power')

      subscribe = ""
      path_len = 1
      subscribe = [0 for x in range(path_len)]

      for loop in range(0,path_len):
          subscribe[loop] = OpenConfig_pb2.Subscription()
          subscribe[loop].path.element.append('all')

      subscriptionList = OpenConfig_pb2.SubscriptionList(prefix=prefix, subscription=subscribe)

      print "\nSubscribe: "+str(subscribe)
      print "\nsubscriptionList: "+str(subscriptionList)

      metadata = [('authorization', 'ROOT:ROOT']

      print "\nOpenConfig_pb2.SubscribeRequest: "+str(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList))

      response = stub.Subscribe(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList), _TIMEOUT_SECONDS, metadata=metadata)
   
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thanks a lot for the help.

bhar...@gmail.com

unread,
May 16, 2016, 5:40:37 AM5/16/16
to grpc.io, bhar...@gmail.com
Reminder...Please suggest if there is any workaround or suggestion.

Thanks 

Nathaniel Manista

unread,
May 16, 2016, 10:24:55 AM5/16/16
to Bhartendu Maheshwari, grpc.io
On Fri, Apr 22, 2016 at 4:44 AM, <bhar...@gmail.com> wrote:
I have been able to build gRPC Async Client successfully with Python, Thanks a lot for the support. 

However I am getting error "<grpc.framework.crust._control.Rendezvous object at 0xb6fa1e6c>" while running Sync client using SubscribeRequest.

Does the exception have a "code" method and a "details" method that you can call to learn more about why the RPC failed?
-Nathaniel

bhar...@gmail.com

unread,
May 17, 2016, 7:00:38 AM5/17/16
to grpc.io, bhar...@gmail.com
No "code" method or "detail" method or stack trace available, tried a couple of times.

<grpc.framework.crust._control.Rendezvous object at 0xb6f3ef0c> 

Nathaniel Manista

unread,
May 17, 2016, 11:31:51 AM5/17/16
to Bhartendu Maheshwari, grpc.io
On Tue, May 17, 2016 at 4:00 AM, <bhar...@gmail.com> wrote:
No "code" method or "detail" method or stack trace available, tried a couple of times.

Would you mind sharing the code you used to look for the methods?

<grpc.framework.crust._control.Rendezvous object at 0xb6f3ef0c>

Maybe I'm missing something, but I don't see any way for an instance of this class to lack a "code" method and a "details" method?
-Nathaniel

bhar...@gmail.com

unread,
May 18, 2016, 3:23:52 AM5/18/16
to grpc.io, bhar...@gmail.com
Hi,

Please find the code below (also available in my original request) which I used for sending Sync request. Request you to share if there are any sample Sync request/response example available in Python?

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SOURCE CODE:
  channel = implementations.insecure_channel('10.11.12.156', 10162)
  stub = OpenConfig_pb2.beta_create_OpenConfig_stub(channel)

  try:
      prefix = OpenConfig_pb2.Path()
      prefix.element.append('system/power')

      subscribe = ""
      path_len = 1
      subscribe = [0 for x in range(path_len)]

      for loop in range(0,path_len):
          subscribe[loop] = OpenConfig_pb2.Subscription()
          subscribe[loop].path.element.append('all')

      subscriptionList = OpenConfig_pb2.SubscriptionList(prefix=prefix, subscription=subscribe)

      print "\nSubscribe: "+str(subscribe)
      print "\nsubscriptionList: "+str(subscriptionList)

      metadata = [('authorization', 'ROOT:ROOT']

      print "\nOpenConfig_pb2.SubscribeRequest: "+str(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList))

      response = stub.Subscribe(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList), _TIMEOUT_SECONDS, metadata=metadata)
   
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thanks 

Nathaniel Manista

unread,
May 18, 2016, 9:34:23 AM5/18/16
to Bhartendu Maheshwari, grpc.io
On Wed, May 18, 2016 at 12:23 AM, <bhar...@gmail.com> wrote:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SOURCE CODE:
  channel = implementations.insecure_channel('10.11.12.156', 10162)
  stub = OpenConfig_pb2.beta_create_OpenConfig_stub(channel)

  try:
      prefix = OpenConfig_pb2.Path()
      prefix.element.append('system/power')

      subscribe = ""
      path_len = 1
      subscribe = [0 for x in range(path_len)]

      for loop in range(0,path_len):
          subscribe[loop] = OpenConfig_pb2.Subscription()
          subscribe[loop].path.element.append('all')

      subscriptionList = OpenConfig_pb2.SubscriptionList(prefix=prefix, subscription=subscribe)

      print "\nSubscribe: "+str(subscribe)
      print "\nsubscriptionList: "+str(subscriptionList)

      metadata = [('authorization', 'ROOT:ROOT']

      print "\nOpenConfig_pb2.SubscribeRequest: "+str(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList))

      response = stub.Subscribe(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList), _TIMEOUT_SECONDS, metadata=metadata)
   
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

This can't be all of it, right? Do you not have an "except" to match your "try"? Where's that?
-N

bhar...@gmail.com

unread,
May 18, 2016, 12:17:52 PM5/18/16
to grpc.io, bhar...@gmail.com
Hi,

My mistake, please find below the complete gRPC Sync code with try and catch statement. Request you to share if there are any sample Sync request/response example available for Python language?


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SOURCE CODE:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  channel = implementations.insecure_channel('10.11.12.156', 51111)
  stub = OpenConfig_pb2.beta_create_OpenConfig_stub(channel)

  try:
      prefix = OpenConfig_pb2.Path()
      prefix.element.append('system/power')

      subscribe = ""
      path_len = 1
      subscribe = [0 for x in range(path_len)]

      for loop in range(0,path_len):
          subscribe[loop] = OpenConfig_pb2.Subscription()
          subscribe[loop].path.element.append('all')

      subscriptionList = OpenConfig_pb2.SubscriptionList(prefix=prefix, subscription=subscribe)

      print "\nSubscribe: "+str(subscribe)
      print "\nsubscriptionList: "+str(subscriptionList)

      metadata = [('authorization', 'ROOT:ROOT']

      print "\nOpenConfig_pb2.SubscribeRequest: "+str(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList))

      response = stub.Subscribe(OpenConfig_pb2.SubscribeRequest(subscribe=subscriptionList), _TIMEOUT_SECONDS, metadata=metadata)
  except:
    print "Error response received from gRPC Server for Sync request or some exception"
    traceback.print_exc(file=sys.stdout)
    exit()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Nathaniel Manista

unread,
May 18, 2016, 2:14:53 PM5/18/16
to Bhartendu Maheshwari, grpc.io
On Wed, May 18, 2016 at 9:17 AM, <bhar...@gmail.com> wrote:
  except:
    print "Error response received from gRPC Server for Sync request or some exception"
    traceback.print_exc(file=sys.stdout)
    exit()

Here's where you can do more: instead of "except:" have "except Exception as e:" (or "except face.AbortionError as e:" if you want to be specific). Then inside the "except" block you can have statements that look at e.code and e.details and possibly take action based on what they see.
-N

bhar...@gmail.com

unread,
May 20, 2016, 7:47:11 AM5/20/16
to grpc.io, bhar...@gmail.com
In this case we aren't observing any exception, so output remains the same.

Please suggest if there any way in gRPC to know failure reasons?

Thanks  

Nathaniel Manista

unread,
May 22, 2016, 6:24:57 PM5/22/16
to Bhartendu Maheshwari, grpc.io
On Fri, Apr 22, 2016 at 4:44 AM, <bhar...@gmail.com> wrote:
However I am getting error "<grpc.framework.crust._control.Rendezvous object at 0xb6fa1e6c>" while running Sync client using SubscribeRequest.

It's not clear to me what you mean by "getting". Does your program print "<grpc.framework.crust._control.Rendezvous object at 0xb6fa1e6c>" the way it prints the Subscribe, subscriptionList, and OpenConfig_pb2.SubscribeRequest objects before invoking the RPC? If so, where's that print statement?

If what you mean is that the value returned by the stub.Subscribe call is itself an instance of grpc.framework.crust._control.Rendezvous, what that most strongly suggests to me is a cardinality problem: somewhere in your source (perhaps your .proto file - does it look anything like "rpc Read(SubscribeRequest) returns (stream <some message type, possibly 'SubscribeResponse'>)"?) you've told some part of the gRPC runtime that your Subscribe method is response-streaming, but the code you've included in this thread treats Subscribe as though it were a response-unary method. It just so happens that grpc.framework.crust._control.Rendezvous implements the iterator protocol and an instance of grpc.framework.crust._control.Rendezvous is returned to applications from response-streaming RPC method invocations. What happens if you change your code to

my_iterator = stub.Subscribe(<arguments>)
for value_emitted_from_iterator in my_iterator:
  print type(value_emitted_from_iterator)
  print dir(value_emitted_from_iterator)
  print value_emitted_from_iterator

?
-Nathaniel

bhar...@gmail.com

unread,
May 24, 2016, 6:42:04 AM5/24/16
to grpc.io, bhar...@gmail.com

You are right, "grpc.framework.crust._control.Rendezvous" returned by the stub.Subscribe call.

Yes, .proto file contains suggested entry - similar to "rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse)".

The below error/exception observed when executed suggested lines. Also tried "__iter__()" and "next()" functions, observing the similar exception.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Response received: <grpc.framework.crust._control.Rendezvous object at 0xb6ec03ec>
Traceback (most recent call last):
  File "grpc_client.py", line 554, in <module>
    gRPCSyncClient()
  File "grpc_client.py", line 304, in gRPCSyncClient
    for value_emitted_from_iterator in response:
  File "/home/Python27/lib/python2.7/site-packages/grpc/framework/crust/_control.py", line 412, in next
    raise self._termination.abortion_error
grpc.framework.interfaces.face.face.LocalError: LocalError(code=None, details="None")
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Request you to please share if there is any sample python code available for Sync function?

Thanks

Nathaniel Manista

unread,
Jun 26, 2016, 8:25:41 PM6/26/16
to Bhartendu Maheshwari, grpc.io
On Tue, May 24, 2016 at 3:42 AM, <bhar...@gmail.com> wrote:
You are right, "grpc.framework.crust._control.Rendezvous" returned by the stub.Subscribe call.

Yes, .proto file contains suggested entry - similar to "rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse)".

Okay, good.

The below error/exception observed when executed suggested lines. Also tried "__iter__()" and "next()" functions, observing the similar exception.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Response received: <grpc.framework.crust._control.Rendezvous object at 0xb6ec03ec>
Traceback (most recent call last):
  File "grpc_client.py", line 554, in <module>
    gRPCSyncClient()
  File "grpc_client.py", line 304, in gRPCSyncClient
    for value_emitted_from_iterator in response:
  File "/home/Python27/lib/python2.7/site-packages/grpc/framework/crust/_control.py", line 412, in next
    raise self._termination.abortion_error
grpc.framework.interfaces.face.face.LocalError: LocalError(code=None, details="None")
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

There are a few different things that could be happening here but what looks most likely to me is that you're not actually reaching across the network and connecting to the remote host to which you intend to connect.

Request you to please share if there is any sample python code available for Sync function?

-Nathaniel
Reply all
Reply to author
Forward
0 new messages