heroku-pg-extras icon indicating copy to clipboard operation
heroku-pg-extras copied to clipboard

Error on pg:vacuum_stats - "psql: server does not support SSL, but SSL was required"

Open mike-lang opened this issue 12 years ago • 15 comments

I get the error "psql: server does not support SSL, but SSL was required" when I try to run the pg:vacuum_stats command on my database. I'm running postgreSQL 9.2, and I've installed postgreSQL 9.2 on my x64 Windows 7 machine. Other commands, such as pg:bloat and pg:long_running_queries work as desired

mike-lang avatar Jul 24 '13 17:07 mike-lang

Does this problem persist? All of them use the same exec_sql mechanism under the covers. I suspect the problem may be in resolving the host in safe_resolve or something like that--do you have a Postgres server running locally?

msakrejda avatar Jul 24 '13 17:07 msakrejda

That does seem to be related. I stopped the locally running postgresql instance, and I get a new error message: "psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

The full commands I'm using are:

heroku pg:vacuum_stats DATABASE_URL --app [my_app_name]

Which now yields the above error

whereas

heroku pg:bloat DATABASE_URL --app [my_app_name]

returns results as expected

mike-lang avatar Jul 24 '13 18:07 mike-lang

Is the server running on host "localhost" (::1) and accepting localhost doesn't sound right...

catsby avatar Jul 24 '13 18:07 catsby

Nope it doesn't. Any ideas why the heroku toolbelt would try connecting to localhost? And apparently only for the pg:vacuum_stats command? I'm pretty mystified by this one

mike-lang avatar Jul 24 '13 19:07 mike-lang

As @deafbybeheading said, they all go through the same exec_sql method. Are you still running into this?

catsby avatar Aug 20 '13 22:08 catsby

I can verify that I am seeing this exact problem. The vacuum_stats is trying to connect to localhost

shermes641 avatar Mar 10 '14 01:03 shermes641

@shermes641 what environment (OS and anything else that may be relevant) are you running in?

msakrejda avatar Mar 20 '14 03:03 msakrejda

I am getting this issue as well. DL is deprecated, please use Fiddle psql: server does not support SSL, but SSL was required ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       psql failed. exit status 512, output: "" (RuntimeError)
Command:     heroku pg:vacuum-stats
Plugins:     heroku-pg-extras
Version:     heroku/toolbelt/3.43.5 (i386-mingw32) ruby/2.1.7
Error ID:    8ffea0890a8c493a856f751c051659c9

eltmon avatar Jul 08 '16 18:07 eltmon

@eltmon What is the message DL is deprecated, please use Fiddle about? I'm assuming per the error message you're on Windows? What version of Windows?

msakrejda avatar Jul 09 '16 00:07 msakrejda

I am running Mac OS X 10.12.5 and get this error: psql: sslmode value "require" invalid when SSL support is not compiled in

gem uninstall pg and reinstall didn't help. Had the newest versions of postgresql from homebrew installed.

simonneutert avatar May 19 '17 16:05 simonneutert

@simonneutert it sounds like that might be a different error--your client may not support SSL. Can you paste the output of pg_config --libs --configure?

msakrejda avatar May 19 '17 16:05 msakrejda

sure, @uhoh-itsmaciek here it is:

-lpgcommon -lpgport -lz -lreadline -lm  
'--prefix=/Users/simonneutert/.asdf/installs/postgres/9.6.1'

simonneutert avatar May 19 '17 16:05 simonneutert

@simonneutert yeah, so it looks like SSL support was not linked in to your build. Check out mine:

maciek@mothra:~$ pg_config --libs --configure -lpgcommon -lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
'--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' ...

(emphasis added and some configure opts elided)

I'm not sure how to set up a Postgres with SSL from homebrew (I'm on Ubuntu), but I'm pretty sure it's possible. Alternately, there's also Postgres.app...

msakrejda avatar May 19 '17 16:05 msakrejda

@uhoh-itsmaciek this addon works with homebrew version of postgres, I had to clean up what asdf left and reinstall pg gem one last time. What pg_config --libs --configure spits out looks much more similar to yours now.

Thank you so much for your support, have a nice weekend!

simonneutert avatar May 19 '17 16:05 simonneutert

Nice, glad to hear it. Happy to help.

msakrejda avatar May 19 '17 17:05 msakrejda