(psycopg2.OperationalError)

Hi all,
I have AiiDA in home directory of HPC.
I am trying to configure the computer.yaml which has following tags:
label: newhpc # PLEASE CHANGE HERE AS YOU WISH
description: lanl_hpc # PLEASE CHANGE HERE AS YOU WISH
hostname: localhost # for example lumi.csc.fi for LUMI-G supercomputer; in your case it can also be a resolved address like 111.222.33.44
transport: core.local
scheduler: core.slurm
work_dir: “/lustre/scratch4/turquoise/rkarkee/AiiDA” # PLEASE CHANGE HERE AS YOU WISH
mpirun_command: “srun -n {tot_num_mpiprocs}” # leave it like this, so that {tot_num_mpiprocs} can be changed dynamically, e.g. in case you have other partitions on the same cluster
mpiprocs_per_machine: 256 # your default number of mpiprocs on the default partition

Then when I try to configure it, I get the following:
Can you please suggest on how may I fix this?

(aiidaENV) rkarkee@ch-fe2:~> verdi computer setup --config computer.yaml
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Shebang line (first line of each script, starting with #!) [#!/bin/bash]: #!/bin/bash
Default amount of memory per machine (kB).: 51765
Escape CLI arguments in double quotes [y/N]: N
Critical: Could not connect to database: (psycopg2.OperationalError) connection to server at “localhost” (127.0.0.1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?

(Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation)
(aiidaENV) rkarkee@ch-fe2:~>

The problem is that AiiDA requires a PostgreSQL server to run (at least for the default storage backend) and there is none running on your machine. At least not on the port 5432 that is configured.

Given that you are on an HPC cluster, I assume PostgreSQL is not running as a system service, and since you managed to create a profile, you must have installed it as part of a Conda environment? If so, please note that in this case the PostgreSQL service is not automatically started, but has to be started manually. See this thread for example solution: Getting started — AiiDA 2.5.1.post0 documentation

The documentation also contains this information: Installation into Conda environment — AiiDA 2.5.1.post0 documentation

Hi sphuber
I followed the step and created a profile.
Then when I do verdi daemon start 2, it gave me this error:

(aiidaENV) rkarkee@ch-fe2:~> verdi daemon start 2
Critical: Could not connect to database: (psycopg2.OperationalError) connection to server at “localhost” (127.0.0.1), port 5432 failed: FATAL: database “rkarkee_rkarkee_20554bcc4bead70a3479c4ef8d5f1f4e” does not exist

(Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation)