-
Notifications
You must be signed in to change notification settings - Fork 5k
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
How to solve “forbidden” error in jupyter notebook (conda tab) #2396
Comments
Are you seeing any notebook server errors in the terminal? What version of the notebook and nb-conda are you running? Here's a similar issue on nb-conda: anaconda/nb_conda#44 |
Since updating my packages in anaconda (conda update --all) and installing doxygen, I have the same issue. Jupyter will throw the error |
Got the same error. Solved it by opening jupyter in another browser (was using firefox, then used chrome). I think its a "cache" related issue. Maybe someone can explore this futher? |
@faizankshaikh hi, I came to this page because I was having problems saving a notbook while using Firefox. If I use Chrome I don't have any problem, while if I use Firefox I keep getting the "Forbidden" error when I try to save a notebook. I've also tried to disable any extension but it didn't help. |
#3365 may be related. |
Clearing the secure cookie makes sense when it is invalid or expired, but clearing it when it's not sent with a request can unexpectedly log the user out. I ran into this with misconstructed URLs which didn't incorporate base_url. That was itself a bug, but the result of suddenly being unauthenticated makes it harder to track down. Closes jupytergh-3365 (hopefully) Possibly also relevant to jupytergh-2396 I'm not sure why this seems to affect Firefox more than Chrome.
Hello, thanks for this! How can we access the patch? I have anaconda and I have tried updating jupyter (conda update jupyter), but it didn't work (still 403 GET). |
It will need to be merged and released before you can get it through Anaconda. For a small change like this, it's probably easiest to look at what I've changed, find the matching lines in your installation, and apply the change manually. Otherwise, you could use git to get it:
The last step needs some Javascript tools (see setting up a development environment). |
Hammering F5 (refresh) seems to be a quickfix for this issue. |
I was having the same 403 status code. The solution was using Jupyter Notebook with Chrome instead of Firefox. I used to blame SELinux configuration. Here are my details: OS:
Firefox
Python
Anaconda
Packages in virtualenv (created with anaconda):
|
@israelzuniga In Firefox, did you try either running Refresh (Ctrl + R or F5) many times after each other, or emptying cache? |
Also check that you haven't disabled cookies - that breaks Jupyter's authentication. But you'll probably know if you've done that. There's still the fix from #3380 to be released. I'll try to aim for a new release soon. |
@thomasaarholt Yesterday, after getting things done in Chrome, I tried that with good results (emptying cache, and also reinstalling FF). What didn't work so well, was running refresh (a lot of times) from FF without cache deletion. Other times, in my macbook for personal use, I have been using Jupyter/IPython and FF without any issues for years. So, now this is a truly interesting situation. @takluyver Sure. Even I disabled privacy plugins to discard interferences but was related to FF cache and Jupyer session handling. It works better today. |
Clearing the cache fixed it for me in Chrome: |
Thanks for the feedback, @israelzuniga. I oddly didn't see your comment before now. |
I concur. Firefox is a root cause. I opened with Opera and it is working fine |
I have this same error, but it's occurring in chrome. Clearing the cache does not help in my case. New file creation:
Existing file save after edit Error:
|
I've fixed using "sudo jupyter notebook": it requests the password and don't initialise as it does not understand the command, but reinstate the cache access (as it lost privileges for some reason). All works fine after that. (tensorflow) VirtualBox: |
Had this problem today on Chrome. Clearing cache and cookies and then repasting in url with token fixed it. |
Yes, it works for me after enabling cookies on Safari. |
I also experienced this problem. Like many above, I temporarily opened the notebook in chrome, saved it (in chrome), then closed both the chrome + firefox notebooks before restarting the notebook in Firefox w/o issue. Unsaved code cells within the broken Firefox session were in the chrome notebook so I am assuming that Chrome was able to read the cache contents while Firefox was not, however, since I'm not a jupyter dev take my jump to conclusion here with a grain of salt. |
I use chrome always, and I get this occassionally. Go your home url (open another tab if necessary) and refresh that page. It will as ask for the authentication token, which can be found in the terminal where the notebook server was started. Once you are logged in (again), go back to your notebook tab and select the "kernel>reconnect" menu item. |
It worked for me when i changed the browser. :) |
Thanks all for sharing your solutions! 🙏 |
Just try clicking the Jupyter icon in the page. |
Your AWS session might have been expired. Just re-login. |
Somehow, I have to re-log in the jupyter session every few days to get over this error. |
For get rid of from that error, You have to enable cookies on your browser. Then it will work |
I also get this nasty error in chrome all of a sudden (it has been working for months now). If I use Edge, the problem is gone. Has anybody figured what it could be? I tried refreshing, deleting cache, cookies, reentered the token, ... But still all requests error out with 403, except for the
Edit: I just realized using the local IP |
Please enable cookies on your browser to prevent this from happening again
…On Thu, 12 Dec 2019 at 19:53, Alexander Guth ***@***.***> wrote:
I also get this nasty error in chrome all of a sudden (it has been working
for months now). If I use Edge, the problem is gone. Has anybody figured
what it could be? I tried refreshing, deleting cache, cookies, reentered
the token, ...
But still all requests error out with 403, except for the /login page:
[W 15:19:50.801 NotebookApp] 403 GET /api/sessions?_=1576160390722 (::1) 1.99ms referer=http://localhost:8888/tree
[W 15:19:50.802 NotebookApp] Forbidden
[W 15:19:50.802 NotebookApp] 403 GET /api/terminals?_=1576160390723 (::1) 1.99ms referer=http://localhost:8888/tree
[W 15:20:04.664 NotebookApp] Forbidden
[W 15:20:04.670 NotebookApp] 403 GET /api/sessions?_=1576160390724 (::1) 6.98ms referer=http://localhost:8888/tree
[W 15:20:04.675 NotebookApp] Forbidden
[W 15:20:04.676 NotebookApp] 403 GET /api/terminals?_=1576160390725 (::1) 2.00ms referer=http://localhost:8888/tree
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2396?email_source=notifications&email_token=AKXIPX3HYMGUI2COMJL7P3DQYJCPDA5CNFSM4DHHCF32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGW2C2Y#issuecomment-565027179>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKXIPX7IP23XXRITTAFHLVDQYJCPDANCNFSM4DHHCF3Q>
.
|
I did not disable cookies, and the page indeed does set the cookies. As I said, it does work on |
I don't the exact cause but many times just clicking trust on the menu
removes the error. I also see it happening when underlying server is gone
or connection is broken.
…On Fri, Dec 13, 2019 at 5:21 AM Alexander Guth ***@***.***> wrote:
I did not disable cookies, and the page indeed does set the cookies. As I
said, it does work on 127.0.0.1 in teh exact same browser. In fact, I
openend two tabs and in one it works, in the other (localhost) it doesnt.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2396?email_source=notifications&email_token=AAJ74IWERSFB7PK4QBTOYG3QYNOZXA5CNFSM4DHHCF32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGZRYEA#issuecomment-565386256>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ74ITAF4RUOOZMYKHTP23QYNOZXANCNFSM4DHHCF3Q>
.
|
In case it helps anyone, this error can happen if trying to create notebook in folder owned by another user (such as root). Fix with |
It work for me :-) |
Clearing cookies from localhost resolved this for me, in Chrome 79 (Linux). |
Clear your cache then right click on and duplicate your browser tab containing the notebook. It will ask you for the Jupyter password again. Once you enter it successfully just go back to the original window and try saving, everything should work. |
Exactly.. |
Probable reason: Solution: Problems with other solutions: |
I got the same problem today, this works for me.👍 |
Getting the same problem in MS Visual Studio Code. |
I had the same issue on the MS Visual Studio Code, c.NotebookApp.token = '' Also when you run a notebook, the server creates a tmp notebook in the directory jupyter server started, I did not have write access to that folder, that was the second issue. |
Is the issue solved in newer versions or is it still there? |
It's still there as of today. Setting:
in derived from @EnisBerk's #2396 (comment) |
I met this problem and I was unable to save the change. Just log in again from another tab, and return to the old one. The old one can save the change now. Thank @rsemenoff . |
Similar way. I Solved it by refreshing and re-enter my password. |
I solved the problem by uninstalling Jupyter Notebook in the environment where I had the issue, from Anaconda console and then installing it again. |
The following answer is only for those who work with a login. Taking up another answer:
This, together with the answer just two cells before that at #2396 (comment) say that you just have to "re-log", that is also why you can enter the login page but no other page. If you work with a login, you need to refresh that login after a few days or weeks. I guess this has nothing to do with the browser, but with the server that you work on.
This answer on Stack Overflow at Cannot connect to Jupyter Notebook also says that it could be a pip installation that leads to this:
No matter whether it is a server timeout or triggered by some installation, there is an easy fix for this, at least if you were just logged out:
I found this out by following the remarks here to press |
I installed anaconda and succeeded in making the conda-tab work thanks to the last suggestion in this entry: http://stackoverflow.com/a/41825208/6375668
However, when I try to create an environment or install an additional package I receive a "forbidden" error (see below). When I open anaconda-navigator I am perfectly able to create environments and install packages. In addition, I changed permissions to the anaconda-folders on my Mac and tried starting jupyter with sudo, but that didn't help.
What could be wrong? And how to fix this? Thanks!
The text was updated successfully, but these errors were encountered: