Unknown authentication response while running gitea

When I run gitea web command there is an authentication error:
failed to initialize orm engine: pg: unknown authentication response: 10
Gitea version is 1.4 and PostgreSQL version is 14. I am using the existing gitea configuration on the RAID array. scram-sha-256 is alredy specified in the pg_hda.conf of the postgres. What can be done to solve this issue? Thanks!

Are you sure the Gitea version is 1.4?
That is extremely outdated (about 5 years), so I’m just clarifying.

If it is, I would recommend trying to update and following the release posts to account for any breaking changes.

Yes, it is indeed a very outdated version that is in use, this is because this is what was previously in use on the existing RAID array of the server and I didn’t change this. Is there a way to update it without breaking current configurations?

Thanks @jolheiser for the suggestion to upgrade gitea, I did that and now it is 1.18 that is installed.

Now gitea is running, we can e.g. create a new used but the existing users and repositories have not been loaded. I created the PostqreSQL database as was mentioned at Database Preparation - Docs and added authentication rule to pg_hba.conf but the final step (psql -U gitea -d giteadb) throws an error:

error: connection to server on socket "/var/run/postgresql/.s.PQSQL.5432" failed: FATAL: Peer authentication failed for used "gitea"

I created the user and password as well as the database, so neither of these should be missing.
How can I link the previous database with existing users and repositories?

What was recommended for older versions (pre 1.14 I think?) is to slowly update one version at a time to make sure migrations run correctly.

Going directly to 1.18 might miss some things from a version that old.

Before version 1.4 was installed, very old one, I will try to update one version at a time, thanks.