We are looking to migrate our Xray instance from a built-in Postgres DB to an external Postgres DB cluster, version 14.
We get this error messages when we try to connect:
Oct 24 15:41:40 xray xrayManage.sh[1730047]: TRACE] JDBC to PostgreSQL URL conversion: begin
Oct 24 15:41:40 xray xrayManage.sh[1730047]: [TRACE] JDBC to PostgreSQL URL conversion: endDatabase ping failed with error pq: unexpected authentication response: 'R'
Oct 24 15:41:40 xray xrayManage.sh[1730047]: Database connection check failed <nil>
What does the "R" connection response mean? I have done much googling on this but not much has returned.
P.S. I know that Jfrog does not support postgres 14 yet but I feel like this should be a fixable problem if I knew what this authentication response meant.
We MUST use ssl to connect to our external postgres db.
Downgrading the external db is NOT an option.
Connecting to the external database works when we use the command "psql -U xray -h hostname -p 9898 "dbname=xray sslmode=allow" -W" as user xray.
We have tried every sslmode option but all produce the same result.
Also to be clear "xray" is the name of the user, server, external db, and external db user.
Related
I'm trying to integrate my Keycloak server with Postgres, and ran into an odd problem. When starting my keycloak server with the provided command on Ubuntu:
./kc.sh start-dev --http-port ${PORT} --db-url=jdbc:postgres://myurl.com/database --db=postgres --db-schema auth --db-username postgres --db-password password
I get the following error:
[org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
But of course, shown above, my database isn't on localhost, and I set the --db-url option accordingly. This makes me think keycloak is ignoring --db-url, as localhost:5432 is the default value for a Postgres connection.
Does anyone know why this might be happening?
EDIT: Running Keycloak version 19.0.1
I have a postgres database (version 9.2) running on Centos 6.9.
I am running pgbouncer version 1.6.1
When I try connect to postgres using datagrip from my Mac, I get:
08P01: Error: Auth Failed
And I get on the server:
/var/log/pgbouncer.log
2021-05-21 18:29:02.644 7489 WARNING C-0x15cf078: postgres/jode#127.0.0.1:56254 Pooler Error: Auth failed
When I login to postgres using Pgadmin 4 from the same Mac and same settings, I get right in and there are no errors or warnings in pgbouncer.
What could the problem?
PgAdmin is not working via JDBC. So you need to configure pgBouncer to accept TCP/IP connections (see similar dba exchange question)
I am very new to postgreSQL and struggling to create a connection in my Eclipese.
Here is what I have done till now:
Installed DBeaver plugin for eclipse from marketplace.
Installed PostgreSQL version 10 from https://www.postgresql.org/download/windows/
Now I attempt to create a connection in Eclipse but I get an error "FATAL: password authentication failed for user "testuser"
I checked through a similar thread (
Getting authentication failed error with postgresql from command line
) but could not resolve the issue.
Could you please help.
To connect the PostgreSQL via Command line you have to install a PostgreSQL provided tool called "psql" if not installed already.
Then use the below command to connect to PostgreSQL database.
psql -h localhost -p 5432 -U postgres
Explanation:
localhost: is the hostname of machine where PostgreSQL is installed.
5432 : is the default PostgreSQL port
postgres : is the username of to connect to DB
Solution for your issue:
FATAL: password authentication failed for user "testuser"
As error message specified, either user not exists on database or the password that you supplied to connect is incorrect. Re-verify your user and password, and try again.
All the best.
I cannot connect to the instance suddenly (I was able to connect a week ago). I tried several ways but none of those worked.
The error messages I got:
Command: mysql --host=[INSTANCE_IP] --user=root --password
Error: Lost connection to MySQL server at 'reading initial communication packet'
Command: gcloud beta sql connect [INSTANCE_ID] --user=root
Error: Access denied for user 'root'#'XXXX'
That error usually indicates that the password is incorrect. Have you or someone else changed the password on the instance?
I have attempted, several times to install Gitlab on my CentOS 6.5 VPS as per the instructions on the Official page and every time, it fails during the "gitlab-ctl reconfigure" stage of installation. I tried googling around and looking in other questions on here without much luck.
Error is as follows:
* execute[create gitlab database user] action run
================================================================================
Error executing action `run` on resource 'execute[create gitlab database user]'
================================================================================
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
STDOUT:
STDERR: psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
This might not be immediately related to GitLab, but to PostgreSQL itself.
See "Chapter 17. Server Setup and Operation", section "Client Connection Problems":
Alternatively, you'll get this when attempting Unix-domain socket communication to a local server:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The last line is useful in verifying that the client is trying to connect to the right place.
If there is in fact no server running there, the kernel error message will typically be either Connection refused or No such file or directory, as illustrated.
(It is important to realize that Connection refused in this context does not mean that the server got your connection request and rejected it. That case will produce a different message, as shown in Section 19.4.)
Other error messages such as Connection timed out might indicate more fundamental problems, like lack of network connectivity.
So make sure the database can start first.
The OP Luke Usher confirms in the comments:
The default PostgreSQL config included in gitlab was set to allocate more memory for shared_buffer than I have available.
This was corrected by adding postgresql['shared_buffers'] = "1024MB" to /etc/gitlab/gitlab.rb.