redsolution / xabber-server

Xabber Server: an advanced XMPP server, with reliable message delivery, message editing and retraction, group chats, active session management and fast client synchronization
https://www.xabber.com/server/
Other
25 stars 12 forks source link

Error installing Xabber server - can not connect to postgres database #14

Open OOOlledj opened 1 year ago

OOOlledj commented 1 year ago

Trying to install Xabber server with postgres database, but it is not successful during configuring in web interface :

Installation failed. Can't connect to database. Maybe you enter wrong data.

Database is running on docker with exposed port 5432. I did everything according to Wiki, but still got the message, and i have no idea what the problem is, because Xabber server does not write any logs during installation.

database: xabber_server_db user: xabber_server_user I'm absolutely sure the password is correct, because it works perfectly on psql CLI client and dbeaver with created user and db.

andrewnenakhov commented 1 year ago

It is definitely a network configuration issue. Try connecting to database with psql, if that doesn't work, that'd be a confirmation that the problem is with the network.

OOOlledj commented 1 year ago

Not sure if that's network problem, can connect to the db with psql.

Excuting:

psql -h localhost -p 5432 -U xabber_server_user xabber_server_db

Getting:

Password for user xabber_server_user: 
psql (14.8 (Ubuntu 14.8-0ubuntu0.22.04.1), server 14.3)
Type "help" for help.

xabber_server_db=> \d
             List of relations
 Schema | Name | Type  |       Owner        
--------+------+-------+--------------------
 public | test | table | xabber_server_user
(1 row)

xabber_server_db=> 

And docker container with database:

docker container ls

CONTAINER ID   IMAGE                COMMAND                  CREATED      STATUS          PORTS                                       NAMES
ce5a33c6cb32   postgres:14-alpine   "docker-entrypoint.s…"   3 days ago   Up 16 minutes   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp   xabber-psql
(base) root@Clavidia-IP:/home/ooolledj/Desktop# 

src1 src2

nameless-madman commented 7 months ago

@OOOlledj @andrewnenakhov @Sternstein

Hello everyone. same issue. i edited and checked my postgresql.config and pg_hba.conf.

it's free to connect from any host. i can connect from my lan to the xabber_server_db database with login xabber_server_user and password through psql on linux machines or psql.exe on windows with no problem.

but when i'm trying to do this through my_xabber_server_host_name(or ip adress):8000 - it's failing in same way with same error.

more then that - there is no info in postgresql log's about attempting of connection. even if i'm doing it on the xabber server host through browser. it looks like it doesn't even trying to connect to database.

guys, need your help..

(edited the xabber_server.ini file to make it write some logs. but nothing useful there) github1 guthub2

UPDATE: i resolved that issue by executing /opt/xabberserver/utils/psql/psql. The poblem was with missing dependency (libxcrypt if i remember). that binary is outdated maybe. after installing the necessary packet it connected to database but then: github3

in the /opt/xmppserver/var/log/ejabberd/ appeared 3 log files. i'm attaching them here so someone could help.. crash.log ejabberd.log error.log

oxoWrk commented 7 months ago

Check that "sql_username:" and "sql_password" are correct in /opt/xabberserver/xabberserver/xmppserver/etc/ejabberd/ejabberd.yml . And review errors in postgresql server log.