View Issue Details

IDProjectCategoryView StatusLast Update
0003222SOGoBackend Generalpublic2015-06-01 11:49
Reportervendafo Assigned To 
PriorityhighSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Platform[Server] LinuxOSDebianOS Version8 (Jessie)
Product Version2.2.9 
Summary0003222: Unable to connect to PostgreSQL when specifying link with 127.0.0.1
Description

On a fresh Debian 8 installation with dual IPv4 and IPv6, using links such as below to connect to the PostgreSQL database leads to "could not open channel" and "could not open storage channel" errors.

Piece of the sogo.conf:

/ Database configuration (mysql:// or postgresql://) /
SOGoProfileURL = "postgresql://sogo:my_password@127.0.0.1:5432/sogo/sogo_user_profile";
OCSFolderInfoURL = "postgresql://sogo:my_password@127.0.0.1:5432/sogo/sogo_folder_info";
OCSSessionsFolderURL = "postgresql://sogo:my_password@127.0.0.1:5432/sogo/sogo_sessions_folder";
OCSEMailAlarmsFolderURL = "postgresql://sogo:my_password@127.0.0.1:5432/sogo/sogo_alarms_folder";

Observed behavior: When accessing the calendar, an empty calendar shows up. The list of calendars is displayed, but not the appointments. Here are a few lines that appear in /var/log/sogo/sogo.log (see attachment for a full log):

May 30 21:30:04 sogod [6409]: [ERROR] <0x0x7f2b20c6d750[GCSChannelManager]> could not open channel <0x0x7f2b211e1b20[PostgreSQL72Channel]: not-connected> for postgresql://localhost/sogo/sogoanthony001605ac29f
May 30 21:30:04 sogod [6409]: [WARN] <0x0x7f2b20c6d750[GCSChannelManager]> will prevent opening of this channel 5 seconds after 2015-05-30 21:30:04 +0000
May 30 21:30:04 sogod [6409]: [ERROR] <0x0x7f2b211c6bd0[GCSFolder]> could not open storage channel!
May 30 21:30:04 sogod [6409]: [ERROR] <0x0x7f2b21201950[GCSFolder]> could not open storage channel!
May 30 21:30:04 sogod [6409]: [ERROR] <0x0x7f2b212120f0[GCSFolder]> could not open storage channel!

Additional Information

My PostgreSQL configuration is such that I can access it with both with IPv4 and IPv6. Interestingly, I could solve the problem by replacing "127.0.0.1" with "localhost" in the postgresql links in sogo.conf.

I am not sure if this is really a sogo issue. However, even if it is not, it may be relevant to use "localhost" instead of "127.0.0.1" in the default sogo.conf file from the Debian package.

TagsNo tags attached.

Activities

vendafo

vendafo

2015-05-31 19:56

reporter  

sogo.log (15,055 bytes)
Christian Mack

Christian Mack

2015-06-01 09:23

developer   ~0008547

Check /etc/hosts
I assume you have an IPv6 localhost but no IPv4 one.

vendafo

vendafo

2015-06-01 09:36

reporter   ~0008548

No, here is my /etc/hosts:

127.0.0.1 localhost
127.0.0.1 my_host.my_domain.com my_host
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
my_ipv4 my_host.my_domain.com my_host

One weird thing I have noticed is that the user authentication (that uses the same PostgreSQL DB) still works with this in sogo.conf:
SOGoUserSources =
(
{
type = sql;
id = directory;
viewURL = "postgresql://sogo:my_password@127.0.0.1:5432/sogo/sogo_users";
canAuthenticate = YES;
isAddressBook = YES;
userPasswordAlgorithm = sha;
}
);

So, for SOGoUserSources, 127.0.0.1 works!

Christian Mack

Christian Mack

2015-06-01 11:10

developer   ~0008549

Hmmm, are you sure you have two lines with 127.0.0.1 in your /etc/hosts?
This would be invalid.

vendafo

vendafo

2015-06-01 11:49

reporter   ~0008550

I have just tried with the two lines merged:

127.0.0.1 localhost my_host.my_domain.com my_host

It still behaves exactly as described in the bug description.

Issue History

Date Modified Username Field Change
2015-05-31 19:56 vendafo New Issue
2015-05-31 19:56 vendafo File Added: sogo.log
2015-06-01 09:23 Christian Mack Note Added: 0008547
2015-06-01 09:36 vendafo Note Added: 0008548
2015-06-01 11:10 Christian Mack Note Added: 0008549
2015-06-01 11:49 vendafo Note Added: 0008550