Closed Bug 701350 Opened 13 years ago Closed 13 years ago

Oracle crashes if the 'maxattachmentsize' parameter is set to a too small value

Categories

(Bugzilla :: Database, defect)

4.0.2
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: arnaud.hocevar, Assigned: LpSolit)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0 Build ID: 20111104165243 Steps to reproduce: I created a default setup of Bugzilla, using Oracle 11 as database backend. I changed the max attachement size from 512k to 4k in the Administration -> Preferences -> Attachement. Actual results: Bugzilla throws the following error. It looks like the whole site is not accessible anymore : DBD::Oracle::db selectrow_array failed: ERROR fetching field 1 of 2. LOB value truncated from 180107 to 4096. DBI attribute LongReadLen too small and/or LongTruncOk not set [for Statement "SELECT schema_data, version FROM bz_schema"] at Bugzilla/DB/Oracle.pm line 412 Bugzilla::DB::Oracle::selectrow_array(undef, 'SELECT schema_data, version FROM bz_schema') called at Bugzilla/DB.pm line 1254 Bugzilla::DB::_bz_real_schema('Bugzilla::DB::Oracle=HASH(0x1a65e628)') called at Bugzilla/DB.pm line 1000 Bugzilla::DB::bz_column_info('Bugzilla::DB::Oracle=HASH(0x1a65e628)', 'groups', 'id') called at Bugzilla/Object.pm line 444 Bugzilla::Object::_check_field('Bugzilla::Group', 'id', 'match') called at Bugzilla/Object.pm line 228 Bugzilla::Object::match('Bugzilla::Group', 'HASH(0x1a8f4338)') called at Bugzilla/Object.pm line 179 Bugzilla::Object::new_from_list('Bugzilla::Group', 'ARRAY(0x1a8f3f90)') called at Bugzilla/User.pm line 603 Bugzilla::User::groups('Bugzilla::User=HASH(0x1a760340)') called at Bugzilla/User.pm line 667 Bugzilla::User::in_group('Bugzilla::User=HASH(0x1a760340)', 'tweakparams') called at /local/amadeus/bugzilla/editparams.cgi line 47 Expected results: The administration interface should have prevented from reducing the size to this level if it caused such fatal error.
Severity: normal → critical
To fix the error, update manually $datadir/params and set maxattachmentsize to a size rgeater than the one in the previous error (256 worked for me)
Confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patch, v1 (obsolete) — Splinter Review
Assignee: database → LpSolit
Status: NEW → ASSIGNED
Attachment #577406 - Flags: review?(mkanat)
Flags: blocking4.2+
Flags: blocking4.0.3+
Target Milestone: --- → Bugzilla 4.0
Comment on attachment 577406 [details] [diff] [review] patch, v1 Review of attachment 577406 [details] [diff] [review]: ----------------------------------------------------------------- ::: Bugzilla/DB/Oracle.pm @@ +73,2 @@ > my $attrs = { FetchHashKeyName => 'NAME_lc', > + LongReadLen => max($attachment_max_size, 1000) * 1024, Ah, actually, it will have to be the largest that maxattachmentsize *ever* was. Perhaps it should go into a constant and be something like 32MB.
Attachment #577406 - Flags: review?(mkanat) → review-
Attached patch patch, v2 (obsolete) — Splinter Review
Attachment #577406 - Attachment is obsolete: true
Attachment #577418 - Flags: review?(mkanat)
Comment on attachment 577418 [details] [diff] [review] patch, v2 Review of attachment 577418 [details] [diff] [review]: ----------------------------------------------------------------- ::: Bugzilla/DB/Oracle.pm @@ +70,4 @@ > my $dsn = "dbi:Oracle:host=$host;sid=$dbname"; > $dsn .= ";port=$port" if $port; > my $attrs = { FetchHashKeyName => 'NAME_lc', > + LongReadLen => LOB_MAX_SIZE, But then if somebody sets maxattachmentsize larger than that, we'll fail again.
Attachment #577418 - Flags: review?(mkanat) → review-
Attached patch patch, v3Splinter Review
Attachment #577418 - Attachment is obsolete: true
Attachment #577752 - Flags: review?(mkanat)
Comment on attachment 577752 [details] [diff] [review] patch, v3 Review of attachment 577752 [details] [diff] [review]: ----------------------------------------------------------------- Beautiful.
Attachment #577752 - Flags: review?(mkanat) → review+
Comment on attachment 577752 [details] [diff] [review] patch, v3 Review of attachment 577752 [details] [diff] [review]: ----------------------------------------------------------------- Oh, except rename the constant to LONG_READ_LEN_MIN on checkin, or something like that.
Probably MIN_LONG_READ_LEN to be consistent with other constants.
Flags: approval4.2+
Flags: approval4.0+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/DB/Oracle.pm Committed revision 8028. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/ modified Bugzilla/DB/Oracle.pm Committed revision 7971. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/ modified Bugzilla/DB/Oracle.pm Committed revision 7662.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Summary: Oracle error after reducing attachment max size → Oracle crashes if the 'maxattachmentsize' parameter is set to a too small value
Blocks: 858909
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: