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

Kernels don't get the query string if --Voila.base_url is specified and preheating is turned on #1140

Closed
vkaidalov-rft opened this issue Apr 8, 2022 · 0 comments · Fixed by #1141
Labels
bug Something isn't working

Comments

@vkaidalov-rft
Copy link

Description

Hi!
When I was updating Voila from 0.3.1 to 0.3.5 on my machine, I saw that the preheated kernels produced some warning messages even before leaving the kernels pool. After taking a look at the recent changes, I found out that specifying the VOILA_WS_BASE_URL env. variable was now required to use the --Voila.base_url parameter.

Reproduce

  1. Create a get_qs_example.ipynb file with the following code:
from voila.utils import get_query_string
print(get_query_string())
  1. Run the Voila server as follows:
voila get_qs_example.ipynb --preheat_kernel=True --pool_size=5 --no-browser --Voila.base_url='/example-base-url/'
  1. See the following warnings in the Voila logs:
[Voila] Using /var/folders/44/nmhwstjd0cvg9yzpq0463l600000gn/T to store connection files
[Voila] Storing connection files in /var/folders/44/nmhwstjd0cvg9yzpq0463l600000gn/T/voila_54cdmtsg.
[Voila] Serving static files from /Users/vadym_kaidalov/opt/miniconda3/envs/playground/lib/python3.10/site-packages/voila/static.
[Voila] Voilà is running at:
http://localhost:8866/example-base-url/
[Voila] WARNING | Notebook get_qs_example.ipynb is not trusted
[Voila] WARNING | Notebook get_qs_example.ipynb is not trusted
[Voila] WARNING | Notebook get_qs_example.ipynb is not trusted
[Voila] WARNING | Notebook get_qs_example.ipynb is not trusted
[Voila] WARNING | Notebook get_qs_example.ipynb is not trusted
[Voila] Kernel started: 5a1dc72b-acac-4fe1-961b-b0d023c5c588
[Voila] Kernel started: fe5a586b-c425-4397-a5a7-240e21865d74
[Voila] Kernel started: 7801ca4b-214c-49b5-bf40-774ae1c0c457
[Voila] Kernel started: 04a9568f-b42c-46e0-a242-7addefb6a067
[Voila] Kernel started: e22cdcc1-547e-4e52-9ca7-b8de8d199d45
[Voila] Kernel pool of get_qs_example.ipynb is filled with 5 kernel(s)
WARNING:tornado.access:404 GET /voila/query/04a9568f-b42c-46e0-a242-7addefb6a067 (127.0.0.1) 1.77ms
WARNING:tornado.access:404 GET /voila/query/fe5a586b-c425-4397-a5a7-240e21865d74 (127.0.0.1) 0.41ms
WARNING:tornado.access:404 GET /voila/query/7801ca4b-214c-49b5-bf40-774ae1c0c457 (127.0.0.1) 0.39ms
WARNING:tornado.access:404 GET /voila/query/e22cdcc1-547e-4e52-9ca7-b8de8d199d45 (127.0.0.1) 2.39ms
WARNING:tornado.access:404 GET /voila/query/5a1dc72b-acac-4fe1-961b-b0d023c5c588 (127.0.0.1) 1.62ms

According to the source code, the VoilaHandler ignores the WebSocket connection error and goes on with an empty query string value.
4. Go to http://localhost:8866/example-base-url/?foo1=bar1&foo2=bar2 in the browser and see None instead of the expected foo1=bar1&foo2=bar2 value.

Expected behavior

I managed to modify my bash script to make app work correctly by providing the VOILA_WS_BASE_URL env. var. as follows:

voila get_qs_example.ipynb --preheat_kernel=True --pool_size=5 --no-browser --Voila.base_url='/example-base-url/' --VoilaKernelManager.kernel_pools_config="{'get_qs_example.ipynb': {'pool_size': 5, 'kernel_env_variables': {'VOILA_WS_BASE_URL': '/example-base-url/'}}}"

However, it's still a breaking change as I had to modify my bash script and I would expect Voila to use the value of --Voila.base_url parameter if the VOILA_WS_BASE_URL variable hasn't been specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant