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

Invalid response: 401 Unauthorized Ser Connection Error #5961

Open
cg1008syf opened this issue Feb 7, 2019 · 5 comments
Open

Invalid response: 401 Unauthorized Ser Connection Error #5961

cg1008syf opened this issue Feb 7, 2019 · 5 comments
Milestone

Comments

@cg1008syf
Copy link

Hi,

We are running JupyterLab from within Anaconda Enterprise, and on the order of every hour, we are getting a server connectiion error. The error is resolved upon reloading the web page. We don't see this error in jupyter notebook, running in AE. We have looked at token settings (given the 'unauthorized' component of the error), and have expanded the token lifespan to be much longer than 1 hr. Furthermore, we are not asked to login ... just refreshing the web browser... Any feedback on what is happening to resolve this issue will be appreciated...

Thank you

image

@jasongrout
Copy link
Contributor

jasongrout commented Feb 11, 2019

Great question. It sounds like this might be a good question for Anaconda Enterprise support. I would suggest asking them.

@jasongrout jasongrout added this to the Reference milestone Feb 11, 2019
@cg1008syf
Copy link
Author

hi Jason,

Thank you reaching back. We have not been as successful in resolving this issue, even with AE support. Hence, my attempt to reach out to jupyterlab directly to see if this issue has been addressed before. I came across a post few months ago, which was closed due to not having more input from the poster (#4578).

Thank you

@jasongrout
Copy link
Contributor

I don't remember seeing or hearing about it, other than the issue you linked. I don't use AE either. But we'll leave this open to see if anyone else has experience to add.

@cg1008syf
Copy link
Author

wanted to provide more details...

function handleRequest(url, init, settings) {
    // Handle notebook server requests.
    if (url.indexOf(settings.baseUrl) !== 0) {
        throw new Error('Can only be used for notebook server requests');
    }
    // Use explicit cache buster when `no-store` is set since
    // not all browsers use it properly.
    var cache = init.cache || settings.init.cache;
    if (cache === 'no-store') {
        // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
        url += ((/\?/).test(url) ? '&' : '?') + (new Date()).getTime();
    }
    var request = new settings.Request(url, __assign({}, settings.init, init));
    // Handle authentication.
    var authenticated = false;
    if (settings.token) {
        authenticated = true;
        request.headers.append('Authorization', "token " + settings.token);
    }
    else if (typeof document !== 'undefined' && document.cookie) {
        var xsrfToken = getCookie('_xsrf');
        if (xsrfToken !== void 0) {
            authenticated = true;
            request.headers.append('X-XSRFToken', xsrfToken);
        }
    }
    // Set the content type if there is no given data and we are
    // using an authenticated connection.
    if (!request.bodyUsed && authenticated) {
        request.headers.set('Content-Type', 'application/json');
    }
    // Use `call` to avoid a `TypeError` in the browser.
    return settings.fetch.call(null, request).catch(function (e) {
        // Convert the TypeError into a more specific error.
        throw new ServerConnection.NetworkError(e);
    });
}

The above function is where the error points to...

image

@cg1008syf
Copy link
Author

came across this... very similar to what we are experiencing...

https://github.com/DataBiosphere/saturn-ui/issues/1116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants