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

503 Service Unavailable when initializing JupyterCodeExecutor in execution.py #7

Open
zhaochen0110 opened this issue Nov 8, 2024 · 1 comment

Comments

@zhaochen0110
Copy link

Great work!

However, I'm encountering an HTTP 503 error when trying to use the JupyterCodeExecutor in execution.py. Specifically, the issue occurs during the request to retrieve available Jupyter kernelspecs from the /api/kernelspecs endpoint.

Steps to Reproduce

  1. In execution.py, build self.executor using JupyterCodeExecutor.
  2. During execution, self.executor attempts to connect to the Jupyter server to fetch available kernelspecs.
  3. The following debug information was gathered with pdb during the process:
    • API URL: f"{self._get_api_base_url()}/api/kernelspecs"
      Result: 'http://127.0.0.1:8888/api/kernelspecs'
    • Authorization Headers: self._get_headers()
      Result: {'Authorization': 'token 2a0520927042e57913bd161b2c2e403f72a1fdfabdd4daa94878b1096844c0eb'}
    • GET Request to Kernelspecs:
      self._session.get(f"{self._get_api_base_url()}/api/kernelspecs", headers=self._get_headers())
      Result: <Response [503]>

Observed Behavior

The GET request to http://127.0.0.1:8888/api/kernelspecs returns a <Response [503]>, indicating "Service Unavailable." This prevents the JupyterCodeExecutor from initializing properly.

Expected Behavior

A successful response from the Jupyter server's /api/kernelspecs endpoint, returning the available kernelspecs in JSON format, allowing JupyterCodeExecutor to proceed.

Environment

  • Jupyter Server: Running locally on 127.0.0.1:8888
  • Authorization Token: Provided in headers as shown above.
  • Code Environment: Python, using requests.Session with retry configuration.

Additional Information

I attempted to change the port to other available ports, but the 503 error persists.

@zhaochen0110
Copy link
Author

I identified the cause of the issue today. It turns out that due to network restrictions within the cluster, enabling certain proxies resolves the problem. The solution is to set up the proxy as follows:

proxy_on; unset http_proxy; unset HTTP_PROXY

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

1 participant