From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 12 16:40:05 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE19D106567A for ; Mon, 12 Jan 2009 16:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AAAD88FC20 for ; Mon, 12 Jan 2009 16:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CGe5Be046190 for ; Mon, 12 Jan 2009 16:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0CGe5qE046189; Mon, 12 Jan 2009 16:40:05 GMT (envelope-from gnats) Resent-Date: Mon, 12 Jan 2009 16:40:05 GMT Resent-Message-Id: <200901121640.n0CGe5qE046189@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Petr Rehor Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C86031065689 for ; Mon, 12 Jan 2009 16:39:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id B73428FC12 for ; Mon, 12 Jan 2009 16:39:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CGdJ0e071425 for ; Mon, 12 Jan 2009 16:39:19 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n0CGdJQ8071424; Mon, 12 Jan 2009 16:39:19 GMT (envelope-from nobody) Message-Id: <200901121639.n0CGdJQ8071424@www.freebsd.org> Date: Mon, 12 Jan 2009 16:39:19 GMT From: Petr Rehor To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/130425: www/rt38 - Database couldn't be initialized X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:40:06 -0000 >Number: 130425 >Category: misc >Synopsis: www/rt38 - Database couldn't be initialized >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 12 16:40:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Petr Rehor >Release: FreeBSD 7.0-RELEASE-p6 i386 >Organization: >Environment: FreeBSD scbu03.cb.i.cz 7.0-RELEASE-p6 FreeBSD 7.0-RELEASE-p6 #0: Mon Nov 24 06:43:33 UTC 2008 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 >Description: When I tried to initialize database I got: reho@scbu03.cb.i.cz:/root# rt-setup-database --dba rt_user --prompt-for-dba-password --action init In order to create or update your RT database, this script needs to connect to your mysql instance on localhost as rt_user Please specify that user's database password below. If the user has no database password, just press return. Password: Working with: Type: mysql Host: localhost Name: rt3 User: rt_user DBA: rt_user Now creating a mysql database rt3 for RT. Done. Now populating database schema. DBD::mysql::st execute failed: Table 'Attachments' already exists at /usr/local/lib/perl5/site_perl/5.8.8/RT/Handle.pm line 470. >How-To-Repeat: Run on fresh www/rt38 installation (WARNING - destroy the database): rt-setup-database --dba rt_user --prompt-for-dba-password --action drop rt-setup-database --dba rt_user --prompt-for-dba-password --action init >Fix: I found the reason - it's happen because $EtcBase and $LocalEtcBase in RT.pm are the same and RT::Handle->InitSchema() run schema.mysql twice. The variables are set from config.layout when RT is build. In FreeBSD section it contains (after patch-config.layout): sysconfdir: ${prefix}/etc+ customdir: ${prefix} custometcdir: ${customdir}/etc+ customhtmldir: ${customdir}/www+ customlexdir: ${sharedir}/po customlibdir: /usr/local/lib/perl5/site_perl/5.8.8 I think this setings in config.layout will be more useful for customization and sove this problem: sysconfdir: ${prefix}/etc+ customdir: ${customdir}/www+ custometcdir: ${customdir}/etc customhtmldir: ${customdir}/html customlexdir: ${customdir}/po customlibdir: ${customdir}/lib >Release-Note: >Audit-Trail: >Unformatted: