Feature #439

current netdot svn doesn't work with Pg db

Added by begemot - over 5 years ago. Updated almost 5 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Carlos Vicente % Done:

0%

Category:-
Target version:0.8
Resolution:worksforme

Description

I can login in webinterface, but if any other pages dont' work with:

error: DBI connect('database=netdot;host=localhost;port=','netdot_user',...) failed: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port user='netdot_user'? at /usr/share/perl5/Ima/DBI.pm line 328
context:
...
40: return $ if $;
41: goto &shortmess_real;
42: }
43:
44: sub croak { die shortmess @_ }
45: sub confess { die longmess @_ }
46: sub carp { warn shortmess @_ }
47: sub cluck { warn longmess @_ }
48:
...
code stack: /usr/share/perl/5.10/Carp.pm:44
/usr/lib/perl5/DBI.pm:651
/usr/lib/perl5/DBI.pm:706
/usr/lib/perl5/DBI.pm:548
/usr/share/perl5/Ima/DBI.pm:328
/usr/share/perl5/Ima/DBI.pm:393
/usr/share/perl5/Class/DBI.pm:1135
/usr/share/perl5/Class/DBI.pm:1078
/usr/local/netdot/htdocs/reports/device_inventory.html:23
/usr/local/netdot/htdocs/reports/autohandler:88
/usr/share/perl5/HTML/Mason/Request.pm:930
/usr/local/netdot/htdocs/masondata/obj/1249693838/reports/autohandler.obj:21
/usr/local/netdot/htdocs/autohandler:37

tshark -i lo shows connection attempt to port 0
If I change port=_ to port='5432' - webinterface work

History

#1 Updated by Carlos Vicente almost 5 years ago

  • Status changed from New to Closed
  • Resolution set to worksforme

This actually depends on Postgres' configuration. If DB_PORT is not set, Perl DBI will probably try a Unix socket connection, which might or might not work with the default postgres settings.

Specifying port 5432 will force a TCP connection. The details about Postgres' client authentication are in the file pg_hba.conf. See http://www.postgresql.org/docs/8.3/interactive/client-authentication.html for a detailed explanation.

Also available in: Atom PDF