Chat with RTX startup error - cookie

Windows 11, successful install. Get an error “Invalid session. Reopen RTX Chat from desktop to continue chatting.” immediately after starting from the desktop icon.
I added some print statements in
C:\Users***\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py

The error occurs at about user_interface.py line 300

key, value = cookie.split(‘=’)

The value of the cookie is

“__utmz=96992031.1709243782.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)”

there are several equal signs in the value.

I believe this ends in the detection of an invalid session.

cookie __utmz=96992031.1709243782.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
invalid session too many values to unpack (expected 2)
Traceback (most recent call last):
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py”, line 602, in _validate_session_and_raise
self._validate_request(request)
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py”, line 302, in _validate_request
key, value = cookie.split(‘=’)
ValueError: too many values to unpack (expected 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\gradio\queueing.py”, line 495, in call_prediction
output = await route_utils.call_process_api(
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\gradio\route_utils.py”, line 232, in call_process_api
output = await app.get_blocks().process_api(
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\gradio\blocks.py”, line 1561, in process_api
result = await self.call_function(
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\gradio\blocks.py”, line 1179, in call_function
prediction = await anyio.to_thread.run_sync(
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\anyio\to_thread.py”, line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\anyio_backends_asyncio.py”, line 877, in run_sync_in_worker_thread
return await future
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\anyio_backends_asyncio.py”, line 807, in run
result = context.run(func, *args)
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\env_nvd_rag\lib\site-packages\gradio\utils.py”, line 678, in wrapper
response = f(*args, **kwargs)
File “C:\Users\mwjoh\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py”, line 605, in _validate_session_and_raise
raise gr.Error(‘Invalid session’)
gradio.exceptions.Error: ‘Invalid session’

Hi try this.

Locate the File: 
File Path: C:\Users\{Your user dir}\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\ui\user_interface.py

Find and Replace the Code

key, value = cookie.split(‘=’)

Replace with:

split_index = cookie.find(‘=’)
key, value = cookie[:split_index], cookie[split_index+1:]

Save and Restart:
    Make sure to maintain the correct indentation as Python is sensitive to it. Save your changes and restart the application.

ref: Chat with RTX Easy Guide: Running on LAN & Making It Pu

1 Like

Thanks. That worked