ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Intermittent SSL handshake fails

Added by Björn Blissing at 2012-08-16 05:17 pm

Since some weeks I have started to get intermittent SSL handshake fails when connecting to the SVN repositories. For example when I browse the SVN repository of a project from a client I can get some directories without problems, others just report "Secure connection truncated".

I have tried to analyse the logs on the server and from the looks of it seems to be an issue with Ruby and MySQL. Every time I get a handshake failure the following gets written in the log from Apache2:

[Thu Aug 16 16:05:16 2012] [error] [client 62.119.61.89] Usage: DynaLoader::dl_load_file(filename, flags=0) at /usr/lib/perl5/DBD/mysql.pm line 142.\n
[Thu Aug 16 16:05:20 2012] [error] [client 62.119.61.89] DBD::mysql::db STORE failed: handle 2 is owned by thread b99e2328 not current thread b97d0868 (handles can't be shared between threads and your driver may need a CLONE method added) at /usr/lib/perl5/DBD/mysql.pm line 142.\n
[Thu Aug 16 16:05:24 2012] [error] [client 62.119.61.89] Usage: DynaLoader::dl_load_file(filename, flags=0) at /usr/lib/perl5/DBD/mysql.pm line 142.\n
[Thu Aug 16 16:05:29 2012] [error] [client 62.119.61.89] DBD::mysql::db STORE failed: handle 2 is owned by thread b97d0868 not current thread b99e2328 (handles can't be shared between threads and your driver may need a CLONE method added) at /usr/lib/perl5/DBD/mysql.pm line 142.\n
[Thu Aug 16 16:05:32 2012] [error] [client 62.119.61.89] Usage: DBD::mysql::db::_login(dbh, dbname, username, password, attribs=Nullsv) at /usr/lib/perl5/Apache/Redmine.pm line 510.\n

Which seems to be some form of threading issue. Have someone else got these issues? How did you resolve it?

My server is running:
Debian Squeeze
chiliproject 3.3.0
ruby 1.8.7.302
rubygems 1.3.7
mysql 5.1.63
libmysql-ruby 2.8.2
apache2 2.2.16
apache2-mpm-worker 2.2.16
libapache2-mod-passenger 2.2.11
subversion 1.6.12
libapache2-svn 1.6.12


Replies (4)

RE: Intermittent SSL handshake fails - Added by Björn Blissing at 2012-08-17 11:02 am

Further investigations have shown that it is only SVN access from TortoiseSVN which seems to cause the errors. (I have tried updating to the latest TortoiseSVN 1.7.8, Build 23174, but this did not help).

Then I found the following thread on the Redmine boards:
http://www.redmine.org/boards/2/topics/20183

I tried this and switching from switching from apache2-mpm-worker to apache2-mpm-prefork seems to be a valid workaround for the problem.

RE: Intermittent SSL handshake fails - Added by Holger Just at 2012-08-17 11:53 am

You are right, the correct mitigation is to use the mpm-prefork. The cause of the problem is that the Perl DBD modules which are used to access the ChiliProject database for authentication and authorization in Redmine.pm are not thread-safe. This is a restriction of these Perl modules.

What you observe when using these modules in a threaded context is random SEGFAULTs or mixed up data structures. The only solution right now is to get rid of threads inside of Apache, hence the usage of the mpm-prefork. I'm currently working on a replacement for the current Redmine.pm module (creatively called ChiliProject.pm) which will query the ChiliProject instance by HTTP instead of reading the database directly, thus heavily simplifying the module. This new module will be part of ChiliProject 3.4 or 3.5.

RE: Intermittent SSL handshake fails - Added by Björn Blissing at 2012-08-23 01:36 pm

Do there exist a corresponding issue for this that I could "watch"?

RE: Intermittent SSL handshake fails - Added by Holger Just at 2012-08-23 01:48 pm

That would be #177

The current work-in-progress (and still not usable) code is in https://github.com/meineerde/chiliproject/tree/issues/master/106-redmine.pm

(1-4/4)