Hi all,
I am installing AiiDA in WSL2, but during quicksetup I ran into following error. Can you please help me to resolve this?
(aiida) rkarkee@RKARKEE:~$ verdi quicksetup
/home/rkarkee/envs/aiida/lib/python3.10/site-packages/aiida/manage/configuration/settings.py:59: UserWarning: Creating AiiDA configuration folder `/home/rkarkee/.aiida`.
warnings.warn(f'Creating AiiDA configuration folder `{path}`.')
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Profile name [quicksetup]: rkee
Email Address (for sharing data): rijankarkee@gmail.com
First name [John]: Rijan
Last name [Doe]: Karkee
Institution [Unknown]:
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
[sudo] password for rkarkee:
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
Trying to become 'postgres' user. You may be asked for your 'sudo' password.
ERROR: invalid locale name: "en_US.UTF-8"
Error: Oops! quicksetup was unable to create the AiiDA database for you.
See `verdi quicksetup -h` for how to specify non-standard parameters for the postgresql connection.
Alternatively, create the AiiDA database yourself:
Run the following commands as a UNIX user with access to PostgreSQL (Ubuntu: $ sudo su postgres):
$ psql template1
==> CREATE USER "aiida_qs_rkarkee_c67355a95f0f30138e43b517f5e739a9" WITH PASSWORD '<password>'
==> GRANT "aiida_qs_rkarkee_c67355a95f0f30138e43b517f5e739a9" TO current_user
==> CREATE DATABASE "rkee_rkarkee_c67355a95f0f30138e43b517f5e739a9" OWNER "aiida_qs_rkarkee_c67355a95f0f30138e43b517f5e739a9" ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0
and then use `verdi setup` instead.
Traceback (most recent call last):
File "/home/rkarkee/envs/aiida/bin/verdi", line 8, in <module>
sys.exit(verdi())
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/aiida/cmdline/commands/cmd_setup.py", line 224, in quicksetup
raise exception
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/aiida/cmdline/commands/cmd_setup.py", line 214, in quicksetup
db_username, db_name = postgres.create_dbuser_db_safe(dbname=db_name, dbuser=db_username, dbpass=db_password)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/aiida/manage/external/postgres.py", line 223, in create_dbuser_db_safe
self.create_db(dbuser=dbuser, dbname=dbname)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/aiida/manage/external/postgres.py", line 169, in create_db
self.execute(_CREATE_DB_COMMAND.format(dbname, dbuser))
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/pgsu/__init__.py", line 120, in execute
return _execute_su_psql(command, dsn)
File "/home/rkarkee/envs/aiida/lib/python3.10/site-packages/pgsu/__init__.py", line 368, in _execute_su_psql
proc.check_returncode()
File "/usr/lib/python3.10/subprocess.py", line 457, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['sudo', '-n', 'su', 'postgres', '-c', 'cd ~ && psql -d template1 -p 5432 -tc \'CREATE DATABASE "rkee_rkarkee_c67355a95f0f30138e43b517f5e739a9" OWNER "aiida_qs_rkarkee_c67355a95f0f30138e43b517f5e739a9" ENCODING \'"\'"\'UTF8\'"\'"\' LC_COLLATE=\'"\'"\'en_US.UTF-8\'"\'"\' LC_CTYPE=\'"\'"\'en_US.UTF-8\'"\'"\' TEMPLATE=template0\'']'