Trouble redeploying Jupyterhub after the jupyterhub schema and tables (Postgres) were accidentally deleted by our DBA

We are trying to redeploy Z2JK from scratch into a GKE development environment due to an accidental deletion of the jupyterhub schema and tables that is running in a shared Google Cloud SQL for Postgres cluster. Unfortunately, there is no reliable backup of the the “jupyterhub” schema, tables and data in our development environment. (We will fix that shortly.)

We deleted all of the Z2JK deployments, stateful sets, jobs, pods, etc from the K8s namespace where Z2JK runs – and as I said the “jupyterhub” schema no longer exists because it was accidentally deleted from our Google Cloud SQL for Postgres cluster.

We re-ran the Helm deployment.

The jupyterhub pod is failing with the following error message which states there is no schema for SQLAlchemy to create the alembic_version table in. Not sure what is going on as the initial Jupyterhub deployment created the “jupyterhub” schema and all of the tables and other database objects. Can someone tell us the best way to redeploy Z2Jk from scratch (especially Jupyterhub) without having to blow away the K8s namespace where Z2JK runs and without blowing away the Cloud SQL for Postgress database where the "jupyterhub schema and tables live.

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InvalidSchemaName) no schema has been selected to create in
LINE 2: CREATE TABLE alembic_version (
^

[SQL: 
CREATE TABLE alembic_version (
	version_num VARCHAR(32) NOT NULL, 
	CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
)

]

In a GitHub issue you mentioned you were using Z2JH 0.10.6 which is quite old, can you reproduce the problem with the latest version?

Have you tried reproducing this with your own PoatgreSQL server? This will help identify whether the issue is specific to how Google Cloud are configuring and provisioning the managed databases, or whether it’s a more generic issue.