Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
OOOlledj opened this issue Jul 8, 2023 · 4 comments
Open

Comments

@OOOlledj
Copy link

OOOlledj commented Jul 8, 2023

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
Copy link
Member

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
Copy link
Author

OOOlledj commented Jul 12, 2023

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
Copy link

nameless-madman commented Nov 26, 2023

@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
Copy link

oxoWrk commented Dec 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants