[request-tracker-maintainers] Bug#595054: request-tracker3.8: Race condition between RT3.8+apache2 and MySQL when booting by insserv

Konstantin Khomoutov flatworm at users.sourceforge.net
Tue Aug 31 18:17:34 UTC 2010


Package: request-tracker3.8
Version: 3.8.8-3
Severity: important

I'm using RT 3.8 with apache2 via mod_perl, MySQL is used as a database
backend. When the server is booted using insserv, apache2 starts long
before MySQL and for some reason some bit of RT tries to access the
MySQL server, times out and fails; this prevents apache2 from starting.

Demonstration (copied from the console window):

aquinas:~# telinit 1
...
aquinas:~# : >/var/log/apache2/error.log
aquinas:~# cat /var/log/apache2/error.log
aquinas:~# telinit 3
INIT: Switching to runlevel: 3
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Using makefile-style concurrent boot in runlevel 3.
Starting enhanced syslogd: rsyslogd.
Starting Samba daemons: nmbd smbd.
Starting ACPI services....
Starting jabber server: ejabberd..
Starting Tomcat servlet engine: tomcat6.
Starting web server: apache2Action 'start' failed.
The Apache error log may have more information.
 failed!
Starting Bacula Storage daemon...:.
Starting Bacula File daemon...:.
Starting Bacula Director...:.
Starting /usr/sbin/chronyd...
Starting jabberd-jit: jabberd-jit.
Starting mrim: mirm.
Starting mouse interface server: gpm.
Starting Network UPS Tools: upsmon.
Starting nagios-nrpe: nagios-nrpe.
Starting multipath daemon: multipathd.
Starting OpenBSD Secure Shell server: sshd.
Starting periodic command scheduler: cron.
Starting internet superserver: inetd.
Starting the Winbind daemon: winbind.
chronyd is running and online.
Starting ftp server: proftpd.
Starting MySQL database server: mysqld . . ..
Checking for corrupt, not cleanly closed and upgrade needing tables..
startpar: service(s) returned failure: apache2 ... failed!
Running scripts in rc3.d/ took 17 seconds.

Now the contents of /var/log/apache2/error.log just after its
unsuccessful attempt to start:

