Closed Bug 145702 Opened 22 years ago Closed 22 years ago

query.cgi doesn't always ConnectToDatabase() early enough

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: michaelk, Assigned: justdave)

References

Details

(Keywords: regression, Whiteboard: applied to 2.16rc2)

Attachments

(1 file, 1 obsolete file)

If the query.cgi is accessed before an intial login has occured (on a web 
browser users computer) of a bugzilla installation (in 2.16RC1), a "Software 
error" is generated.

Software error:

Can't call method "prepare" on an undefined value at globals.pl line 270.

This problem goes away once a login has occured. (Then, it doesn't matter
then whether the user is logged in or out after that initial login)
*cough* ConnectToDatabase not being called *cough*

See bug 139632. This is the identical problem.

I missed this in my auid I did in that bug. We have to ConnectToDatabse before
_anything_ else, including GetVersionTable().

Note that this only happens if its a user who doens't have any cookies who tries
to log in when we want to run our hourly versioncache/token table cleanup.

-> 2.16
Severity: minor → major
Keywords: regression
Summary: error occurs on intial access of query.cgi in 2.16RC1 → query.cgi doesn't always ConnectToDatabase() early enough
Target Milestone: --- → Bugzilla 2.16
Can we now please stop bandaging these symptoms and fix the real problem?
*** Bug 146585 has been marked as a duplicate of this bug. ***
Attached patch Patch v.1 (obsolete) — Splinter Review
This seems to be what's required, and it fixes the problem.

Gerv
Comment on attachment 85032 [details] [diff] [review]
Patch v.1

grr - I thought I commented on this last night.

Anyway, you need to ConnectToDatabase before checking if the login is valid,
not afterwards.
Attachment #85032 - Flags: review-
Whiteboard: want for 2.16rc2
Attached patch v2Splinter Review
Attachment #85032 - Attachment is obsolete: true
Keywords: patch, review
Comment on attachment 85867 [details] [diff] [review]
v2

r= justdave
Attachment #85867 - Flags: review+
Comment on attachment 85867 [details] [diff] [review]
v2

Tested on a 2.16rc1 installation where I was observing this problem; worked
great!

r2=preed
Attachment #85867 - Flags: review+
Checked in, 2.16 branch + trunk.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Whiteboard: want for 2.16rc2 → applied to 2.16rc2
This just bit me. Maybe the error message could be a bit nicer so we actually
know that it's just ConnectToDatabase() that's missing..
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: