Connect Heroku postgres from localclient - postgresql

I'm trying to connet with
psql -h ec2-23-23-227-54.compute-1.amazonaws.com -U igcmskkpsx igcmskkpsx
but it answer:
psql: no se pudo conectar con el servidor: Connection timed out (0x0000274C/10060)
¿Está el servidor en ejecución en el servidor «ec2-23-23-227-54.compute-1.amazonaws.com» y aceptando
conexiones TCP/IP en el puerto 5432?
Please any suggestion?

Heroku dosen't allow access from an external client while the account is free; I had to use the cleanMysql plugin to access from my local navicat

You may need to specify the port with -P porthere when connecting if its not runnin gon the default port.

Related

Authentication Issues (KRB5\GSS)

We are looking to migrate some systems away from MSSQL. We have our first few environments built and currently using LDAP, which is OK but has a good number of flaws.
I followed this link to setup Kreberos\GSS for the most part: https://info.crunchydata.com/blog/windows-active-directory-postgresql-gssapi-kerberos-authentication
Off the bat I got the below error when trying to connect:
psql: error: SSPI continuation error: The specified target is unknown or unreachable
I believe the SPN is setup properly:
setspn -S POSTGRES/server.domain.local domain\service_account
I suspect something is wrong in the keytab file, as there is an extra "" between the server FQDN and domain:
Keytab name: FILE:/opt/pgsql/server.keytab
KVNO Principal
---- --------------------------------------------------------------------------
5 postgres#server.domain.local\#DOMAIN.LOCAL
Server side error:
2020-12-28 18:37:43.820 EST [64534] user#DOMAIN.LOCAL#postgres FATAL: GSSAPI authentication failed for user "user#DOMAIN.LOCAL"
2020-12-28 18:37:43.820 EST [64534] user#DOMAIN.LOCAL#postgres DETAIL: Connection matched pg_hba.conf line 95: "host all all 0.0.0.0/0 gss"
I'd appreciate any feedback and thank you!

no pg_hba.conf entry for host / Connect call failed / Invalid data directory for cluster 12 main - Postgresql Ubuntu

I'm trying to move my bot to an Ubuntu virtual server from Vultr but it's having a problem connecting to the postgres database. I've tried editing the config from md5 to true, and host to local, etc. But those only give me different errors and also make it stop working on my original machine too. It's working perfectly fine on my Windows machine. Here is the error I'm facing:
asyncpg.exceptions.InvalidAuthorizationSpecificationError: no pg_hba.conf entry for host "[local]", user "postgres", database "xxx", SSL off
So I've tried to change this line:
async def create_db_pool():
bot.pg_con = await asyncpg.create_pool(database='xxx', user='postgres', password='???')
to this:
async def create_db_pool():
bot.pg_con = await asyncpg.create_pool(database='xxx', user='postgres', password='???', ssl=True)
and that gives me this error:
asyncpg.exceptions._base.InterfaceError: `ssl` parameter can only be enabled for TCP addresses, got a UNIX socket path: '/run/postgresql/.s.PGSQL.5432'
So I don't know what else to try. I've been stuck on this for a while. If it's relevant, it connects at the bottom of the bot.py file like this:
bot.loop.run_until_complete(create_db_pool())
Whether ssl is True or not, the database seems to still function on my Windows machine. But I can't get it to work on my Ubuntu virtual server.
If I edit my config to this:
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host replication all 0.0.0.0/0 md5
host replication all ::/0 md5
Then I get a call error like this:
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 5432, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 5432)
This is really driving me crazy. I have no idea what to do. I bought this virtual server to host my bot on but I can't even get it to connect to the database.
When I simply type psql in the terminal, I get this error:
Error: Invalid data directory for cluster 12 main
Postgres is not working as intended in basically any way. I'm using Vultr.com to host the Ubuntu server, if that matters. And connecting with PuTTy.
Your pg_hba.conf has multiple syntax errors. The "localhost" connection type is not allowed at all, and the "local" connection type does not accept an IP address field. The server would refuse to start/restart with the file you show, and if you try to reload a running server it will just keep using the previous settings.
LOG: invalid connection type "localhost"
CONTEXT: line 4 of configuration file "/home/jjanes/pgsql/data/pg_hba.conf"
LOG: invalid authentication method "127.0.0.1/32"
CONTEXT: line 5 of configuration file "/home/jjanes/pgsql/data/pg_hba.conf"
LOG: invalid authentication method "::1/128"
CONTEXT: line 9 of configuration file "/home/jjanes/pgsql/data/pg_hba.conf"
LOG: invalid connection type "localhost"
CONTEXT: line 10 of configuration file "/home/jjanes/pgsql/data/pg_hba.conf"
LOG: invalid authentication method "127.0.0.1/32"
CONTEXT: line 102 of configuration file "/home/jjanes/pgsql/data/pg_hba.conf"
FATAL: could not load pg_hba.conf
LOG: database system is shut down

Authentication problems using phpPgAdmin / PGSQL

I experiencing some problems with PostgreSQL that i need to install to run a SIlverpeas project.
Normally, the postgres part is correctly configured, because i've sent a command to make the user silverpeas owner of the database silverpeas, and i can connect by ssh using "pgsql -U silverpeas silverpeas"
Now, i'm trying to make my phpPgAdmin work. He is on the same server Centos 6.7 than Postgresql (in version 9.5).
When i'm trying to connect, i have a connection failed message, and sometimes, when i'm trying to troubleshoot the problem, i have the "trying to hack your system" message.
When i'm looking for the pgsql log file, after a connection trial, i have this message :
< 2016-03-16 11:32:39.378 CET >LOG: could not connect to Ident server at address "::1", port 113: Connection refused
< 2016-03-16 11:32:39.378 CET >FATAL: Ident authentication failed for user "silverpeas"
< 2016-03-16 11:32:39.378 CET >DETAIL: Connection matched pg_hba.conf line 84: "host all all ::1/128 ident"
The problem is, my /var/lib/pgsql/9.5/data/pg_hba.conf is like this :
# 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
host all all 10.1.1.0/8 md5
And if i looked for the /var/lib/pgsql/9.5/data/postgresql.conf file :
listen_addresses = 'localhost'
And my phpPgAdmin configuration is :
// use 'localhost' for TCP/IP connection on this computer
$conf['servers'][0]['host'] = 'localhost';
// Database port on server (5432 is the PostgreSQL default)
$conf['servers'][0]['port'] = 5432;
// Database SSL mode
// Possible options: disable, allow, prefer, require
// To require SSL on older servers use option: legacy
// To ignore the SSL mode, use option: unspecified
$conf['servers'][0]['sslmode'] = 'allow';
// Change the default database only if you cannot connect to template1.
// For a PostgreSQL 8.1+ server, you can set this to 'postgres'.
$conf['servers'][0]['defaultdb'] = 'silverpeas';
Suggestions ?
The pg_hba.conf file doesn't match the log file.
You use md5 method (good) but the log file talks about ident method.
Have you change and reload your postgresql conf before ?

Error during the execution of a Send Mail Task In SSIS

I am trying to configure a Send Mail Task in SSIS. So far I have done this:
First I look for the smtp server in Outlook:
Then in SSIS I set the "Send Mail Task" with this value in the conection field.
But when I try to execute the task to send the message, I'm getting the error:
[Send Mail Task] Error: An error occurred with the following error message:
"Error al enviar correo. System.Net.WebException: No es posible conectar con el
servidor remoto System.Net.Sockets.SocketException: Se produjo un error
durante el intento de conexión ya que la parte conectada no respondió
adecuadamente tras un periodo de tiempo, o bien se produjo un error en la
conexión establecida ya que el host conectado no ha podido responder
10.158.122.33:25".
Something like "... It is not possible to connect with the remote server
System.Net.Sockets.SocketException:...or maybe there is an
error in the connection because the connected host could not answer "
So, what can be wrong?
Regards.

FreeRadius - Failed binding to authentication address

When I run the following command, I can get successfull result.
root#ubuntu:/home/can# radtest user password 127.0.0.1 1812 testing123
Sending Access-Request of id 78 to 127.0.0.1 port 1812
User-Name = "user"
User-Password = "password"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=78, length=20
However When I run the "freeradius -X" , I get error message as following :
.....
Failed binding to authentication address * port 1812: Address already in use
/etc/freeradius/radiusd.conf[250]: Error binding to port for 0.0.0.0 port 1812
Please Help Me
Thank you for your efforts.
Can
radiusd is already running. sudo service freeradius stop will stop it, and allow freeradius -X to bind to the address/port that was previously used by the RADIUS daemon.
Run 'service freeradius restart' and 'service freeradius stop' commands
Then run the command,'freeradius -X'
you will not face binding issue anymore.
Even having finished the service, there were pending zombie process.
Searching for a zumbi process I´ve found one:
[root#localhost sites-enabled]# ps aux | grep radi
radiusd 25042 0.0 0.7 186360 14980 ? Ssl Fev17 0:00 /usr/sbin/radiusd -d /etc/raddb
[root#localhost sites-enabled]# kill -9 25042
Service was start sucessfully after this.
Basically the port freeradius is looking to use is already in use by another background running instance of freeradius. Ending the first instance of freeradius will allow you to use that same port for the newly run instance.