Upgrade from 5.1 to 5.5 and PostgreSQL

I tried to upgrade my working 5.1.0 install to 5.5.0 via zypper upgrade.

All went well until restart. When machine starts I see PostgreSQL service start, but Rockstor GUI will not come up. From system log I see that rockstor-pre.service fails to start.

Decisive line appears to be:

suse pam_unix(su-l:session): session closed for user postgres

During upgrade postgresql and postgresql-server and postgresql-server-devel were upgraded to ver. 17 from 13.

I tried to follow/learn from that topic here:

But manual database conversion does not work correctly. If I mv old data13 directory → data, it says that it is already ver. 17 and service can not start.

Hello again @suur13

Note that you will need to undo what you have done in experimenting on the DB as that procedure was from way-back and early in the last testing phase that lead to 5.1.0-0 stable that you were coming from when updating to 5.5.0-0 testing

This is good as it means the now built-in 13 to 17 worked as intended. That report was from a much earlier rockstor install before we did this update. But now, as part of the rpm update we do the format conversion.

However this all happens before rockstor-pre so I think it is a red-herring in your case.

Look to why your rockstor-pre.service if failing is the way to go on this one. We have had a number of reports of this and they are not all related. For example - take a look at the following issue to see if the work-around there helps, at least until we build a fix into an rpm for the observed ‘expired’ issue we are seeing in that issue:

Could you also indicate what OS base you are seeing this failure on?

Hope that helps.

1 Like

To me its seems that reason is that PostgreSQL is not starting… or ?

I’m on slowroll-20260402 it seems after the zypper update.

What I will loose, if I delete whole postgresql data and start over ?

@suur13 Could you then qualify your initial description re:

It may well now not start now due to your interventions was my thinking when I said:

Re:

All the settings basically. It will be as if you are at the following stage within the installer:

And as a linux user is created during that stage you would also want to delete that linux user before hand, so you can re-use the same username duing the ‘Rockstor Setup’ screen. Take care to refresh your browser to actually see this screen. The browser may cache your old access but it will be invalid now the system has been reset.

The hard-reset as we call it, is described in the following developer focused documentation:

It is better of course to identify the actual failure you are seeing as we have now many DB update successes from the long time ago reference you assumed was related - it may still be but I’d just like to point out that we can only fix instances of failure when we have sufficient feedback from testing users in particular. 5.5.0-0 is our first testing release in a series so most prone to issues as a result. And you did originally state, as quoted, that “… I see PostgreSQL service start, …” but assumed due to

was an error, when it is not. It is just that the user has logged out which they do. Our DB format update script uses the postres user to do the update.

But of couse, sometimes circumstances are against us. So you can do a hard reset and have Rockstor re-create an as-new-install DB. You can then either restore a config backup if you have made one recently enough, or proceed with importing the pool and re-establishing your particular configuration.

Hard reset for developer testing might take the form of:

cd
systemctl stop rockstor*
rm -rf /opt/rockstor/.initrock
# replace radmin with your admin user used during the last setup.
userdel radmin 
systemctl start rockstor-bootstrap.service

Redo the Rockstor Setup and EULA . Making sure to invoke this page by a full browser refresh, i.e. “Ctrl+Shift+r” as otherwise the browser may just still a ‘ghost’/cached page from the prior instance.

Prior Rock-ons can be of particular difficulty post such an extreme measure as this. And it would definitely be better to establish clearly if postgres started before hand or if this was a typo. Your indicated error is not an error. And Postgres may well now not start due to your very dated interventions.Or we may be talking around a typo :).

Let us know how you get one - and keep in mind you are going from Stable to the very first testing release in a phase here. And there are a lot of changes. So it would always be better to identify the cause. But I entirely appreciate that sometimes we just have to reset or re-install and import and start-over if there is insufficient time or what-ever to explore and contribute back.

Hope that helps.

1 Like

OK, now I understand what you mean by “red herring” (sorry, not native english speaker…).

I will try to fix it first, before going to hard reset, sure.

Unfortunately i did not realize it was testing branch. I just promted zypper upgrade.

@suur13 Re:

