Opened 4 years ago

Closed 3 years ago

#1486253 closed Bugs (worksforme)

Problem running RC 0.3 stable and SVN trunk on Mac OS X 10.6 Server

Reported by: aweirig Owned by:
Priority: 4 Milestone: 0.4-stable
Component: PHP backend Version: 0.3-stable
Severity: major Keywords: 10.6 Apple PHP
Cc:

Description

Hello,

I'm about to upgrade all of our Mac OS X 10.5 servers to Snow Leopard. One of the servers I need to upgrade is running Roundcube 0.3.

During my tests I found that RC 0.3 is not running on Snow Leopard (with Apple provided Apache, PHP etc configuration).

MySQL on running on a separate Snow Leopard server.

Messages I'm getting in installer:
Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 392 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 2614 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 563 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 566 DSN (write): NOT OK(MDB2 Error: connect failed)

I have installed the MySQL GUI Tools and can connect to the MySQL server and the database from the machine I want to run RC on so there shouldn't be any issue at that level.

Looks like a problem with PEAR and MDB2 to me. When using the SVN Trunk release, the problems from PEAR.php seem to go away but the MySQL connection still doesn't work.

Please let me know if I can help debugging by providing log files.

Problem is getting really urgent because we are to upgrade our servers to 10.6 and thus RC would no longer be available. We are an educational network with about 1000 users (teachers) and they must have acces to webmail because of the "paperless" policy.

Many thanks in advance for your help.

Alex

Change History (15)

comment:1 follow-up: Changed 4 years ago by alec

  • Resolution set to invalid
  • Status changed from new to closed

There must be any error in logs. Connection error is always not Roundcube fault and this is not a support forum.

comment:2 in reply to: ↑ 1 Changed 4 years ago by aweirig

  • Resolution invalid deleted
  • Status changed from closed to reopened

Please excuse me, but are you kidding me? I have posted a message in the forum (http://www.roundcubeforum.net/pending-issues/5569-roundcube-snow-leopard-server.html) before opening a ticket and I was asked in the forum to open a ticket !!!

So I am not asking for support on installing RC. I do have RC 0.3 stable running on a production environment with about 1000 users. My production environment consists of multiple Apple XServes with Mac OS X 10.5.8 having RC and MySQL running on separate servers.

So please take the time and read the entire message (even if it's long) before replying that I'm asking for support because there are some interesting details in this message.

I am pointing you to the fact that there is a bug (or let's call it a problem) with RC when installed on 10.6.1. Now I do understand the difference between RC, MySQL, PHP, Mac OS X and all the other stuff. I do also know that there a log files and that it is sometimes useful reading them (as long as they provide useful information).

I do also understand that you rely on PHP libraries when developing RC and that the MySQL connection is handled by some open source PHP layer, MDB2 being some component of the layer.

Nevertheless, is there a problem with the MySQL connection when RC 0.3 is run on an Apple XServe running Mac OS X 10.6.1 Server edition. All services are the Apple provided services (Apache, MySQL, PHP, DNS, LDAP etc) i.e. no custom installation, no custom compilation. All services are configured using the Apple Server Admin tool.

On my production server I have configured my database DSN in the db.inc.php config file as follows:
$rcmail_configdb_dsnw? = 'mysql://roundcube:roundcube@fqn/roundcubemail';
(where fqn is the fully qualified DSN name of my MySQL server)

When trying to connect RC to the same MySQL server from my 10.6.1 test server, the connection fails. Of course can I connect to the production MySQL database from my 10.6.1 test server when I use the MySQL GUI Admin tools. I have done those tests before even posting the forum.

I have then configured the MySQL service on the same 10.6.1 test server and changed the DSN as follows:
$rcmail_configdb_dsnw? = 'mysql://roundcube:roundcube@fqn/roundcubemail';
where fqn is the fully qualified DNS name of the 10.6.1 server running both Apache with RC and MySQL, the connection still fails.

I then changed the DSN into:
$rcmail_configdb_dsnw? = 'mysql://roundcube:roundcube@localhost/roundcubemail';
now the connection works like a charm

I then changed the DSN into:
$rcmail_configdb_dsnw? = 'mysql://roundcube:roundcube@fqn:3306/roundcubemail';
where fqn still is the fully qualified DNS name of the 10.6.1 server running both Apache with RC and MySQL, now with the standard MySQL port provided the connection suddenly works.

Finally I changed the DSN into:
$rcmail_configdb_dsnw? = 'mysql://roundcube:roundcube@fqn:3306/roundcubemail';
where fqn still is the fully qualified DNS name of my production MySQL server and the connection fails.

I have run the sudo checkip -checkhostname command in Mac OS X to verify my DNS configuration is correct.

So please have a look at the PHP layer. Because when looking at the MDB2.php source code I notice that some changes have been done for RC (cf. comment):
$Id: MDB2.php,v 1.318 2008/03/08 14:18:38 quipo Exp $


I can image that you don't necessarily have an Apple XServe environment at hand to do all the tests, therefore, if you need any help in figuring out what causes the MySQL to fail (in the MDB2 layer), please let me know how I can help you (enable tracing, debugging. I am willing to help you to get this fixed and get RC running on 10.6.1 with the web layer and MySQL database not running on the same server as long as you provide me some input in which direction to look.

Here is the message I found in the log file:
[2009-Oct-30 15:20:41 +0100]: DB Error: _doConnect: [Error message: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known]
[Native code: 2002]
[Native message: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known]

mysql(mysql):roundcube:xxx@netboot002.technolink/roundcubemail in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/include/rcube_mdb2.php on line 100 (GET /roundcube/)

Here is the message from the installer script:
[2009-Oct-30 15:20:41 +0100]: DB Error: _doConnect: [Error message: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known]
[Native code: 2002]
[Native message: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known]

mysql(mysql):roundcube:xxx@netboot002.technolink/roundcubemail in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/include/rcube_mdb2.php on line 100 (GET /roundcube/)

It was not my intention to be impolite in my response but I must admit that I did not appreciate the way you handled this issue and especially the way you reply to your users/customers. No harm done, once RC is running everyone is happy and everything is forgotten.

Kind regards,

Alex

comment:3 Changed 4 years ago by aweirig

In fact this is the message I see in the installer. I noticed I have pasted the same message twice.

DDeprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 392 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 2614 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 563 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 566 DSN (write): NOT OK(MDB2 Error: connect failed)
Make sure that the configured database exists and that the user has write privileges
DSN: mysql://roundcube:roundcube@netboot002.technolink.lu/roundcubemail

comment:4 Changed 4 years ago by alec

So, I still think it's not RC issue, but now we've got info to talk about:

Error message: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known

Could you try with 'mysqli' driver? Also test this code, please:

<?php
require_once 'MDB2.php';

$dsn = 'mysql://user:passwd@host/db';
$options = array(
    'debug' => 2,
);

$mdb2 =& MDB2::factory($dsn, $options);
if (PEAR::isError($mdb2)) {
    die($mdb2->getMessage());
}
$mdb2->disconnect();
?> 

comment:5 Changed 4 years ago by aweirig

Hello,

and you're still right. The problem is not RC but the MySQL PHP backend provided together with RC. But this is the way I appreciate working.

I have created a test.php file with the code you provided and run it on the server. Unfortunately I don't see any result. The result page is empty. What was I supposed to see? I have changed the MDB2.php to "program/lib/MDB2.php"

Using the mysqli driver I can still not connect to my production server (10.5.8), but now the connection to the 10.6.1 MySQL works with the fqn DNS name even without specifying the 3306 port.
The connection using localhost also still works.

comment:6 Changed 4 years ago by addihetja

Are you using an external secondary or tertiary DNS? What happens if you change the connect string to mysql://roundcube:roundcube@ipaddress/roundcubemail

comment:7 Changed 4 years ago by aweirig

Hello,

the server is part of a domain. There is a DNS server present in the domain and in the system preferences the DNS server is specified.

If I replace the hostname with the ip address on the connection string, the connection does not work:

Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 392 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/MDB2.php on line 2614 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 563 Deprecated: Assigning the return value of new by reference is deprecated in /Library/WebServer/Documents?/roundcubemail-0.3-stable-test/program/lib/PEAR.php on line 566 DSN (write): NOT OK(MDB2 Error: connect failed)
Make sure that the configured database exists and that the user has write privileges
DSN: mysql://roundcube:roundcube@10.0.0.210/roundcubemail

10.0.0.210 is the address of the server running both Apache and MySQL

Result from changeip -checkhostname
Primary address = 10.0.0.210

Current HostName? = netboot002.technolink.lu
DNS HostName? = netboot002.technolink.lu

The names match. There is nothing to change.

Also, this DNS lookup problem seems to be limited to MySQL connections. My smtp server and my LDAP server are both specified with their hostname and I can connect correctly to both of them. So I don't think it really is a DNS problem?

comment:8 Changed 4 years ago by addihetja

The reason I asked is because 10.6 behaves differently in regards to DNS than all other versions of *nix. If you set up a primary, seconadary [, tertiary, etc] DNS server in DHCP or on the host it _will_ query the servers in random (?) order, which poses a problem if you use any DNS servers that are located on en external (public) network.

We can safely rule out DNS in this case, provided MDB2 isn't using DNS somewhere.

comment:9 Changed 4 years ago by aweirig

OK. Well actually there is only one DNS server specified in the network preferences, the IP address of the server is specified "manually" so the server should not use any DHCP although our DNS server is also providing DHCP service.

Please let me know if I can provide further help or if you want me to do other tests.

Maybe there is a way to trace MDB2 in detail or maybe you indicate me where you want to add trace statements in MDB2 to see what it is doing.

comment:10 Changed 3 years ago by smultron

I agree with alec; not an RC issue. I've run RC on Mac OS X 10.5 and 10.6 Server without any OS-specific issues (runs the same as on GNU/Linux hosts). Probably safe to close this ticket and shift the discussion elsewhere, I think.

comment:11 Changed 3 years ago by aweirig

  • Severity changed from blocker to trivial
  • Type changed from Bugs to Patches

I can't believe it ?????

There's a detailed description in this ticket that illustrates that RC is not working on a 10.6 Server installation (at least not the way it worked on a 10.5 installation). Fundamentally it isn't a problem with RC code, you're right and I agreed on that many times in the past, but it's a problem with code YOU ship with RC.

Now if you buy a car, guess what, the car maker doesn't build the brakes that are installed on the car, he ships the car with the brakes. So when you hit a tree because the brakes aren't working, your car maker will tell you "not a problem with the car". I bet you'd say "oh yeah of course you're right it's not a problem with car. This one is a wreck, please sell me a new one. Thank you for being so kind Mr. Car Maker".

Sure, I manage to get RC working on a 10.6 server (as described in the ticket) but it required changes in the configuration (I have to specify the standard MySQL port 3306 on the connection string) otherwise RC can't connect to MySQL. Not a big deal, you're right.

Now if you had this port number in your 10.5 config file, you're right, there's no change at all to make. Well I didn't have the port number in my 10.5 config and therefore I lost many days trying to figure out why RC isn't working on my 10.6 installation until I came up with the "stupid" idea to put the port number into the connection string to see "what's going to happen".

I believe it's irrelevant what part of the code the error is in, as long as you ship the code with RC. You can very well decide to remove the code that causes the error and tell your users they have to make sure they get whatever is needed to make RC work, then you can safely say "not a problem with RC" and blame the user for having chosen the bad option to establish the MySQL connection, or you can either look at the code that causes the problem and (try to) fix it, or you document what is needed to make RC work on 10.6 with the code base shipped and you put this in the documentation. At least you can then blame your users if they don't read the documentation.

Simply saying "it's not an RC problem" isn't the answer I expected from people who are able to develop such a great piece of software as RC is. I'm convinced that if you had adopted that approach in the past with many problems you faced, RC wouldn't exist today!!! So let's try and keep going on with the quality work and let's figure out what's wrong.

From my perspective, everything is said. Next move is up to you. I can't force you to look into the problem. You can ignore it, close the ticket and walk away. So will I.

comment:12 Changed 3 years ago by smultron

Well, all the RC installs I've done were to vanilla/unaltered OS X Servers. I didn't do anything special to MySQL port numbers or anything else. Like I said, it's worked w/o issue on the 4-5 OS X Servers I've worked on (10.5 and 10.6). I'm not a RC dev, BTW ;)

comment:13 Changed 3 years ago by alec

I'm still not sure where's the problem. Maybe it's not in the code. Compare mysql.default_port setting in php.ini on old and new server. I could investigate this more only if you provide a shell access to the server. I don't have a Mac box.

comment:14 Changed 3 years ago by trisk

  • Priority changed from 2 to 4
  • Severity changed from trivial to major
  • Type changed from Patches to Bugs

Triaging this bug. Since it seems quite difficult to replicate the environment necessary to reproduce it, I am lowering the priority.

comment:15 Changed 3 years ago by alec

  • Resolution set to worksforme
  • Status changed from reopened to closed

No feedback, not Roundcube issue.

Note: See TracTickets for help on using tickets.