Help with Outline & Synapse configuration | PostgreSQL misconfiguration

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.0.7 (testing)
I have access to my server : Through SSH & through the webadmin

Description of my issue

I have had a recent issue with migrating my database from one VPS instance to another without an export, as I didn’t know that this feature existed. I opened up a GitHub discussion and asked for help here. I managed to get it fixed with the help of @Limezy but when I tried to change the appropriate keys for PSQL to work when upgrading the instance, Outline & my Matrix installation stopped working, with Outline starting, but not allowing me to log in and Matrix not being able to start.
Logs: Outline and Matrix
Something else I have also noticed, is that PSQL also doesn’t want to start.
Logs: PostgreSQL
I don’t know what to do anymore, and any help would be appreciated. Thanks a lot in advance!

Let’s first try to have your postgresql running again…

Can you please run :
cd /run/postgresql and then ls -ll and share the output here ?
Files in /run/postgresql should be owned by the postgresql user

Same for cd /etc/postgresql/13/main/ and then ls -ll then share the output here ?
Files in /etc/postgresql/13/main/ should be owned by the postgresql user

Did you do any other changes than the steps I gave you on github ?

And by the way, welcome to the Yunohost forum and community !

1 Like
root@panel:/etc/postgresql/13/main# ls -ll
total 56
drwxr-xr-x 2 postgres postgres  4096 May 13 22:30 conf.d
-rw-r--r-- 1 postgres postgres   315 May 13 22:30 environment
-rw-r--r-- 1 postgres postgres   143 May 13 22:30 pg_ctl.conf
-rw-r----- 1 postgres postgres  5118 May 24 18:37 pg_hba.conf
-rw-r----- 1 postgres postgres  1685 May 24 18:29 pg_ident.conf
-rw-r--r-- 1 postgres postgres 28381 May 13 22:30 postgresql.conf
-rw-r--r-- 1 postgres postgres   317 May 13 22:30 start.conf
root@panel:/etc/postgresql/13/main#

That’s the output of that.

And by the way, welcome to the Yunohost forum and community !

Thanks a lot! Great to be here.

Can you please show here the content of your /etc/postgresql/13/main/pg_hba.conf file ?

# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file.  A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access.  Records take one of these forms:
#
# local         DATABASE  USER  METHOD  [OPTIONS]
# host          DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostssl       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostnossl     DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostgssenc    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostnogssenc  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# non-SSL TCP/IP socket.  Similarly, "hostgssenc" uses a
# GSSAPI-encrypted TCP/IP socket, while "hostnogssenc" uses a
# non-GSSAPI socket.
#
# DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof.  In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches.  It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask.  A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts.  Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or
# "scram-sha-256" are preferred since they send encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE.  The available options depend on the different
# authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted.  Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the server receives a
# SIGHUP signal.  If you edit the file on a running system, you have to
# SIGHUP the server for the changes to take effect, run "pg_ctl reload",
# or execute "SELECT pg_reload_conf()".
#
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records.  In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.




# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

# My thingies
# TYPE  DATABASE        USER            ADDRESS                 METHOD  [OPTIONS]
local   all             postgres        127.0.0.1/32            peer    map=yunohost-map

I’ve added everything under # My thingies, idk if that breaks it

May I know why you have added these ?
Could you please try to temporarily remove them and restart Posgres with sudo yunohost service restart postgresql ? I bet both Outline and Matrix will start working again !

After searching online, I tried to make my user be able to log into psql, as it didn’t allow me to. I think I’ve then forgotten that I have added them as I was already able to log in using root.
After removing these, my Matrix instance was able to start up again. Outline still shows an error, although a new one:

These are the logs:

journalctl:

-- Boot 12be496c74354d6fbb6b458a8bb6aef9 --
May 25 18:52:49 systemd[1]: Started Outline server.
May 30 12:11:15 systemd[1]: Stopping Outline server...
May 30 12:11:20 systemd[1]: outline.service: Succeeded.
May 30 12:11:20 systemd[1]: Stopped Outline server.
May 30 12:11:20 systemd[1]: outline.service: Consumed 9min 46.133s CPU time.
May 30 12:11:20 systemd[1]: Started Outline server.
May 30 12:11:52 systemd[1]: Stopping Outline server...
May 30 12:11:57 systemd[1]: outline.service: Succeeded.
May 30 12:11:57 systemd[1]: Stopped Outline server.
May 30 12:11:57 systemd[1]: outline.service: Consumed 6.073s CPU time.
May 30 12:11:57 systemd[1]: Started Outline server.

And the Outline logs:

    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'auth.c',
    line: '331',
    routine: 'auth_failed'
  },
  original: error: password authentication failed for user "outline"
      at Parser.parseErrorMessage (/var/www/outline/node_modules/pg-protocol/dist/parser.js:278:15)
      at Parser.handlePacket (/var/www/outline/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/var/www/outline/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/var/www/outline/node_modules/pg-protocol/dist/index.js:10:42)
      at Socket.emit (events.js:400:28)
      at Socket.emit (domain.js:475:12)
      at addChunk (internal/streams/readable.js:293:12)
      at readableAddChunk (internal/streams/readable.js:267:9)
      at Socket.Readable.push (internal/streams/readable.js:206:10)
      at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
    length: 103,
    severity: 'FATAL',
    code: '28P01',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'auth.c',
    line: '331',
    routine: 'auth_failed'
  }
}
{"label":"http","level":"info","message":"  --> POST /api/auth.config 500 32ms 78b"}
{"label":"http","level":"info","message":"  <-- GET /static/service-worker.js"}
{"label":"http","level":"info","message":"  --> GET /static/service-worker.js 200 7ms 1.57kb"}

> outline@0.63.0 start /var/www/outline
> node ./build/server/index.js

Your posgresql password for outline user is wrong !
Did you do the steps 31 to 37 as shown here : Reset my server. Have a full drive backup. How do I restore everything? · Discussion #3550 · outline/outline · GitHub ?
Could you please try to use Adminer and log into your outline postgresql database using the same password as the one you have in your /var/www/outline/.env file ?

And as a general advise you should always take notes about any non-standard modification you make on your production server (Yunohost or non-Yunohost). As you can see it can then take a lot of time to debug once you basically forgot where you come from !

Your posgresql password for outline user is wrong !

It fixed itself after a reboot. Thanks a lot though.

And as a general advise you should always take notes about any non-standard modification you make on your production server (Yunohost or non-Yunohost). As you can see it can then take a lot of time to debug once you basically forgot where you come from !

I’ll be sure to follow your tip, thanks a lot.
Thanks for the help as well. I appreciate it!

Happy to know your instance is now up and running.
Did the update to v0.64.3 work well ?
If yes you can mark this thread as solved !

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.