Riva Virtual Assisstant launch error

Hardware - GPU: DGX A100 Workstation
Hardware - CPU:
Operating System: Ubuntu 20.04
Riva Version: 1.8.0-beta

Hi. I’m trying to follow the instructions on the doc to run the sample application of virtual assistant.

I ran both riva_init.sh and riva_start.sh well and made the following containers up-running:

riva-speech:1.8.0-beta-server

and

riva-speech-client:1.8.0-beta-samples

Afterwards, I changed config.py in the container and browsed https://127.0.0.1:8009/rivaWeather/ on Firefox (version 91.0, 64 bit) as the doc instructions said, however, after submitting the first sentence on the UI, I got an error saying that there is an error during a service call.

Is there anyone who knows how to address this issue? I have no clues on what’s going wrong over here.
Here is the error I got:

root@93c0b2a882cb:/workspace/samples/virtual-assistant# python3 main.py
Server starting at : https://0.0.0.0:8009/rivaWeather
Note: Currently the streaming is working with Chrome and FireFox, Safari does not support navigator.mediaDevices.getUserMedia
[Riva Chatbot] Client connected
[stateDM] Initializing the state machine for uid: 1
[1] Starting chatbot ASR task
[1] ASR background task started
[Riva Chatbot] Chatbot created with user conversation index:[1]
[stateDM] Executing state: initialState
[Riva ASR] Creating Stream ASR channel: 172.0.0.1:50051
[1] Response from RivaDM: {‘context’: {}, ‘text’: ‘’, ‘uid’: 1, ‘payload’: {}, ‘response’: [{‘type’: ‘text’, ‘payload’: {‘text’: ‘Hi, welcome to Riva weather service. How may I help you?’}, ‘delay’: 0}]}
[Riva ASR] Starting Background ASR process
[Riva ASR] StreamingRecognize Start
[1] TTS Disabled
[1] audio speak: 1641896536160
[1] Pausing ASR requests.
[1] Attempt at Unpausing ASR requests on REQUEST_COMPLETE.
[1] ASR successfully unpaused for Request Complete
[stateDM] Executing state: userInput
[1] Pausing ASR requests.

