voila icon indicating copy to clipboard operation
voila copied to clipboard

403 Forbidden with jupyter but not voila directly (on remote server)

Open artemisart opened this issue 4 years ago • 13 comments

Hello, I'm running voila on a remote server (aws ec2). When I use voila --no-browser it logs [Voila] Voila is running at: http://localhost:8866/ but I have not problem accessing it with serverip:8866 (it's not restricted to localhost apparently). However when I use it from jupyter serverip:8888/voila I get a 403 with these logs from jupyter (same with the 'Render with Voila' button inside jupyter lab interface):

[W 09:05:18.845 LabApp] Blocking request with non-local 'Host' serverip (serverip:8888). If the server should be accessible at that name, set ServerApp.allow_remote_access to disable the check.
[W 09:05:18.847 LabApp] 403 GET /voila (195.154.101.134) 2.29ms referer=None

I did change ~/.jupyter/jupyter_notebook_config.py to have

c.NotebookApp.ip = '*'
c.NotebookApp.allow_origin = '*'

and ~/.jupyter/jupyter_server_config.py:

c.ServerApp.allow_origin = '*'
c.ServerApp.allow_remote_access = True

But it still get the exact same errors and logs, any idea how to solve this?

Environment details:

> jupyter labextension list
JupyterLab v1.2.6
Known labextensions:
   app dir: /home/ubuntu/anaconda3/share/jupyter/lab
        @jupyter-voila/jupyterlab-preview v0.1.3  enabled  OK
> jupyter serverextension list
config dir: /home/ubuntu/anaconda3/etc/jupyter
    ipyparallel.nbextension  enabled
    - Validating...
      ipyparallel.nbextension  OK
    jupyterlab  enabled
    - Validating...
      jupyterlab 1.2.6 OK
    jupyterlab_git  enabled
    - Validating...
      jupyterlab_git  OK
    nbdime  enabled
    - Validating...
      nbdime 1.1.0 OK
    voila.server_extension  enabled
    - Validating...
      voila.server_extension  OK
    nb_conda  enabled
    - Validating...
      nb_conda 2.2.1 OK
    voila  enabled
    - Validating...
      voila 0.1.21 OK
> conda list jupyter
# packages in environment at /home/ubuntu/anaconda3:
#
# Name                    Version                   Build  Channel
hdijupyterutils           0.12.9                   pypi_0    pypi
jupyter                   1.0.0                    py36_4
jupyter-client            6.1.3                    pypi_0    pypi
jupyter-console           6.1.0                    pypi_0    pypi
jupyter-core              4.6.3                    pypi_0    pypi
jupyter-server            0.1.1                    pypi_0    pypi
jupyterlab                1.2.6              pyhf63ae98_0
jupyterlab-git            0.9.0                    pypi_0    pypi
jupyterlab-pygments       0.1.0                    pypi_0    pypi
jupyterlab_launcher       0.10.5                   py36_0
jupyterlab_server         1.0.0                      py_0
> conda list voila
# packages in environment at /home/ubuntu/anaconda3:
#
# Name                    Version                   Build  Channel
voila                     0.1.21                   pypi_0    pypi

Thanks!

artemisart avatar Jun 04 '20 09:06 artemisart

@artemisart are you able to access the Jupyter Notebook interface?

Otherwise it might because the token is not passed as a parameter in the URL?

jtpio avatar Jun 10 '20 11:06 jtpio

@jtpio Yes I have no problem accessing the notebook and lab interface (we have setup a password and I'm already authenticated).

artemisart avatar Jun 10 '20 11:06 artemisart

I am also having this issue. I can not get voila to render inside a JupyterHub dockerspawned single user notebook server. I get 403: Forbidden.

18:43 $ jupyter serverextension list
config dir: /opt/conda/etc/jupyter
    jupyterlab  enabled 
    - Validating...
      jupyterlab 1.2.10 OK
    jupyterlab_git  enabled 
    - Validating...
      jupyterlab_git 0.10.0 OK
    nbdime  enabled 
    - Validating...
      nbdime 2.0.0 OK
    voila.server_extension  enabled 
    - Validating...
      voila.server_extension  OK
    nbpresent disabled
    - Validating...
      nbpresent 3.0.2 OK
    nb_conda disabled
    - Validating...
      nb_conda 2.2.1 OK
    jupyter_http_over_ws  enabled 
    - Validating...
      jupyter_http_over_ws 0.0.7 OK
    jupyter_aihub_deploy_extension  enabled 
    - Validating...
      jupyter_aihub_deploy_extension  OK
    voila  enabled 
    - Validating...
      voila 0.1.21 OK
config dir: /usr/local/etc/jupyter
    jupyter_nbextensions_configurator  enabled 
    - Validating...
      jupyter_nbextensions_configurator 0.4.1 OK

marketneutral avatar Jul 07 '20 18:07 marketneutral

Hi, perhaps also related to this 403 error this error I get when visualizing pdfs in notebooks (working well) but not in voila_ https://stackoverflow.com/questions/62952128/ipywidgets-output-not-showing-pdf-when-using-voila

joseberlines avatar Jul 17 '20 10:07 joseberlines

When I use voila --no-browser it logs [Voila] Voila is running at: http://localhost:8866/

You run voila standalone, and it runs at port 8866

serverip:8888/voila

Here you connect to jupyterlab, they are separate servers/processes. Connect to serverip:8866 instead.

I also think you need to add the VoilaApp.ip=0.0.0.0 argument to voila, otherwise you cannot access it.

maartenbreddels avatar Aug 31 '20 09:08 maartenbreddels

Facing the same problem anybody has a solution to this

ytomar avatar Sep 06 '21 12:09 ytomar

Please use jupyter notebook --ip 127.0.0.1

engineerali2009 avatar Nov 10 '21 19:11 engineerali2009

Please use jupyter notebook --ip 127.0.0.1

this doesn't work

kasrakazemi avatar Jan 24 '22 17:01 kasrakazemi

Any fix here?

jasonoberme avatar May 04 '22 20:05 jasonoberme

Any fix here?

fix for which issue? https://github.com/voila-dashboards/voila/issues/1074 ?

kasrakazemi avatar May 06 '22 06:05 kasrakazemi

Any fix here?

fix for which issue? #1074 ?

Sorry about the lack of clarity! My specific issue is remote access to voila gives a 403 forbidden but works on localhost.

I also tried --ip 127.0.0.1 but it similarly did not solve my problem.

jasonoberme avatar May 06 '22 15:05 jasonoberme

try one of these:

1- run voila with config such as : voila --port=$PORT --no-browser --enable_nbextensions=True --VoilaConfiguration.file_whitelist="['.*\.(png|jpg|gif|svg|pdf|mp4|avi|ogg)']" something.ipynb 2- use latest voila and jupyter notebook(lab) versions

kasrakazemi avatar May 09 '22 05:05 kasrakazemi

I second solution #2. Worked for me.

Regards, Yogesh Tomar

On Mon, May 9, 2022 at 11:22 AM kasrakazemi @.***> wrote:

try one of these:

1- run voila with config such as : voila --port=$PORT --no-browser --enable_nbextensions=True --VoilaConfiguration.file_whitelist="['.*.(png|jpg|gif|svg|pdf|mp4|avi|ogg)']" something.ipynb 2- use latest voila and jupyter notebook(lab) versions

— Reply to this email directly, view it on GitHub https://github.com/voila-dashboards/voila/issues/625#issuecomment-1120671678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQFJDGIKW2DIUYSFKYUIBLVJCRYPANCNFSM4NSN2LVA . You are receiving this because you commented.Message ID: @.***>

ytomar avatar May 09 '22 05:05 ytomar