Discussion:
[SOGo] Fail to connect after migration
Dominique
9 years ago
Permalink
Hi,

I have a running SOGo under Ubuntu 12.04 that I want to move to another
server running Ubuntu 14.04.
I installed SOGo into the new server and copied the entire MySQL
database from one server to another - export sql from one side, import
sql on the other server.
The SOGo user is created and allows connection from the cli and can see
all the tables in the SOGo DB
However, from the SOGo interface... nothing. Not able to connect. In the
log, it shows as follow:

2016-03-01 13:33:50.176 sogod[9628] ERROR: could not open MySQL4
connection to database 'sogo': Access denied for user 'sogo'@'localhost'
(using password: YES)
Mar 01 13:33:50 sogod [9628]: [ERROR]
<0x0x7f352f514b58[GCSChannelManager]> could not open channel
<MySQL4Channel[0x0x7f352f2cbcc8] connection=0x(null)> for
mysql://localhost/sogo/sogo_user_profile
Mar 01 13:33:50 sogod [9628]: [WARN]
<0x0x7f352f514b58[GCSChannelManager]> will prevent opening of this
channel 5 seconds after 2016-03-01 13:33:50 +0100

My config file is as follow - The same config file is working properly
in Ubuntu 12.04:

{
SOGoProfileURL =
"mysql://sogo:***@localhost:3306/sogo/sogo_user_profile";
OCSFolderInfoURL =
"mysql://sogo:***@localhost:3306/sogo/sogo_folder_info";
OCSSessionsFolderURL =
"mysql://sogo:***@localhost:3306/sogo/sogo_sessions_folder";

SOGoDraftsFolderName = Drafts;
SOGoSentFolderName = Sent;
SOGoTrashFolderName = Trash;

SOGoIMAPServer = "imap://mail.domain.tld";
SOGoSieveServer = "sieve://mail.domain.tld:4190";

SOGoMailDomain = "domain.tld";
SOGoMailingMechanism = smtp;

SOGoForceIMAPLoginWithEmail = YES;

SOGoUserSources = (
{
canAuthenticate = YES;
displayName = "Shared Addresses";
id = accounts;
isAddressBook = NO;
type = sql;
userPasswordAlgorithm = none;
viewURL = "http://sogo:***@localhost:3306/sogo/sogo_view";
}
);

SOGoVacationEnabled = YES;
SOGoForwardEnabled = YES;
SOGoSieveScriptsEnabled = YES;
SOGoMailAuxiliaryUserAccountsEnabled = YES;


SOGoTimeZone = "Europe/Madrid";
SOGoLanguage = SpanishSpain;

SOGoCalendarDefaultRoles = (
PublicViewer,
ConfidentialDAndTViewer
);

WOLogFile = /var/log/sogo/sogo.log;
WOWorkersCount = 10;

SOGoSpecialFoldersInRoot = YES; /* Deprecated ?*/
SOGoAuthenticationMethod = sql; /* Deprecated ?*/
NGImap4DisableIMAP4Pooling = YES; /* Deprecated ?*/
NGUseUTF8AsURLEncoding = YES; /* Deprecated ?*/

/* Email Reminders */

SOGoEnableEMailAlarms = YES;
SOGoFoldersSendEMailNotifications = YES;
SOGoACLsSendEMailNotifications = YES; /* Deprecated ?*/
SOGoAppointmentSendEMailNotifications = YES;
OCSEMailAlarmsFolderURL =
"mysql://sogo:***@localhost:3306/sogo/sogo_alarms_folder";

}

Any ideas ?

Thanks,

Dominique

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
***@sogo.nu
https://inverse.ca/sogo/lists
Christian Mack
9 years ago
Permalink
...
Did you export your mysql database in UTF-8?
The newer mysql versions create their tables with UTF-8 as default
character set.


Kind regards,
Christian Mack
--
Christian Mack
UniversitÀt Konstanz
Kommunikations-, Informations-, Medienzentrum (KIM)
Abteilung Basisdienste
78457 Konstanz
+49 7531 88-4416
Dominique
9 years ago
Permalink
...
The database was exported to UTF8, but most of the tables where in
latin1. After reloading the original data I converted all tables to
UTF-8. No change. sogo.log still rejects the connection:

