Closed Bug 527780 Opened 15 years ago Closed 15 years ago

bugs.token field changed to varchar(5) by upgrade, should have been left as varchar(16)

Categories

(Bugzilla :: Installation & Upgrading, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: tim, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.15) Gecko/2009102814 Ubuntu/8.10 (intrepid) Firefox/3.0.15
Build Identifier: 3.4.3

http://timwise.blogspot.com/2009/11/bugzilla-upgrades-and-user-tokens.html

I have upgrade from v3.0.4 to 3.4.3.

Once the site was up again, saving the site parameters (editparams.cgi) showed a big red warning:

    It looks like you didn't come from the right page (you have no valid token for the edit_parameters action while processing the 'editparams.cgi' script). The reason could be one of:

        * You clicked the "Back" button of your web browser after having successfully submitted changes, which is generally not a good idea (but harmless).
        * You entered the URL in the address bar of your web browser directly, which should be safe.
        * You clicked on a URL which redirected you here without your consent, in which case this action is much more critical.

    Are you sure you want to commit these changes anyway? This may result in unexpected and undesired results.

    [Confirm Changes]

    Or throw away these changes and go back to editparams.cgi.



Pushing the button doesn't work (same page shows again).

After much digging last time I discovered that the tokens it refers to are stored in table bugs.tokens, and that the size of the field is wrong in my installation after the upgrade (again).

mysql> use bugs;
mysql> describe tokens;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| userid | mediumint(9) | YES | MUL | NULL | |
| issuedate | datetime | NO | | NULL | |
| token | varchar(5) | NO | PRI | NULL | |
| tokentype | varchar(8) | YES | | NULL | |
| eventdata | tinytext | YES | | NULL | |
+-----------+--------------+------+-----+---------+-------+
5 rows in set (0.02 sec)

According to the published schema, token should be varchar(16). http://www.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/index.cgi?action=single&version=3.4.2&view=View+schema#table-tokens

To fix the problem I modified the data type as follows:


mysql> alter table tokens modify column token varchar(16) not null;
Query OK, 20 rows affected (0.32 sec)
Records: 20 Duplicates: 0 Warnings: 0


And then I was able to change my parameters. 

Reproducible: Didn't try
Yeah, checksetup.pl never changes the type or size of the tokens.token field, so this must be some peculiarity of your system. One thought is that it could be related to the way you're dumping and re-loading your database, if you're doing that.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.