Yes that is a user difficulty that is problematic for us to address. If we default lock the ‘rockstor’ package we can break folks doing updates as sometimes during for example zypper dup particularly folks need newer ‘rockstor’ versions. But when not doing zypper dup, but normal updates the folks may expect an update. If you use the Web-UI to do updates it is possible via the flashing updates indicator in the header to update all-but the ‘rockstor’ package. Which is commonly what folks need. But for OS distribution update we have the howtos for set releases. But of course there are not set releases in Slowroll / Tumblweed, which in part is why we label them as Development/Advanced-user/Rescue use only.

An alternative, though still problematic if one needs a newer Rockstor version due to SR/TW progress, is to subscribe to the Stable channel. We have considered focusing only on maintaining SR/TW as it goes. But time will tell where we land as we do have a few changes in the pipeline currenlty.

Do keep the forum informed of your progress here as we are seeing some rockstor-pre issues that we have yet to resolve or in some cases understand.

Apologies for the “red herring” colloquialism.

Hope that helps.

2 Likes

Looks that I do not have same gpg issue, but this:

× rockstor-pre.service - Tasks required prior to starting Rockstor
Loaded: loaded (/usr/lib/systemd/system/rockstor-pre.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Thu 2026-04-23 20:59:57 EEST; 6min ago
Invocation: 8163211933e042259b3eec7302e17a1d
Process: 2471 ExecStartPre=/usr/bin/gpg --quick-generate-key --batch --passphrase rockstor@localhost (code=exited, status=2)
Process: 2472 ExecStartPre=/usr/bin/pass init rockstor@localhost (code=exited, status=0/SUCCESS)
Process: 2506 ExecStartPre=/usr/bin/pass rename --force python-keyring/rockstor/SECRET_KEY python-keyring/rockstor/SECRET_KEY_FALLBACK (code=exited, status=0/SUCCESS)
Process: 2537 ExecStartPre=/usr/bin/pass generate --no-symbols --force python-keyring/rockstor/SECRET_KEY 100 (code=exited, status=0/SUCCESS)
Process: 2550 ExecStartPre=/usr/bin/rpm --erase gpg-pubkey-5f043187 (code=exited, status=0/SUCCESS)
Process: 2551 ExecStartPre=/usr/bin/rpm --import /opt/rockstor/conf/ROCKSTOR-GPG-KEY (code=exited, status=0/SUCCESS)
Process: 2552 ExecStart=/usr/local/bin/poetry run initrock (code=exited, status=1/FAILURE)
Main PID: 2552 (code=exited, status=1/FAILURE)

Then I saw this topic:

Rockstor-Pre Service failing after Update to 5.0.0-0 - Rockstor Community Forum

Based on that only thing I can suspect is having now Python313 as default instead of Rockstor required Python311 ?

PS. No need to apologize, learning language is also learning. I knew the term, but could not somehow put in context. Probably I was too “fixed” to my “error”… :slight_smile:

when you run (while in the /opt/rockstor directory) the initrock directly, i.e.

/usr/local/bin/poetry run initrock

what details do you get?

:/opt/rockstor> /usr/local/bin/poetry run initrock
Traceback (most recent call last):
File “/opt/rockstor/.venv/bin/initrock”, line 3, in
from scripts.initrock import main
File “/opt/rockstor/src/rockstor/scripts/init.py”, line 23, in
django.setup()
File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/init.py”, line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/conf/init.py”, line 81, in getattr
self._setup(name)
File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/conf/init.py”, line 68, in _setup
self._wrapped = Settings(settings_module)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/conf/init.py”, line 166, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib64/python3.11/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1147, in _find_and_load_unlocked
File “”, line 690, in _load_unlocked
File “”, line 936, in exec_module
File “”, line 1073, in get_code
File “”, line 1130, in get_data
PermissionError: [Errno 13] Permission denied: ‘/opt/rockstor/src/rockstor/settings.py’

when you ran the poetry command, did you run it as user root or with sudo?

:/opt/rockstor> sudo /usr/local/bin/poetry run initrock
2026-04-23 22:25:44,964: Checking for flash and Running flash optimizations if appropriate.
2026-04-23 22:25:45,786: Updating the timezone from the system
2026-04-23 22:25:45,787: system timezone = Europe/Tallinn
2026-04-23 22:25:45,788: Initialising SSHD config
2026-04-23 22:25:45,789: SSHD (/usr/etc/ssh/sshd_config) sftp-server already disabled
2026-04-23 22:25:45,789: SSHD (/etc/ssh/sshd_config.d/rockstor-sftp.conf) already initialised
2026-04-23 22:25:45,822: --DB-- Tune Postgres --DB–
2026-04-23 22:25:45,822: --DB-- Running - Setup_host_based_auth
2026-04-23 22:25:45,897: --DB-- Done with Setup_host_based_auth.
2026-04-23 22:25:45,897: --DB-- Running - Reload_config
2026-04-23 22:25:45,971: --DB-- Done with Reload_config.
2026-04-23 22:25:45,973: --DB-- Running - PG_tune
2026-04-23 22:25:46,133: --DB-- Done with PG_tune.
2026-04-23 22:25:46,133: --DB-- Tune Postgres Done --DB–.
2026-04-23 22:25:46,133: Running app database migrations…
2026-04-23 22:25:47,447: non-zero code(1) returned by command: [‘/opt/rockstor/.venv/bin/django-admin’, ‘migrate’, ‘–noinput’, ‘–fake-initial’, ‘–database=default’, ‘contenttypes’]. output: [‘’] error: [‘Traceback (most recent call last):’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 279, in ensure_connection’, ’ self.connect()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 256, in connect’, ’ self.connection = self.get_new_connection(conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 332, in get_new_connection’, ’ connection = self.Database.connect(**conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/psycopg/connection.py”, line 122, in connect’, ’ raise last_ex.with_traceback(None)‘, ‘psycopg.OperationalError: connection failed: connection to server on socket “/run/postgresql/.s.PGSQL.5432” failed: FATAL: password authentication failed for user “rocky”’, ‘’, ‘The above exception was the direct cause of the following exception:’, ‘’, ‘Traceback (most recent call last):’, ’ File “/opt/rockstor/.venv/bin/django-admin”, line 8, in ’, ’ sys.exit(execute_from_command_line())‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line’, ’ utility.execute()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/init.py”, line 436, in execute’, ’ self.fetch_command(subcommand).run_from_argv(self.argv)‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 420, in run_from_argv’, ’ self.execute(*args, **cmd_options)‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 464, in execute’, ’ output = self.handle(*args, **options)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 111, in wrapper’, ’ res = handle_func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py”, line 114, in handle’, ’ executor = MigrationExecutor(connection, self.migration_progress_callback)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/executor.py”, line 18, in init’, ’ self.loader = MigrationLoader(self.connection)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/loader.py”, line 58, in init’, ’ self.build_graph()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/loader.py”, line 235, in build_graph’, ’ self.applied_migrations = recorder.applied_migrations()‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/recorder.py”, line 89, in applied_migrations’, ’ if self.has_table():‘, ’ ^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/recorder.py”, line 63, in has_table’, ’ with self.connection.cursor() as cursor:‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 320, in cursor’, ’ return self._cursor()‘, ’ ^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 296, in _cursor’, ’ self.ensure_connection()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 278, in ensure_connection’, ’ with self.wrap_database_errors:‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/utils.py”, line 91, in exit’, ’ raise dj_exc_value.with_traceback(traceback) from exc_value’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 279, in ensure_connection’, ’ self.connect()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 256, in connect’, ’ self.connection = self.get_new_connection(conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 332, in get_new_connection’, ’ connection = self.Database.connect(**conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/psycopg/connection.py”, line 122, in connect’, ’ raise last_ex.with_traceback(None)‘, ‘django.db.utils.OperationalError: connection failed: connection to server on socket “/run/postgresql/.s.PGSQL.5432” failed: FATAL: password authentication failed for user “rocky”’, ‘’]
Traceback (most recent call last):
File “/opt/rockstor/.venv/bin/initrock”, line 6, in
sys.exit(main())
^^^^^^
File “/opt/rockstor/src/rockstor/scripts/initrock.py”, line 620, in main
run_command(
File “/opt/rockstor/src/rockstor/system/osi.py”, line 294, in run_command
raise CommandException(cmd, out, err, rc)
system.exceptions.CommandException: Error running a command. cmd = /opt/rockstor/.venv/bin/django-admin migrate --noinput --fake-initial --database=default contenttypes. rc = 1. stdout = [’‘]. stderr = [‘Traceback (most recent call last):’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 279, in ensure_connection’, ’ self.connect()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 256, in connect’, ’ self.connection = self.get_new_connection(conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 332, in get_new_connection’, ’ connection = self.Database.connect(**conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/psycopg/connection.py”, line 122, in connect’, ’ raise last_ex.with_traceback(None)‘, ‘psycopg.OperationalError: connection failed: connection to server on socket “/run/postgresql/.s.PGSQL.5432” failed: FATAL: password authentication failed for user “rocky”’, ‘’, ‘The above exception was the direct cause of the following exception:’, ‘’, ‘Traceback (most recent call last):’, ’ File “/opt/rockstor/.venv/bin/django-admin”, line 8, in ’, ’ sys.exit(execute_from_command_line())‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line’, ’ utility.execute()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/init.py”, line 436, in execute’, ’ self.fetch_command(subcommand).run_from_argv(self.argv)‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 420, in run_from_argv’, ’ self.execute(*args, **cmd_options)‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 464, in execute’, ’ output = self.handle(*args, **options)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/base.py”, line 111, in wrapper’, ’ res = handle_func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py”, line 114, in handle’, ’ executor = MigrationExecutor(connection, self.migration_progress_callback)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/executor.py”, line 18, in init’, ’ self.loader = MigrationLoader(self.connection)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/loader.py”, line 58, in init’, ’ self.build_graph()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/loader.py”, line 235, in build_graph’, ’ self.applied_migrations = recorder.applied_migrations()‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/recorder.py”, line 89, in applied_migrations’, ’ if self.has_table():‘, ’ ^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/migrations/recorder.py”, line 63, in has_table’, ’ with self.connection.cursor() as cursor:‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 320, in cursor’, ’ return self._cursor()‘, ’ ^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 296, in _cursor’, ’ self.ensure_connection()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 278, in ensure_connection’, ’ with self.wrap_database_errors:‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/utils.py”, line 91, in exit’, ’ raise dj_exc_value.with_traceback(traceback) from exc_value’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 279, in ensure_connection’, ’ self.connect()‘, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/base/base.py”, line 256, in connect’, ’ self.connection = self.get_new_connection(conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/utils/asyncio.py”, line 26, in inner’, ’ return func(*args, **kwargs)‘, ’ ^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py”, line 332, in get_new_connection’, ’ connection = self.Database.connect(**conn_params)‘, ’ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’, ’ File “/opt/rockstor/.venv/lib/python3.11/site-packages/psycopg/connection.py”, line 122, in connect’, ’ raise last_ex.with_traceback(None)', ‘django.db.utils.OperationalError: connection failed: connection to server on socket “/run/postgresql/.s.PGSQL.5432” failed: FATAL: password authentication failed for user “rocky”’, ‘’]

actually to run the initrock as standalone, you probably need to do this first (sudo, unless you’re logging in with your root user, which might be easier for this):

still in the /opt/rockstor

sudo export DJANGO_SETTINGS_MODULE=settings
and then
sudo poetry run initrock

1 Like

It gives same output.

1 Like

Let’s check whether you can log into the database directly, e.g.

psql -U rocky -d storageadmin -c "SELECT * FROM storageadmin_networkdevice";

The password is the same as the user name, rocky

psql -U rocky -d storageadmin -c “SELECT * FROM storageadmin_networkdevice”;
Password for user rocky:
psql: error: connection to server on socket “/run/postgresql/.s.PGSQL.5432” failed: FATAL: password authentication failed for user “rocky”

I’m assuming the DB is up and running, though?

systemctl status postgresql

● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled)
Active: active (running) since Thu 2026-04-23 22:18:41 EEST; 37min ago
Invocation: c846dce861ef415e9bd18b6bfeca7557
Process: 1139 ExecStart=/usr/share/postgresql/postgresql-script start (code=exited, status=0/SUCCESS)
Main PID: 1182 (postgres)
Tasks: 7
CPU: 3.223s
CGroup: /system.slice/postgresql.service
├─1182 /usr/lib/postgresql17/bin/postgres -D /var/lib/pgsql/data
├─1267 "postgres: logger "
├─1269 "postgres: checkpointer "
├─1270 "postgres: background writer "
├─1273 "postgres: walwriter "
├─1274 "postgres: autovacuum launcher "
└─1275 "postgres: logical replication launcher "

Warning: some journal files were not opened due to insufficient permissions.

1 Like

Mhm, I’m at the end here. I suspect, you might have to go with a hard reset as @phillxnet suggested, unless he has additional suggestions …

1 Like

Pity. I still hope to resolve it somehow…

But what is the issue ? Gpg keys seems fine, also PostgreSQL running. Can not log into database ? But why is that ? Permissions issue ?

@suur13 Re:

Somewhere along the line here there seems to have been a failure to setup the Database correctly, the authentication issue here could be down to our Host Based Authentication having been lost or overwritten. Check the contents of your:

  • /var/lib/pgsql/data/pg_hba.conf

it should be owner:group of postgres:postgres and “-rw-------” and have the same contents as:

  • /opt/rockstor/conf/pg_hba.conf

As initrock overwrites this file to establish our localhost port-only access to Postgres.

However there also looks to be other file ownership/permissions issues for Postgres.

Which points back to possible falty intervention by the wrong user, i.e. ‘root’. Postgres is fussy that way. Hence our DB format upgrade script:

  • /opt/rockstor/src/rockstor/scripts/db_upgrade.sh

changing to the postgres user via sudo -u postgres ... to do the format transition from 13 to 15 to 17, depending on what was found and the rpm age.

A typical Postgres DB data subdir would look ownership/permissions wise something like:

ls -la /var/lib/pgsql/data
total 72
drwx------ 1 postgres postgres   550 Apr 24 09:25 .
drwxr-x--- 1 postgres postgres   162 Apr 23 18:18 ..
drwx------ 1 postgres postgres    26 Apr 23 18:20 base
-rw------- 1 postgres postgres    44 Apr 24 09:25 current_logfiles
drwx------ 1 postgres postgres   662 Apr 24 09:22 global
drwx------ 1 postgres postgres   128 Apr 24 09:21 log
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_commit_ts
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_dynshmem
-rw------- 1 postgres postgres  5258 Apr 24 09:25 pg_hba.conf
-rw------- 1 postgres postgres  2640 Apr 23 18:18 pg_ident.conf
drwx------ 1 postgres postgres    76 Apr 24 09:26 pg_logical
drwx------ 1 postgres postgres    28 Apr 23 18:18 pg_multixact
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_notify
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_replslot
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_serial
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_snapshots
drwx------ 1 postgres postgres     0 Apr 24 09:21 pg_stat
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_stat_tmp
drwx------ 1 postgres postgres     8 Apr 23 18:18 pg_subtrans
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_tblspc
drwx------ 1 postgres postgres     0 Apr 23 18:18 pg_twophase
-rw------- 1 postgres postgres     3 Apr 23 18:18 PG_VERSION
drwx------ 1 postgres postgres   142 Apr 23 18:28 pg_wal
drwx------ 1 postgres postgres     8 Apr 23 18:18 pg_xact
-rw------- 1 postgres postgres   495 Apr 24 09:25 postgresql.auto.conf
-rw------- 1 postgres postgres 30941 Apr 23 18:18 postgresql.conf
-rw------- 1 postgres postgres    62 Apr 24 09:21 postmaster.opts
-rw------- 1 postgres postgres    95 Apr 24 09:21 postmaster.pid

Where the contents of the PG_VERSION, i.e. viewed via:

cat /var/lib/pgsql/data/PG_VERSION
17

should, as in the above, show the DB format version. Note that this reflects the format, it does not define the format. And the change is non-trivial, again see our db_upgrade.sh if you are interested in how we do this.

Systemd scripts read this indicator file to invoke older Posgres versions if requried, which is why we need to do format updates as our Django versions moved beyond our original Postgres 13, then 15, and we now need format 17 for Django to work with the Postgres version invoked by the format version found on the in-place DB.

Hope that helps to at least explain things some. But from the above you may be able to fathom some more history on what may have happened here. And possibly revert or correct changes previously made. We may have a bug here where upstream has changed something so this is all good to know - plus it is nice to have these details exposed more on the forum - though they are of most interest to developers of course.

Hope that helps.

2 Likes