[Riva NLU] Error during NLU request
[stateDM] No next state, waiting for user input
[1] Response from RivaDM: {‘context’: {}, ‘text’: ‘What is the weather today?’, ‘uid’: 1, ‘payload’: {}}
‘response’
Exception in thread Thread-6:
Traceback (most recent call last):
File “/usr/lib/python3.8/threading.py”, line 932, in _bootstrap_inner
self.run()
File “/usr/lib/python3.8/threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “/workspace/samples/virtual-assistant/riva/chatbot/chatbot.py”, line 33, in server_asr
self.asr.main_asr()
File “/workspace/samples/virtual-assistant/riva/asr/asr.py”, line 180, in main_asr
self.listen_print_loop(responses)
File “/workspace/samples/virtual-assistant/riva/asr/asr.py”, line 109, in listen_print_loop
for response in responses:
File “/usr/local/lib/python3.8/dist-packages/grpc/_channel.py”, line 392, in next
return self._next()
File “/usr/local/lib/python3.8/dist-packages/grpc/_channel.py”, line 561, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = “failed to connect to all addresses”
debug_error_string = “{“created”:”@1641896556.152911446",“description”:“Failed to pick subchannel”,“file”:“src/core/ext/filters/client_channel/client_channel.cc”,“file_line”:3934,“referenced_errors”:[{“created”:"@1641896556.152908601",“description”:“failed to connect to all addresses”,“file”:“src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc”,“file_line”:393,“grpc_status”:14}]}"

and here is the screenshot of the application UI

here is the screenshot of the config.py that I modified

I have also tried to use Jupiter Notebook to verify the Riva Service URL, but I still cannot figure out why the gRPC connection status_code is still UNAVAILABLE as the following log

Exception in thread Thread-42:
Traceback (most recent call last):
File “/usr/lib/python3.8/threading.py”, line 932, in _bootstrap_inner
self.run()
File “/usr/lib/python3.8/threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “/workspace/samples/virtual-assistant/riva/chatbot/chatbot.py”, line 33, in server_asr
self.asr.main_asr()
File “/workspace/samples/virtual-assistant/riva/asr/asr.py”, line 180, in main_asr
self.listen_print_loop(responses)
File “/workspace/samples/virtual-assistant/riva/asr/asr.py”, line 109, in listen_print_loop
for response in responses:
File “/usr/local/lib/python3.8/dist-packages/grpc/_channel.py”, line 392, in next
return self._next()
File “/usr/local/lib/python3.8/dist-packages/grpc/_channel.py”, line 561, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = “failed to connect to all addresses”
debug_error_string = “{“created”:”@1642304054.650031616",“description”:“Failed to pick subchannel”,“file”:“src/core/ext/filters/client_channel/client_channel.cc”,“file_line”:3934,“referenced_errors”:[{“created”:"@1642304054.650027228",“description”:“failed to connect to all addresses”,“file”:“src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc”,“file_line”:393,“grpc_status”:14}]}"

By the following command I can establish the gRPC connection and invoke Riva service successfully in Jupiter Notebook

channel = grpc.insecure_channel(‘localhost:50051’)

However, the virtual assistant doesn’t work when using the same URL in the config file

samples/virtual-assistant/config.py

client_config = {
    "CLIENT_APPLICATION": "WEBAPPLICATION", # Default and only config value for this version
    "PORT": 8009, # The port your flask app will be hosted at
    "DEBUG": True, # When this flag is set, the UI displays detailed Riva data
    "VERBOSE": True  # print logs/details for diagnostics
}

riva_config = {
    #"RIVA_SPEECH_API_URL": "10.110.42.153:50051", # Replace the IP & port with your hosted Riva endpoint
    #"RIVA_SPEECH_API_URL": "172.0.0.1:50051",
    "RIVA_SPEECH_API_URL": "localhost:50051",
    "ENABLE_QA": "QA unavailable in this VA version. Coming soon",
    "WEATHERSTACK_ACCESS_KEY": "xxx",  # Get your access key at - https://weatherstack.com/
    "VERBOSE": True  # print logs/details for diagnostics
}

asr_config = {
    "VERBOSE": True,
    "SAMPLING_RATE": 16000,
    "LANGUAGE_CODE": "en-US",  # a BCP-47 language tag
    "ENABLE_AUTOMATIC_PUNCTUATION": True,
}

nlp_config = {
    "RIVA_MISTY_PROFILE": "http://docs.google.com/document/d/17HJL7vrax6FiF1zW_Vzqk9FTfmATeq5i3UemtagM8RY/export?format=txt", # URL for the Riva meta info file.
    "RIVA_MARK_KB": "http://docs.google.com/document/d/1LeRphIBOo5UyyUcr45ewvg16sCVNqP_H3SdFTB74hck/export?format=txt", # URL for Mark's GPU History doc file.    
    "QA_API_ENDPOINT": "QA unavailable in this VA version. Coming soon", # Replace the IP port with your Question Answering API
}

tts_config = {
    "VERBOSE": False,
    "SAMPLE_RATE": 22050,
    "LANGUAGE_CODE": "en-US",  # a BCP-47 language tag
    "VOICE_NAME": "ljspeech",
}

Does anyone know what might be the potential root cause?

I figured it out by myself.

When launching container, all the files inside the container will be restore to the initial state.
It means that I have to update the config.py file every time after launching container service, otherwise, the context of config.py would restore to “10.110.42.153:50051” instead of “172.0.0.1:50051”, and that gives me a gRPC connection error with status code “Service Unavailable”.

So first, remember to update config.py after sample client container is launched.
second, remember to add --net=host while launching sample client container

Hi @ryan_lin , glad you found a solution. You can also look into mounting a local folder into the docker container using the -v flag to docker run to have your changes persist if you want to avoid editing the file everytime: Use volumes | Docker Documentation - this is common for generic docker container usage, not specific to RIVA or anything.

Thanks @NVES_R

It makes the process much easier since I have to modify multiple files for the customisation.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.