2016-03-01 21:08:46.694 sogod[9168] ERROR: could not open MySQL4
connection to database 'sogo': Access denied for user 'sogo'@'localhost'
(using password: YES)
Mar 01 21:08:46 sogod [9168]: [ERROR]
<0x0x7f67af8d9b58[GCSChannelManager]> could not open channel
<MySQL4Channel[0x0x7f67afc190a8] connection=0x(null)> for
http://localhost/sogo/sogo_view

Dominique

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
***@sogo.nu
https://inverse.ca/sogo/lists
Christian Mack
9 years ago
Permalink
...
Did you also migrate the "mysql" database and restarted mysql afterwards?


Kind regards,
Christian Mack
--
Christian Mack
UniversitÀt Konstanz
Kommunikations-, Informations-, Medienzentrum (KIM)
Abteilung Basisdienste
78457 Konstanz
+49 7531 88-4416
Dominique
9 years ago
Permalink
...
No. I did not move the 'mysql' database. The receiving server already
has other programs installed with mysql back-end. I cannot just dump the
existing one and replace it with the old ones. Any specific table
entries that needs to be moved ?

Dominique

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
***@sogo.nu
https://inverse.ca/sogo/lists
Christian Mack
9 years ago
Permalink
...
Then you need to add the user "sogo"@"localhost" with the password from
your sogo.conf and all privileges on the database "sogo".


Kind regards,
Christian Mack
--
Christian Mack
UniversitÀt Konstanz
Kommunikations-, Informations-, Medienzentrum (KIM)
Abteilung Basisdienste
78457 Konstanz
+49 7531 88-4416
Alessandro Briosi
9 years ago
Permalink
Post by Dominique
The database was exported to UTF8, but most of the tables where in
latin1. After reloading the original data I converted all tables to
2016-03-01 21:08:46.694 sogod[9168] ERROR: could not open MySQL4
connection to database 'sogo': Access denied for user
Mar 01 21:08:46 sogod [9168]: [ERROR]
<0x0x7f67af8d9b58[GCSChannelManager]> could not open channel
<MySQL4Channel[0x0x7f67afc190a8] connection=0x(null)> for
http://localhost/sogo/sogo_view
The log is pretty explanatory. It says that the user ***@localhost
cannot access mysql using the specified password.
You need to check the configuration and permissions.

Are you really sure that doing:

mysql -u user -h localhost --password=password database
(replaing user with the database user, password with the user password
and database with the sogo database)
i.e.
mysql -u sogo -h localhost --password=MySecretPassword123 sogo

as specified in your connection string that should be
mysql -u sogo -h localhost --password=sogo sogo

works?
if so check the credentials you have specified in the connection string
corresponds.


Alessandro
--
***@sogo.nu
https://inverse.ca/sogo/lists
Dominique
9 years ago
Permalink
...
I guess you missed the beginning of the original post... I can connect
to mysql through the command line, or phpmyadmin with the sogo
credentials. As far as the credentials in the conf file, it is the
original conf file, that works in the original server... not even
possible to get a mistyped entry there.

Dominique


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
--
***@sogo.nu
https://inverse.ca/sogo/lists
Alessandro Briosi
9 years ago
Permalink
Post by Dominique
I guess you missed the beginning of the original post... I can connect
to mysql through the command line, or phpmyadmin with the sogo
credentials. As far as the credentials in the conf file, it is the
original conf file, that works in the original server... not even
possible to get a mistyped entry there.
No I didn't miss it, though the error is typical for mysql
authentication problem, and I think you should check there.

You sure you have created the sogo user with the right password?

GRANT ALL PRIVILEGES ON sogo.* TO 'sogo'@'localhost' IDENTIFIED BY 'sogo';

Alessandro
--
***@sogo.nu
https://inverse.ca/sogo/lists
Continue reading on narkive:
Loading...