DBI connect('dbname=rtdb;host=localhost','rtuser',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 106
[Tue Aug 31 21:40:18 2010] [error] Connect Failed Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\n at /usr/share/request-tracker3.8/lib/RT.pm line 217\nCompilation failed in require at (eval 2) line 1.\n
[Tue Aug 31 21:40:18 2010] [error] Can't load Perl file: /usr/share/request-tracker3.8/libexec/webmux.pl for server rt-admin.domain007.com:0, exiting...

If I then start apache2 by hand, it starts OK (it only complains about
the RTAddressRegexp config variable being unset which is harmless I suppose).

The RT instance is served using two vhosts (one for SelfService with
auto-logging enabled and another one for admins); the config for these
vhosts is:

<VirtualHost *:80>
	ServerAdmin webmaster at domain007.com

	ServerName  rt.domain007.com
	ServerAlias rt

	Include "/etc/request-tracker3.8/apache2-modperl2.conf"

	DocumentRoot /usr/share/request-tracker3.8
	<Location />
		Order allow,deny
		allow from all
		# mod_auth_winbind stuff here
	</Location>

	# This must not be protected,
	# see http://wiki.bestpractical.com/view/WebExternalAuth
	<LocationMatch "/NoAuth">
		Satisfy Any
		Allow from all
	</LocationMatch>
</VirtualHost>

# Special host for admins
<VirtualHost *:80>
	ServerAdmin webmaster at domain007.com

	ServerName  rt-admin.domain007.com
	ServerAlias rt-admin

	Include "/etc/request-tracker3.8/apache2-modperl2.conf"

	DocumentRoot /usr/share/request-tracker3.8
</VirtualHost>
# vim:syntax=apache


I suspect the included "/etc/request-tracker3.8/apache2-modperl2.conf"
file might be a culprit as otherwise I can't imagine what other code
could call RT internals and make it access the DB backend.


-- Package-specific info:
Changed files:
  usr/share/request-tracker3.8/html/SelfService/Create.html

There are locally modified files in /usr/local/share/request-tracker3.8/,
 these may (or may not) be the source of the problem.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages request-tracker3.8 depends on:
ii  dbconfig-common             1.8.46       common framework for packaging dat
ii  debconf [debconf-2.0]       1.5.35       Debian configuration management sy
ii  libapache-session-perl      1.87-1       Perl modules for keeping persisten
ii  libcache-simple-timedexpiry 0.27-2       Perl module to cache and expire ke
ii  libcalendar-simple-perl     1.21-1       module for producing simple calend
ii  libcgi-fast-perl            5.10.1-14    CGI::Fast Perl module
ii  libcgi-pm-perl              3.49-1       module for Common Gateway Interfac
ii  libclass-returnvalue-perl   0.55-1       A return-value object that lets yo
ii  libcss-squish-perl          0.09-1       module to compact many CSS files i
ii  libdata-ical-perl           0.16+dfsg-1  Perl module for manipulating iCale
ii  libdbi-perl                 1.612-1      Perl Database Interface (DBI)
ii  libdbix-searchbuilder-perl  1.56-1       Perl implementation of a simple OR
ii  libdevel-stacktrace-perl    1.2100-1     Perl module containing stack trace
ii  libemail-address-perl       1.889-2      RFC 2822 Address Parsing and Creat
ii  libfcgi-procmanager-perl    0.18-2       Functions for managing FastCGI app
ii  libfile-sharedir-perl       1.00-0.1     Locate per-dist and per-module sha
ii  libgd-graph-perl            1.44-3       Graph Plotting Module for Perl 5
ii  libgd-text-perl             0.86-5       Text utilities for use with GD
ii  libgnupg-interface-perl     0.42-3       Perl interface to GnuPG
ii  libgraphviz-perl            2.04-1       Perl interface to the GraphViz gra
ii  libhtml-mason-perl          1:1.44-1     HTML::Mason Perl module
ii  libhtml-parser-perl         3.66-1       collection of modules that parse H
ii  libhtml-rewriteattributes-p 0.03-1       concise attribute rewriting
ii  libhtml-scrubber-perl       0.08-4       Perl extension for scrubbing/sanit
ii  libipc-run-safehandles-perl 0.02-1       Use IPC::Run and IPC::Run3 safely
ii  libjs-prototype             1.6.1-1      JavaScript Framework for dynamic w
ii  libjs-scriptaculous         1.8.3-1      JavaScript library for dynamic web
ii  liblocale-maketext-fuzzy-pe 0.10-1       Maketext from already interpolated
ii  liblocale-maketext-lexicon- 0.82-1       lexicon-handling backends for Loca
ii  liblog-dispatch-perl        2.22-1       Dispatches messages to multiple Lo
ii  libmailtools-perl           2.06-1       Manipulate email in perl programs
ii  libmime-tools-perl [libmime 5.428-1      Perl5 modules for MIME-compliant m
ii  libmime-types-perl          1.30-1       Perl extension for determining MIM
ii  libmodule-versions-report-p 1.06-1       Report versions of all modules in 
ii  libperlio-eol-perl          0.14-1+b1    PerlIO layer for normalizing line 
ii  libregexp-common-perl       2010010201-1 module with common regular express
ii  libtext-autoformat-perl     1.669002-1   module for automatic text wrapping
ii  libtext-quoted-perl         2.06-1       Perl module to extract the structu
ii  libtext-template-perl       1.45-1       Text::Template perl module
ii  libtext-wikiformat-perl     0.78-1       translates Wiki formatted text int
ii  libtext-wrapper-perl        1.02-1       Simple word wrapping routine
ii  libtime-modules-perl        2006.0814-2  Various Perl modules for time/date
ii  libtimedate-perl            1.2000-1     collection of modules to manipulat
ii  libtree-simple-perl         1.18-1       A simple tree object
ii  libuniversal-require-perl   0.13-1       Load modules from a variable
ii  libxml-rss-perl             1.48-1       Perl module for managing RSS (RDF 
ii  libxml-simple-perl          2.18-3       Perl module for reading and writin
ii  perl                        5.10.1-14    Larry Wall's Practical Extraction 
ii  perl-modules [libcgi-pm-per 5.10.1-14    Core Perl modules
ii  rsyslog [system-log-daemon] 4.6.4-1      enhanced multi-threaded syslogd
ii  rt3.8-apache2               3.8.8-3      Apache 2 specific files for reques
ii  rt3.8-clients               3.8.8-3      mail gateway and command-line inte
ii  rt3.8-db-mysql              3.8.8-3      MySQL database backend for request
ii  ssmtp [mail-transport-agent 2.64-4       extremely simple MTA to get mail o
ii  ucf                         3.0025       Update Configuration File: preserv

Versions of packages request-tracker3.8 recommends:
ii  libdatetime-locale-perl       1:0.45-1   Perl extension providing localizat
ii  libdatetime-perl              2:0.6100-2 module for manipulating dates, tim
pn  speedy-cgi-perl               <none>     (no description available)

Versions of packages request-tracker3.8 suggests:
pn  rt3.8-rtfm                    <none>     (no description available)

-- debconf information:
* request-tracker3.8/organization: domain007.com
  request-tracker3.8/pgsql/authmethod-user: password
  request-tracker3.8/install-error: abort
  request-tracker3.8/dbconfig-remove:
* request-tracker3.8/mysql/method: unix socket
  request-tracker3.8/dbconfig-reinstall: false
* request-tracker3.8/db/dbname: rtdb
  request-tracker3.8/missing-db-package-error: abort
* request-tracker3.8/dbconfig-install: true
  request-tracker3.8/remove-error: abort
  request-tracker3.8/warn-sqlite-file:
  request-tracker3.8/remote/newhost:
  request-tracker3.8/pgsql/admin-user: postgres
* request-tracker3.8/db/app-user: rtuser
  request-tracker3.8/remote/host:
* request-tracker3.8/rtname: RT007
  request-tracker3.8/internal/reconfiguring: false
  request-tracker3.8/passwords-do-not-match:
* request-tracker3.8/database-type: mysql
  request-tracker3.8/pgsql/no-empty-passwords:
* request-tracker3.8/handle-siteconfig-permissions: true
* request-tracker3.8/correspondaddress: rt at domain007.com
* request-tracker3.8/install-cronjobs: true
  request-tracker3.8/upgrade-error: abort
* request-tracker3.8/mysql/admin-user: root
  request-tracker3.8/remote/port:
  request-tracker3.8/pgsql/changeconf: false
  request-tracker3.8/dbconfig-upgrade: true
  request-tracker3.8/pgsql/method: unix socket
  request-tracker3.8/purge: false
  request-tracker3.8/pgsql/authmethod-admin: ident
  request-tracker3.8/pgsql/manualconf:
* request-tracker3.8/webpath:
  request-tracker3.8/upgrade-backup: true
  request-tracker3.8/db/basepath:
  request-tracker3.8/internal/skip-preseed: true
* request-tracker3.8/webbaseurl: http://rt.domain007.com
* request-tracker3.8/commentaddress: rt-comment at domain007.com





More information about the pkg-request-tracker-maintainers mailing list