Closed
Bug 356146
Opened 19 years ago
Closed 19 years ago
tr_install.pl fails on PostgreSQL
Categories
(Testopia :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jonaliz55, Assigned: gregaryh)
References
Details
Attachments
(3 files, 1 obsolete file)
|
2.21 KB,
patch
|
gregaryh
:
review+
mkanat
:
review+
|
Details | Diff | Splinter Review |
|
399 bytes,
patch
|
gregaryh
:
review+
|
Details | Diff | Splinter Review |
|
1.09 KB,
patch
|
gregaryh
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
I tried to install Testopia ver 1.1 on bugzilla ver 2.22 using postgreSQL on a CentOS 4.3 host and received the errors described in the Actual Results section below. Please advise.
Reproducible: Always
Steps to Reproduce:
1.Copy testopia 1.1 tar file to bugzilla installation dir and extract
2.Run perl tr_install
Actual Results:
perl tr_install.pl
Now installing Testopia ...
Patching Bugzilla's files ...
No patch file especified, trying to determine the right one to use ...
Bugzilla version 2.22 detected.
Patch file chosen: patch-2.22
Now patching ...
Done.
Recovering original permissions ...
Done.
Congratulations, patch worked flawless!
A backup copy of the modified files has been saved with the .orig sufix.
Setting file permissions ...
Done.
Checking Testopia database ...
Initializing the new Schema storage...
Adding new table attach_data ...
[Sun Oct 8 09:53:30 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "attach_data_pkey" for table "attach_data"
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: relation "attach_data" already exists [for Statement "CREATE TABLE attach_data (
id integer NOT NULL PRIMARY KEY,
thedata bytea NOT NULL
)"] at Bugzilla/DB.pm line 513
Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 'attach_data') called at Bugzilla/DB.pm line 488
Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 'attach_data') called at Bugzilla/DB.pm line 335
Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0xa0a3df8)') called at Bugzilla/DB/Pg.pm line 220
Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0xa0a3df8)') called at tr_install.pl line 298
main::UpdateDB('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 1) called at tr_install.pl line 79
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Sun Oct 8 09:53:31 2006] tr_install.pl: DBD::Pg::db do failed: ERROR: relation "attach_data" already exists [for Statement "CREATE TABLE attach_data (
[Sun Oct 8 09:53:31 2006] tr_install.pl: id integer NOT NULL PRIMARY KEY,
[Sun Oct 8 09:53:31 2006] tr_install.pl: thedata bytea NOT NULL
[Sun Oct 8 09:53:31 2006] tr_install.pl: )"] at Bugzilla/DB.pm line 513
[Sun Oct 8 09:53:31 2006] tr_install.pl: Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 'attach_data') called at Bugzilla/DB.pm line 488
[Sun Oct 8 09:53:31 2006] tr_install.pl: Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 'attach_data') called at Bugzilla/DB.pm line 335
[Sun Oct 8 09:53:31 2006] tr_install.pl: Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0xa0a3df8)') called at Bugzilla/DB/Pg.pm line 220
[Sun Oct 8 09:53:31 2006] tr_install.pl: Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0xa0a3df8)') called at tr_install.pl line 298
[Sun Oct 8 09:53:31 2006] tr_install.pl: main::UpdateDB('Bugzilla::DB::Pg=HASH(0xa0a3df8)', 1) called at tr_install.pl line 79
[root@bugzilla3 bugzilla-2.22]#
Expected Results:
Expected testopia installation to successfully install testopia
| Assignee | ||
Comment 1•19 years ago
|
||
Hmmm, I am not even sure where to begin with this one. I have never run Postgres. Perhaps someone with more Postgres experience can take a stab at explaining this one.
Comment 2•19 years ago
|
||
Those NOTICE messages are normal, you don't have to worry about them.
The error means that you're trying to create the attach_data table when it already exists.
ghendricks--if you have access to the tools on landfill, you can create a PostgreSQL installation there to test with.
Comment 3•19 years ago
|
||
Here's the logic we're using in tr_install:
my $rebuild_bz_schema = 0;
# If bz_schema doesn't know about Testopia, it's either because
# Testopia has never been installed, or because Testopia was installed
# without using the methods in Bugzilla::DB. Either way, we need to
# bring bz_schema up-to-date.
if (!$dbh->bz_column_info('test_cases', 'case_id')) {
$rebuild_bz_schema = 1;
# Since we're going to rebuild bz_schema, we need to disconnect to
# forget what we know about the schema.
$dbh->disconnect;
$dbh = Bugzilla::DB::connect_main();
}
UpdateDB($dbh, $rebuild_bz_schema);
.
.
.
sub UpdateDB {
my ($dbh, $rebuild_bz_schema) = (@_);
if ($rebuild_bz_schema) {
$dbh->do("TRUNCATE bz_schema");
$dbh->bz_setup_database();
}
.
.
.
I have a bad feeling that this logic is flawed. It does seem to work with mysql....
Comment 4•19 years ago
|
||
The goal of the "TRUNCATE bz_schema" is to force bugzilla to rebuild it.
The problem came about because Testopia 1.0 created a bunch of tables without using Bugzilla/DB/Schema.pm. Therefore, on a Testopia 1.0 system, bz_schema doesn't know about all the Testopia tables.
So perhaps there's a better way to tell bugzilla "forget everything you think you know about the schema and rebuild bz_schema from scratch."
Comment 5•19 years ago
|
||
Wow, nobody consulted me on that decision.
PostgreSQL cannot rebuild the bz_schema table. You will basically destroy any Pg installation if you truncate the bz_schema table.
Priority: -- → P1
Comment 6•19 years ago
|
||
Dang -- sorry.
Will work on this. In the meantime, I've updated http://wiki.mozilla.org/Testopia:README.
Comment 7•19 years ago
|
||
I also updated the News section of http://wiki.mozilla.org/Testopia
Comment 8•19 years ago
|
||
You can use bz_table_list_real to find out if a table exists in the database or not, regardless of the schema.
Then, you can check some methods against $dbh->_bz_real_schema to see if the Schema thinks the table exists.
Since 1.1 is the first version that will support Pg, as far as I know, there aren't any upgrade problems, so you don't have to worry about telling people "you can only upgrade from this version." Pg users don't need to upgrade.
Comment 9•19 years ago
|
||
Includes a more careful check for whether we need to rebuild bz_schema.
We now make sure that the DB is MySQL before blowing away bz_schema.
| Assignee | ||
Updated•19 years ago
|
Assignee: ghendricks → vrb
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment 10•19 years ago
|
||
Comment on attachment 241978 [details] [diff] [review]
patch version 1
This patch is OK, and should prevent nuking PostgreSQL installations, but it doesn't go far enough.
Attachment #241978 -
Flags: review-
Comment 11•19 years ago
|
||
We no longer truncate bz_schema. Instead, we update it using these functions:
_bz_build_schema_from_disk
_bz_real_schema->add_table
_bz_store_real_schema
Attachment #241978 -
Attachment is obsolete: true
Attachment #242124 -
Flags: review?(ghendricks)
Updated•19 years ago
|
Attachment #242124 -
Flags: review?(mkanat)
Comment 12•19 years ago
|
||
Comment on attachment 242124 [details] [diff] [review]
patch version 2
Yeah, that looks right to me. I'll leave it to ghendricks to test it.
Attachment #242124 -
Flags: review?(mkanat) → review+
Comment 13•19 years ago
|
||
jonaliz55@yahoo.com:
I've tested this patch on my MySQL installation. Would you be willing to try it on your PostgreSQL installation?
If you're trying this on the same database where you found the error, you'll need to restore the bz_schema table from a backup before running your patched tr_install.pl.
| Assignee | ||
Updated•19 years ago
|
Attachment #242124 -
Flags: review?(ghendricks) → review+
Comment 14•19 years ago
|
||
r2300 | vrb | 2006-10-12 18:26:07 -0600 (Thu, 12 Oct 2006) | 7 lines
Changed paths:
M /trunk/tr_install.pl
We no longer truncate bz_schema. Instead, we update it using these functions:
_bz_build_schema_from_disk
_bz_real_schema->add_table
_bz_store_real_schema
| Assignee | ||
Comment 15•19 years ago
|
||
checked in v 1.6
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 16•19 years ago
|
||
(In reply to comment #13)
> jonaliz55@yahoo.com:
> I've tested this patch on my MySQL installation. Would you be willing to try it
> on your PostgreSQL installation?
> If you're trying this on the same database where you found the error, you'll
> need to restore the bz_schema table from a backup before running your patched
> tr_install.pl.
I would be willing to test it. I'll do it on 16/10.
| Reporter | ||
Comment 17•19 years ago
|
||
I tested the new patch (ver 2) and still failed to install - the results follow:
Now installing Testopia ...
Patching Bugzilla's files ...
No patch file especified, trying to determine the right one to use ...
Bugzilla version 2.22 detected.
Patch file chosen: patch-2.22
Now patching ...
Done.
Recovering original permissions ...
Done.
Congratulations, patch worked flawless!
A backup copy of the modified files has been saved with the .orig sufix.
Setting file permissions ...
Done.
Checking Testopia database ...
Adding new column case_id to table test_case_bugs ...
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: relation "test_case_bugs" does not exist [for Statement "ALTER TABLE test_case_bugs ADD COLUMN case_id integer"] at Bugzilla/DB.pm line 373
Bugzilla::DB::bz_add_column('Bugzilla::DB::Pg=HASH(0xa45e148)', 'test_case_bugs', 'case_id', 'HASH(0xa49f9f8)') called at ./tr_install.pl line 307
main::UpdateDB('Bugzilla::DB::Pg=HASH(0xa45e148)') called at ./tr_install.pl line 67
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Sun Oct 15 09:25:04 2006] tr_install.pl: DBD::Pg::db do failed: ERROR: relation "test_case_bugs" does not exist [for Statement "ALTER TABLE test_case_bugs ADD COLUMN case_id integer"] at Bugzilla/DB.pm line 373
[Sun Oct 15 09:25:04 2006] tr_install.pl: Bugzilla::DB::bz_add_column('Bugzilla::DB::Pg=HASH(0xa45e148)', 'test_case_bugs', 'case_id', 'HASH(0xa49f9f8)') called at ./tr_install.pl line 307
[Sun Oct 15 09:25:04 2006] tr_install.pl: main::UpdateDB('Bugzilla::DB::Pg=HASH(0xa45e148)') called at ./tr_install.pl line 67
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 18•19 years ago
|
||
I reran tr_install again - the installation progressed further but still failing. Re-running tr_install again did not help - the results follow:
Now installing Testopia ...
Patch already run successfully. Skipping.
Setting file permissions ...
Done.
Checking Testopia database ...
Adding new table test_attachment_data ...
Adding new table test_attachments ...
[Sun Oct 15 09:34:40 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_attachments_attachment_id_seq" for "serial" column "test_attachments.attachment_id"
[Sun Oct 15 09:34:40 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_attachments_pkey" for table "test_attachments"
Adding new table test_builds ...
[Sun Oct 15 09:34:41 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_builds_build_id_seq" for "serial" column "test_builds.build_id"
[Sun Oct 15 09:34:41 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_builds_pkey" for table "test_builds"
Adding new table test_case_activity ...
Adding new table test_case_bugs ...
Adding new table test_case_categories ...
[Sun Oct 15 09:34:42 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_categories_category_id_seq" for "serial" column "test_case_categories.category_id"
[Sun Oct 15 09:34:42 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_categories_pkey" for table "test_case_categories"
Adding new table test_case_components ...
Adding new table test_case_dependencies ...
Adding new table test_case_plans ...
Adding new table test_case_run_status ...
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: type "tinyserial" does not exist [for Statement "CREATE TABLE test_case_run_status (
case_run_status_id TINYSERIAL NOT NULL PRIMARY KEY,
name varchar(20),
sortkey integer
)"] at Bugzilla/DB.pm line 513
Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0x889a7c0)', 'test_case_run_status') called at Bugzilla/DB.pm line 488
Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0x889a7c0)', 'test_case_run_status') called at Bugzilla/DB.pm line 335
Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at Bugzilla/DB/Pg.pm line 220
Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at ./tr_install.pl line 299
main::UpdateDB('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at ./tr_install.pl line 67
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Sun Oct 15 09:34:44 2006] tr_install.pl: DBD::Pg::db do failed: ERROR: type "tinyserial" does not exist [for Statement "CREATE TABLE test_case_run_status (
[Sun Oct 15 09:34:44 2006] tr_install.pl: case_run_status_id TINYSERIAL NOT NULL PRIMARY KEY,
[Sun Oct 15 09:34:44 2006] tr_install.pl: name varchar(20),
[Sun Oct 15 09:34:44 2006] tr_install.pl: sortkey integer
[Sun Oct 15 09:34:44 2006] tr_install.pl: )"] at Bugzilla/DB.pm line 513
[Sun Oct 15 09:34:44 2006] tr_install.pl: Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0x889a7c0)', 'test_case_run_status') called at Bugzilla/DB.pm line 488
[Sun Oct 15 09:34:44 2006] tr_install.pl: Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0x889a7c0)', 'test_case_run_status') called at Bugzilla/DB.pm line 335
[Sun Oct 15 09:34:44 2006] tr_install.pl: Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at Bugzilla/DB/Pg.pm line 220
[Sun Oct 15 09:34:44 2006] tr_install.pl: Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at ./tr_install.pl line 299
[Sun Oct 15 09:34:44 2006] tr_install.pl: main::UpdateDB('Bugzilla::DB::Pg=HASH(0x889a7c0)') called at ./tr_install.pl line 67
Comment 19•19 years ago
|
||
jonaliz: If you installed the old testopia (before this fix), you'll have to drop your entire Bugzilla database and start from scratch, if you want things to work properly.
| Reporter | ||
Comment 20•19 years ago
|
||
(In reply to comment #19)
> jonaliz: If you installed the old testopia (before this fix), you'll have to
> drop your entire Bugzilla database and start from scratch, if you want things
> to work properly.
I did start from scratch!
Updated•19 years ago
|
Summary: Testopia ver 1.1 Installation error → tr_install.pl fails on PostgreSQL
Comment 21•19 years ago
|
||
Comment 17 is fixed by https://bugzilla.mozilla.org/attachment.cgi?id=241965
Please apply this patch or pick up the tip (http://lxr.mozilla.org/webtools/source/testopia/tr_install.pl?raw=1)
Comment 23•19 years ago
|
||
The problem is that http://lxr.mozilla.org/webtools/source/testopia/testopia/patch-2.22 does not contain a patch for Bugzilla/DB/Schema/Pg.pm
Comment 24•19 years ago
|
||
Add TINYSERIAL to Bugzilla/DB/Schema/Pg.pm
Updated•19 years ago
|
Attachment #242428 -
Flags: review?(ghendricks)
Updated•19 years ago
|
Assignee: vrb → ghendricks
Status: ASSIGNED → NEW
| Assignee | ||
Updated•19 years ago
|
Attachment #242428 -
Flags: review?(ghendricks) → review+
| Assignee | ||
Comment 25•19 years ago
|
||
Fix checked in. patch-2.22 v1.4
Status: NEW → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Comment 26•19 years ago
|
||
jonaliz:
One way to test this would be to apply https://bugzilla.mozilla.org/attachment.cgi?id=242428 to your Bugzilla/DB/Schema/Pg.pm file.
If you'd rather start from scratch, then please pick up the latest
/cvsroot/mozilla/webtools/testopia/testopia/patch-2.22 from the CVS tip.
(You should also pick up the latest tr_install.pl from the CVS tip.)
| Reporter | ||
Comment 27•19 years ago
|
||
(In reply to comment #26)
> jonaliz:
> One way to test this would be to apply
> https://bugzilla.mozilla.org/attachment.cgi?id=242428 to your
> Bugzilla/DB/Schema/Pg.pm file.
> If you'd rather start from scratch, then please pick up the latest
> /cvsroot/mozilla/webtools/testopia/testopia/patch-2.22 from the CVS tip.
> (You should also pick up the latest tr_install.pl from the CVS tip.)
I applied all the patches incrementally. A lot of new tables were added by still failing with the following results:
Patch already run successfully. Skipping.
Setting file permissions ...
Done.
Checking Testopia database ...
Adding new table test_attachment_data ...
Adding new table test_attachments ...
[Sun Oct 15 15:19:45 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_attachments_attachment_id_seq" for "serial" column "test_attachments.attachment_id"
[Sun Oct 15 15:19:45 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_attachments_pkey" for table "test_attachments"
Adding new table test_builds ...
[Sun Oct 15 15:19:46 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_builds_build_id_seq" for "serial" column "test_builds.build_id"
[Sun Oct 15 15:19:46 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_builds_pkey" for table "test_builds"
Adding new table test_case_activity ...
Adding new table test_case_bugs ...
Adding new table test_case_categories ...
[Sun Oct 15 15:19:46 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_categories_category_id_seq" for "serial" column "test_case_categories.category_id"
[Sun Oct 15 15:19:46 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_categories_pkey" for table "test_case_categories"
Adding new table test_case_components ...
Adding new table test_case_dependencies ...
Adding new table test_case_plans ...
Adding new table test_case_run_status ...
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_run_status_case_run_status_id_seq" for "serial" column"test_case_run_status.case_run_status_id"
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_run_status_pkey" for table "test_case_run_status"
Adding new table test_case_runs ...
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_runs_case_run_id_seq" for "serial" column "test_case_runs.case_run_id"
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_runs_pkey" for table "test_case_runs"
Adding new table test_case_status ...
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_status_case_status_id_seq" for "serial" column "test_case_status.case_status_id"
[Sun Oct 15 15:19:48 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_status_pkey" for table "test_case_status"
Adding new table test_case_tags ...
Adding new table test_case_texts ...
Adding new table test_cases ...
[Sun Oct 15 15:19:49 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_cases_case_id_seq" for "serial" column "test_cases.case_id"
[Sun Oct 15 15:19:49 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_cases_pkey" for table "test_cases"
Adding new table test_email_settings ...
Adding new table test_environment_category ...
[Sun Oct 15 15:19:50 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_category_env_category_id_seq" for "serial" column "test_environment_category.env_category_id"
[Sun Oct 15 15:19:50 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_category_pkey" for table "test_environment_category"
Adding new table test_environment_element ...
[Sun Oct 15 15:19:50 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_element_element_id_seq" for "serial" column "test_environment_element.element_id"
[Sun Oct 15 15:19:50 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_element_pkey" for table "test_environment_element"
Adding new table test_environment_map ...
Adding new table test_environment_property ...
[Sun Oct 15 15:19:51 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_property_property_id_seq" for "serial" column "test_environment_property.property_id"
[Sun Oct 15 15:19:51 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_property_pkey" for table "test_environment_property"
Adding new table test_environments ...
[Sun Oct 15 15:19:51 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environments_environment_id_seq" for "serial" column "test_environments.environment_id"
[Sun Oct 15 15:19:51 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environments_pkey" for table "test_environments"
Adding new table test_events ...
[Sun Oct 15 15:19:52 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_events_pkey" for table "test_events"
Adding new table test_fielddefs ...
[Sun Oct 15 15:19:52 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_fielddefs_fieldid_seq" for "serial" column "test_fielddefs.fieldid"
[Sun Oct 15 15:19:52 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_fielddefs_pkey" for table "test_fielddefs"
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: relation "fielddefs_name_idx" already exists [for Statement "CREATE INDEX fielddefs_name_idx ON test_fielddefs (name)"] at Bugzilla/DB.pm line 513
Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0x9074c20)', 'test_fielddefs') called at Bugzilla/DB.pm line 488
Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0x9074c20)', 'test_fielddefs') called at Bugzilla/DB.pm line 335
Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0x9074c20)') called at Bugzilla/DB/Pg.pm line 220
Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0x9074c20)')called at ./tr_install.pl line 298
main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9074c20)') called at ./tr_install.pl line 67
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Sun Oct 15 15:19:52 2006] tr_install.pl: DBD::Pg::db do failed: ERROR: relation "fielddefs_name_idx" already exists [for Statement "CREATE INDEX fielddefs_name_idx ON test_fielddefs (name)"] at Bugzilla/DB.pm line 513
[Sun Oct 15 15:19:52 2006] tr_install.pl: Bugzilla::DB::_bz_add_table_raw('Bugzilla::DB::Pg=HASH(0x9074c20)', 'test_fielddefs') called at Bugzilla/DB.pm line 488
[Sun Oct 15 15:19:52 2006] tr_install.pl: Bugzilla::DB::bz_add_table('Bugzilla::DB::Pg=HASH(0x9074c20)', 'test_fielddefs') called at Bugzilla/DB.pm line 335
[Sun Oct 15 15:19:52 2006] tr_install.pl: Bugzilla::DB::bz_setup_database('Bugzilla::DB::Pg=HASH(0x9074c20)') called at Bugzilla/DB/Pg.pm line 220
[Sun Oct 15 15:19:52 2006] tr_install.pl: Bugzilla::DB::Pg::bz_setup_database('Bugzilla::DB::Pg=HASH(0x9074c20)') called at ./tr_install.pl line 298
[Sun Oct 15 15:19:52 2006] tr_install.pl: main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9074c20)') called at ./tr_install.pl line 67
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 28•19 years ago
|
||
Apparently the names of indexes are global in PostgreSQL. So this bug is caused by fielddefs and test_fielddefs both having an index named fielddefs_name_idx.
(In MySQL, the name of an index needs to be unique only within a table.)
Comment 29•19 years ago
|
||
I just verified that fielddefs_name_idx is the only index with this problem.
Comment 30•19 years ago
|
||
Please apply the other two non-obsolete patches before applying this one.
Attachment #242710 -
Flags: review?(ghendricks)
Comment 31•19 years ago
|
||
------------------------------------------------------------------------
r2321 | vrb | 2006-10-18 17:45:17 -0600 (Wed, 18 Oct 2006) | 7 lines
Changed paths:
M /trunk/Bugzilla/DB/Schema.pm
M /trunk/tr_install.pl
test_fielddefs.fielddefs_name_idx is now named
test_fielddefs.test_fielddefs_name_idx
(In PostgreSQL, index names must be globally unique.)
| Reporter | ||
Comment 32•19 years ago
|
||
I installed fix for fielddefs_name_idx problem - it works - but failing now on table test_plan_tags table - log follows:
Now installing Testopia ...
Patch already run successfully. Skipping.
Setting file permissions ...
Done.
Checking Testopia database ...
[Tue Oct 17 10:12:30 2006] tr_install: Use of uninitialized value in concatenation (.) or string at Bugzilla/DB/Schema/Pg.pm line 125.
Adding new column userid to table test_plan_tags ...
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: relation "test_plan_tags" does not exist [for Statement "ALTER TABLE test_plan_tags ADD COLUMN userid integer"] at Bugzilla/DB.pm line 373
Bugzilla::DB::bz_add_column('Bugzilla::DB::Pg=HASH(0x9f71544)', 'test_plan_tags', 'userid', 'HASH(0xa09814c)', 0) called at ./tr_install line 314
main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9f71544)', 0) called at ./tr_install line 79
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Tue Oct 17 10:12:30 2006] tr_install: DBD::Pg::db do failed: ERROR: relation "test_plan_tags" does not exist [for Statement "ALTER TABLE test_plan_tags ADD COLUMN userid integer"] at Bugzilla/DB.pm line 373
[Tue Oct 17 10:12:30 2006] tr_install: Bugzilla::DB::bz_add_column('Bugzilla::DB::Pg=HASH(0x9f71544)', 'test_plan_tags', 'userid', 'HASH(0xa09814c)', 0) called at ./tr_install line 314
[Tue Oct 17 10:12:30 2006] tr_install: main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9f71544)', 0) called at ./tr_install line 79
| Assignee | ||
Updated•19 years ago
|
Attachment #242710 -
Flags: review?(ghendricks) → review+
Comment 33•19 years ago
|
||
jonaliz:
I believe the problem is that tr_install.pl has partly succeeded and partly failed on your database (comment 18 and comment 27). Therefore, your database is probably not sane.
Would you be able to restore your DB to a known good state (i.e., before you ran tr_install.pl the first time) and try again?
| Assignee | ||
Comment 34•19 years ago
|
||
So this is a bit tricky. Applying the patch on tr_install should fix your database when next you run it. The patch for Schema.pm is a change that really needs to be applied to patch-2.22 (which I have already done and checked in below). Since you have already applied patch-2.22 to your installation, you will have to do is first reverse the patch-2.22 with patch -R and then download the new patch-2.22 and reapply it. Of course it is a one line change so you may wish to simply copy the new index line manually in your patched version of Schema.pm.
Checking in testopia/patch-2.22;
/cvsroot/mozilla/webtools/testopia/testopia/patch-2.22,v <-- patch-2.22
new revision: 1.5; previous revision: 1.4
done
Checking in tr_install.pl;
/cvsroot/mozilla/webtools/testopia/tr_install.pl,v <-- tr_install.pl
new revision: 1.7; previous revision: 1.6
done
Please reopen if there are any other problems.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Comment 35•19 years ago
|
||
Summary: these three patches affect these files:
tr_install.pl
Bugzilla/DB/Schema/Pg.pm
Bugzilla/DB/Schema.pm
The fixes to Bugzilla/DB/Schema/Pg.pm and Bugzilla/DB/Schema.pm are trivial and can be applied by hand.
Or, you can bring your bugzilla back to how it was before you ran tr_install the first time, and then follow the CVS instructions in http://wiki.mozilla.org/Testopia:README#Installation
| Reporter | ||
Comment 36•19 years ago
|
||
I have no access to CVS - probably a firewall problem. Is there some other way I can obtain a good testopia-<version>.tar.gz for postgreSQL? I will be running tr_install on a clean bugzilla installation (ie 1st time testopia installation)
| Assignee | ||
Comment 37•19 years ago
|
||
(In reply to comment #36)
> I have no access to CVS - probably a firewall problem. Is there some other way
> I can obtain a good testopia-<version>.tar.gz for postgreSQL? I will be running
> tr_install on a clean bugzilla installation (ie 1st time testopia installation)
>
You can always just apply the patches attached to this bug to the regular tarball.
I will try to get a new tarball out soon.
Comment 38•19 years ago
|
||
The fixes for this bug are also here:
http://lxr.mozilla.org/webtools/source/testopia/tr_install.pl
http://lxr.mozilla.org/webtools/source/testopia/testopia/patch-2.22
| Reporter | ||
Comment 39•19 years ago
|
||
I used the 2 patches from comment 38- installation progresses until "Populating test_environment_category table" - see below:
Now installing Testopia ...
Patch already run successfully. Skipping.
Setting file permissions ...
Done.
Checking Testopia database ...
Adding new table test_attachment_data ...
Adding new table test_attachments ...
[Sun Oct 15 15:17:49 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_attachments_attachment_id_seq" for "serial" column "test_attachments.attachment_id"
[Sun Oct 15 15:17:49 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_attachments_pkey" for table "test_attachments"
Adding new table test_builds ...
[Sun Oct 15 15:17:50 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_builds_build_id_seq" for "serial" column "test_builds.build_id"
[Sun Oct 15 15:17:50 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_builds_pkey" for table "test_builds"
Adding new table test_case_activity ...
Adding new table test_case_bugs ...
Adding new table test_case_categories ...
[Sun Oct 15 15:17:52 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_categories_category_id_seq" for "serial" column "test_case_categories.category_id"
[Sun Oct 15 15:17:52 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_categories_pkey" for table "test_case_categories"
Adding new table test_case_components ...
Adding new table test_case_dependencies ...
Adding new table test_case_plans ...
Adding new table test_case_run_status ...
[Sun Oct 15 15:17:54 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_run_status_case_run_status_id_seq" for "serial" column"test_case_run_status.case_run_status_id"
[Sun Oct 15 15:17:54 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_run_status_pkey" for table "test_case_run_status"
Adding new table test_case_runs ...
[Sun Oct 15 15:17:55 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_runs_case_run_id_seq" for "serial" column "test_case_runs.case_run_id"
[Sun Oct 15 15:17:55 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_runs_pkey" for table "test_case_runs"
Adding new table test_case_status ...
[Sun Oct 15 15:17:55 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_case_status_case_status_id_seq" for "serial" column "test_case_status.case_status_id"
[Sun Oct 15 15:17:55 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_case_status_pkey" for table "test_case_status"
Adding new table test_case_tags ...
Adding new table test_case_texts ...
Adding new table test_cases ...
[Sun Oct 15 15:17:57 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_cases_case_id_seq" for "serial" column "test_cases.case_id"
[Sun Oct 15 15:17:58 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_cases_pkey" for table "test_cases"
Adding new table test_email_settings ...
Adding new table test_environment_category ...
[Sun Oct 15 15:17:59 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_category_env_category_id_seq" for "serial" column "test_environment_category.env_category_id"
[Sun Oct 15 15:17:59 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_category_pkey" for table "test_environment_category"
Adding new table test_environment_element ...
[Sun Oct 15 15:18:00 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_element_element_id_seq" for "serial" column "test_environment_element.element_id"
[Sun Oct 15 15:18:00 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_element_pkey" for table "test_environment_element"
Adding new table test_environment_map ...
Adding new table test_environment_property ...
[Sun Oct 15 15:18:01 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environment_property_property_id_seq" for "serial" column "test_environment_property.property_id"
[Sun Oct 15 15:18:01 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environment_property_pkey" for table "test_environment_property"
Adding new table test_environments ...
[Sun Oct 15 15:18:02 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_environments_environment_id_seq" for "serial" column "test_environments.environment_id"
[Sun Oct 15 15:18:02 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_environments_pkey" for table "test_environments"
Adding new table test_events ...
[Sun Oct 15 15:18:03 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_events_pkey" for table "test_events"
Adding new table test_fielddefs ...
[Sun Oct 15 15:18:04 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_fielddefs_fieldid_seq" for "serial" column "test_fielddefs.fieldid"
[Sun Oct 15 15:18:04 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_fielddefs_pkey" for table "test_fielddefs"
Adding new table test_named_queries ...
Adding new table test_plan_activity ...
Adding new table test_plan_group_map ...
Adding new table test_plan_tags ...
Adding new table test_plan_texts ...
Adding new table test_plan_types ...
[Sun Oct 15 15:18:08 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_plan_types_type_id_seq" for "serial" column "test_plan_types.type_id"
[Sun Oct 15 15:18:08 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_plan_types_pkey" for table "test_plan_types"
Adding new table test_plans ...
[Sun Oct 15 15:18:09 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_plans_plan_id_seq" for "serial" column "test_plans.plan_id"
[Sun Oct 15 15:18:09 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_plans_pkey" for table "test_plans"
Adding new table test_relationships ...
[Sun Oct 15 15:18:10 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_relationships_pkey" for table "test_relationships"
Adding new table test_run_activity ...
Adding new table test_run_cc ...
Adding new table test_run_tags ...
[Sun Oct 15 15:18:14 2006] tr_install.pl: Use of uninitialized value in string eq at Bugzilla/DB/Schema.pm line 2337.
Adding new table test_runs ...
[Sun Oct 15 15:18:14 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_runs_run_id_seq" for "serial" column "test_runs.run_id"
[Sun Oct 15 15:18:14 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_runs_pkey" for table "test_runs"
Adding new table test_tags ...
[Sun Oct 15 15:18:15 2006] tr_install.pl: NOTICE: CREATE TABLE will create implicit sequence "test_tags_tag_id_seq" for "serial" column "test_tags.tag_id"
[Sun Oct 15 15:18:15 2006] tr_install.pl: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_tags_pkey" for table "test_tags"
Populating test_case_run_status table ...
Populating test_case_status table ...
Populating test_plan_types table ...
Populating test_fielddefs table ...
Populating test_environment_category table ...
<h1>Software error:</h1>
<pre>DBD::Pg::db do failed: ERROR: syntax error at or near "," at character 154 [for Statement "INSERT INTO test_environment_category (env_category_id, product_id, name) VALUES (1, 0, 'Operating System'), (2, 0, 'Hardware')"] at ./tr_install.pl line 433
main::populateEnvTables('Bugzilla::DB::Pg=HASH(0x9f26c64)') called at ./tr_install.pl line 392
main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9f26c64)') called at ./tr_install.pl line 67
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Sun Oct 15 15:18:17 2006] tr_install.pl: DBD::Pg::db do failed: ERROR: syntaxerror at or near "," at character 154 [for Statement "INSERT INTO test_environment_category (env_category_id, product_id, name) VALUES (1, 0, 'Operating System'), (2, 0, 'Hardware')"] at ./tr_install.pl line 433
[Sun Oct 15 15:18:17 2006] tr_install.pl: main::populateEnvTables('Bugzilla::DB::Pg=HASH(0x9f26c64)') called at ./tr_install.pl line 392
[Sun Oct 15 15:18:17 2006] tr_install.pl: main::UpdateDB('Bugzilla::DB::Pg=HASH(0x9f26c64)') called at ./tr_install.pl line 67
[Sun Oct 15 15:18:17 2006] tr_install.pl: Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at ./tr_install.pl line 433.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 40•19 years ago
|
||
jonaliz: Technically, that's a different bug. I think this one should be closed and a new one should be filed, or at least this one should be a tracking bug.
ghendricks, vrb: Multi-value INSERT statements are not ANSI. They're MySQL-specific. You may wish to read:
http://www.bugzilla.org/docs/developer.html#sql-crossdb
Comment 41•19 years ago
|
||
This is now a tracking bug.
| Assignee | ||
Updated•19 years ago
|
Status: REOPENED → ASSIGNED
| Assignee | ||
Updated•19 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•