Postgresql error in connecting to database - invalid response to ssl negotiation

Hello,

I have a rails application with PostgreSQL as the database. The
application works fine on my development PC.

I deployed this application to a server PC (different one), where I am
getting the following error -

PGError in StudentsController#home

received invalid response to SSL negotiation: -

The error trace is as below -

C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/connection_adapters/
postgresql_adapter.rb:713:in initialize' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activerecord-2.0.2/lib/active_record/connection_adapters/ postgresql_adapter.rb:713:inconnect’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/connection_adapters/
postgresql_adapter.rb:713:in connect' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activerecord-2.0.2/lib/active_record/connection_adapters/ postgresql_adapter.rb:237:ininitialize’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/connection_adapters/
postgresql_adapter.rb:23:in new' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activerecord-2.0.2/lib/active_record/connection_adapters/ postgresql_adapter.rb:23:inpostgresql_connection’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/connection_adapters/abstract/
connection_specification.rb:291:in send' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activerecord-2.0.2/lib/active_record/connection_adapters/abstract/ connection_specification.rb:291:inconnection=’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/connection_adapters/abstract/
connection_specification.rb:259:in retrieve_connection' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activerecord-2.0.2/lib/active_record/connection_adapters/abstract/ connection_specification.rb:78:inconnection’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activerecord-2.0.2/lib/active_record/query_cache.rb:8:in cache' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ actionpack-2.0.2/lib/action_controller/caching.rb:677:inperform_action’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
actionpack-2.0.2/lib/action_controller/base.rb:524:in send' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ actionpack-2.0.2/lib/action_controller/base.rb:524:inprocess_without_filters’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
actionpack-2.0.2/lib/action_controller/filters.rb:685:in
process_without_session_management_support' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ actionpack-2.0.2/lib/action_controller/session_management.rb:123:inprocess’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
actionpack-2.0.2/lib/action_controller/base.rb:388:in process' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:inhandle_request’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in dispatch' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:indispatch_cgi’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in dispatch' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:76:inprocess’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:74:in synchronize' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:74:inprocess’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:159:in process_client' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:ineach’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:in process_client' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:inrun’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in initialize' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:innew’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in run' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:ininitialize’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in new' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:inrun’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:282:in run' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:ineach’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:in run' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:128:inrun’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
mongrel-1.1.2-x86-mswin32/lib/mongrel/command.rb:212:in run' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:281 C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activesupport-2.0.2/lib/active_support/dependencies.rb:489:inload’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activesupport-2.0.2/lib/active_support/dependencies.rb:489:in load' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activesupport-2.0.2/lib/active_support/dependencies.rb:342:innew_constants_in’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activesupport-2.0.2/lib/active_support/dependencies.rb:489:in load' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ rails-2.0.2/lib/commands/servers/mongrel.rb:64 C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubygems/ custom_require.rb:27:ingem_original_require’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubygems/
custom_require.rb:27:in require' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/ activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubyscript2exe.gems/gems/
rails-2.0.2/lib/commands/server.rb:39
C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubygems/
custom_require.rb:27:in gem_original_require' C:/DOCUME~1/ADMINI~1/eee/eee.exide.exe.3/lib/rubygems/ custom_require.rb:27:inrequire’
script/server:3
init.rb:7:in load' init.rb:7 C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:608:inload’
C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:608
C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:559:in
newlocation' C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:487:innewlocation’
C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:454:in
newlocation' C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:487:innewlocation’
C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:559:in
newlocation' C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\app\exide.rb:603 C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\bootstrap.rb:77:inload’
C:\DOCUME~1\ADMINI~1\eee\eee.exide.exe.3\bootstrap.rb:77

I would be very grateful, if somebody can provide any hint on why this
error is occurring.

love-n-peace,
@shaan
‘Aal izz well’ :slight_smile:

Why SSL? DB and application are on different machines?

Hi,

I do not know much about SSL’s role here. Also, the application and
the DB are on the same machine, however the machine is on a LAN.

I was running Mongrel on localhost and DB also is on localhost.

Please suggest me some string or kindly let me know in case you need
some more information.

love-n-peace,
@shaan
‘Aal izz well’ :slight_smile:

Hi,

Some more information on ssl from the pgAdmin client. The ssl option
is ‘off’ in the server configuration.

My rails application has been connecting right to the database (both
on the same computer) at my development environment.

But, at my deployment environment (different computer), the computer
is over a LAN and connected to the internet; I don’t know if it
relates to the problem at all.
I just checked the ssl option, which is ‘off’ by default.

@shaan

error occurs while opening the server postgressql 8.0
“received invalid response to SSL negotiation”

I tried to convert shape file to postgresql using following command
shpe2pgsql -c -D -s 4269 -i -I d:\temp\ublock.shp public.block >
block.sql

Then I throw

psql -d testdb -f block.sql
when i throw psql command
it gives error invalid response to ssl negotiation.
Can u pl help me to solve this problem.

Prior to convert I have creted a empty table name block in public.schema
then i tried to populated ublock.shp to block table.
i faild to do this. Please some body help me in this context.