# Timeout while spawning notebook server

**URL:** <https://discourse.jupyter.org/t/timeout-while-spawning-notebook-server/25494>\
**Category:** Zero to JupyterHub on Kubernetes\
**Tags:** jupyterlab, jupyterhub\
**Created:** [May 3, 2024, 9:40am UTC](https://discourse.jupyter.org/t/timeout-while-spawning-notebook-server/25494 "2024-05-03T09:40:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neeraj\_Sharma](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/neeraj_sharma/32/12510_2.png) [@Neeraj\_Sharma](https://discourse.jupyter.org/u/Neeraj_Sharma)\
**Post date:** [May 3, 2024, 9:40am UTC](https://discourse.jupyter.org/t/timeout-while-spawning-notebook-server/25494/1 "2024-05-03T09:40:54Z")

</div>

I have done jupyterhub setup on k8s using helm charts  
Everything was working fine but recently few days back I could see that my user pods are not getting spawned  
My config file

```auto
proxy:
  secretToken: "some_secret"
  https:
    enabled: true
    hosts:
      - jupyterhub.xyz.com
    letsencrypt:
      contactEmail: abc@xyz.com

singleuser:
  # Define the default image for user servers
  # use a stable tag for versioning latest may not be stable
  image:
    name: custom-image
    tag: latest

prePuller:
  hook:
    enabled: false
  continuous:
    enabled: true

hub:
  config:
    Authenticator:
      admin_users:
        - xyz
    DummyAuthenticator:
      password: abc
    JupyterHub:
      tornado_settings:
        headers:
          'Access-Control-Allow-Origin': '*'
          'Content-Security-Policy': "frame-ancestors * "

  extraConfig:
    myConfig.py: |  
      from jupyterhub.handlers import BaseHandler
      from jupyterhub.auth import Authenticator
      from tornado.web import RedirectHandler
      from tornado import web
      from jupyterhub import orm
      import subprocess
      import requests
     

      #subprocess.run(['pip', 'install', 'psycopg2-binary'])
      

      # Set the PostgreSQL database URL using environment variables
      db_host = os.getenv('PGHOST', 'ip')
      db_port = os.getenv('PGPORT', '5432')
      db_name = os.getenv('PGDATABASE', 'jupyterhub2')
      db_user = os.getenv('PGUSER', 'admin')
      db_password = os.getenv('PGPASSWORD', 'password)

      db_url = f"postgresql+psycopg2://{db_user}:{db_password}@{db_host}:{db_port}/{db_name}"
      c.JupyterHub.db_url = db_url

      c.JupyterHub.log_level= 'DEBUG'        
      c.Spawner.default_url = '/lab'
      #c.Spawner.args = ['--LabApp.default_url=/lab/tree']
      c.Spawner.args = ['--NotebookApp.tornado_settings={"headers":{"Content-Security-Policy": "frame-ancestors * self testingcourse.acciojob.com"}}']   

      c.JupyterHub.allow_named_servers = True
      c.JupyterHub.named_server_limit_per_user = 1
      c.JupyterHub.redirect_to_server = False
      c.LocalProcessSpawner.debug = True
      #c.NotebookApp.tornado_settings = {
      # 'headers': {
      # 'Content-Security-Policy': "frame-ancestors 'self' '*' ;"
      # }
      #}

```

helm upgrade jhub jupyterhub/jupyterhub --namespace=jhub -f config.yaml

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/4/4a6431acbe4641e8503e5c913069cef569fa7f25.png)

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [May 4, 2024, 1:31pm UTC](https://discourse.jupyter.org/t/timeout-while-spawning-notebook-server/25494/2 "2024-05-04T13:31:07Z")

</div>

Can you show us your hub pod logs, and your singleuser pod logs (if the pod was created but failed to sucessfully start).

There are some debugging suggestions in [Debugging — Zero to JupyterHub with Kubernetes documentation](https://z2jh.jupyter.org/en/stable/administrator/debug.html) .

Which version of the Z2JH chart are you using? Are you running on a cloud managed Kubernetes, or is it self-installed?
