Resolution
DataSpell does not currently provide a dedicated "Refresh Token" button for stored remote Jupyter connections. To force a credential refresh without deleting the entire connection profile, you must manually update the token string in the server configuration settings.
How to Force a Credential Refresh
- Navigate to Settings → Languages & Frameworks → Jupyter.
- Select the problematic remote server from the list.
- Replace the existing token in the Token field with the current valid token from your remote server.
- Click OK or Apply to commit the change and trigger a new handshake.
Technical Explanation
Detection of Token Expiration vs. Network Timeouts
DataSpell distinguishes between these states based on the HTTP response codes returned by the Jupyter REST API:
- Token Expiration: The IDE expects a
401 Unauthorized or 403 Forbidden response. When these are received, the IDE is designed to trigger a re-authentication prompt.
- Network Timeout: A failure to establish a TCP connection, a
502 Bad Gateway, or a 504 Gateway Timeout is interpreted as a network-level failure, resulting in a generic connection error.
Why the Refresh Prompt May Fail
If you are seeing a generic error instead of a token prompt, it is likely that the 401/403 signal is being intercepted or masked. Common causes include:
- Reverse Proxies: NGINX or Apache may be configured to return a custom HTML error page for unauthorized requests, which the IDE cannot parse as an authentication trigger.
- SSH Tunneling: If the tunnel collapses, the IDE perceives a socket hang-up rather than an application-level authentication failure.
- Server-Side Rotation: Some Jupyter configurations rotate tokens silently; if the server does not explicitly return the expected HTTP error code, the IDE continues attempting to use the stored string until the connection is manually reset.
Verification Steps
To determine if the issue is token-based or network-based, perform the following checks:
- Check IDE Logs: Review the DataSpell Event Log for specific HTTP 401/403 errors.
- Browser Test: Paste the remote Jupyter URL into a web browser. If the browser prompts for a token or password immediately, the token has expired.
Diagnostic Detail Needed: Are you accessing the remote server via a reverse proxy (e.g., NGINX) or a direct SSH tunnel? This determines whether the authentication signal is being masked before it reaches the IDE.