htappen / r-google-cloud-ai

A set of tutorials for how to use R with Google Cloud AI Platform
MIT License
1 stars 1 forks source link

RStudio Initialization Error #4

Open rajsinghgm opened 1 year ago

rajsinghgm commented 1 year ago

We have been using this Docker Image for a few years now and it has worked well for us We use it in GCP Vertex AI Notebook.

For the past week when tried to access Jupyter UI we started getting RStudio Initialization Error and Status Code 403 returned by RStudio Server when executing client init

Our base images is gcr.io/deeplearning-platform-release/r-cpu.4-2:latest It does not work for base image 4-1 as well. There are no logs that explain why this started happening.

We faced a similar error 18-24 months ago and you were able to fix it. I am hoping you have a suggestion for us.

Thanks

htappen commented 1 year ago

Will you be able to use 4.0 or before in the meantime? I may have time in the next couple of weeks to take a look.

rajsinghgm commented 1 year ago

Sure I will go back to using 4.0. Strange thing is that I was told that it was working for 4.1 and it stopped working. Perhaps I was misinformed. Is the problem related to changes from 4.0 to 4.1-2

Thank you so supporting us for the past few years.

rajsinghgm commented 1 year ago

I am still debugging this and I found this error in client_init

Missing the '_xsrf' cookie for a request

This may be why we are getting 403 when accessing Juptyer UI for open source Rstudio

htappen commented 1 year ago

Thanks for finding! Looks like they changed the way they do xsrf protocol in RStudio.

Was that error in Javascript or something else?

On Fri, Dec 16, 2022 at 8:39 AM rajsinghgm @.***> wrote:

I am still debugging this and I found this error in client_init

Missing the '_xsrf' cookie for a request

This may be why we are getting 403 when accessing Juptyer UI for open source Rstudio

— Reply to this email directly, view it on GitHub https://github.com/htappen/r-google-cloud-ai/issues/4#issuecomment-1355193363, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF7MVI4CJEVEFJEPG7AWL3WNSLKXANCNFSM6AAAAAAS7CXE2Y . You are receiving this because you commented.Message ID: @.***>

rajsinghgm commented 1 year ago

In javascript. rstudio-0.js:20026

   POST https://xxxxx-dot-us-central1.notebooks.googleusercontent.com/rpc/client_init 403
htappen commented 1 year ago

OK, I'll take a look. I'm guessing the problem is in this Lua script: https://github.com/htappen/r-google-cloud-ai/blob/main/Docker/add_cookies.lua

So, here's where this all comes from. The notebooks architecture is roughly your browser <-> GCP proxy <-> RStudio. GCP proxy normally swallows all cookies and headers, so my code stick another proxy in the middle to save them: your browser <-> GCP proxy <-> nginx proxy <-> RStudio. The nginx proxy blindly saves all cookies and sends them right back to the RStudio instance, along with special handling for X-CSRF-Token header. Looks like I might also need special handling for _xsrf.

Thanks, Henry

On Fri, Dec 16, 2022 at 9:33 AM rajsinghgm @.***> wrote:

In javascript. rstudio-0.js:20026

POST https://xxxxx-dot-us-central1.notebooks.googleusercontent.com/rpc/client_init 403

— Reply to this email directly, view it on GitHub https://github.com/htappen/r-google-cloud-ai/issues/4#issuecomment-1355277362, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF7MVO7AALLLVMU4D2HFP3WNSRU7ANCNFSM6AAAAAAS7CXE2Y . You are receiving this because you commented.Message ID: @.***>

rajsinghgm commented 1 year ago

I found a recent issue that may be somewhat related https://github.com/rstudio/rstudio/issues/12405