I am trying to upgrade from 4.5.2 to 4.6.0. and I get the following fatal error in the process:

user error: Unknown column 'severity' in 'field list'
query: INSERT INTO watchdog (uid, type, message, severity, link, location, hostname, timestamp) VALUES (1, 'page not found', 'update.php not found.', 1, '', '/update.php', '84.94.123.238', 1111156918) in /home/ramit/fwnetwork_new/htdocs/includes/database.mysql.inc on line 66.

Fatal error: Unknown column 'severity' in 'field list' query: INSERT INTO watchdog (uid, type, message, severity, link, location, hostname, timestamp) VALUES (1, 'php', 'Unknown column \'severity\' in \'field list\' query: INSERT INTO watchdog (uid, type, message, severity, link, location, hostname, timestamp) VALUES (1, \'page not found\', \'<em>update.php</em> not found.\', 1, \'\', \'/update.php\', \'84.94.123.238\', 1111156918) in /home/ramit/fwnetwork_new/htdocs/includes/database.mysql.inc on line 66.', 2, '', '/update.php', '84.94.123.238', 1111156918) in /home/ramit/fwnetwork_new/htdocs/includes/database.mysql.inc on line 66

Any suggestions?

Comments

ddiego’s picture

For what it's worth, I am getting the same problem. When I ran the update.php I got these errors:

2002-06-22: first update since Drupal 4.0.0 release

user error: Key column 'sid' doesn't exist in table
query: ALTER TABLE users ADD index (sid(4)) in /home/groups/v/vc/vcfbuilder/htdocs/forums-exp2/includes/database.mysql.inc on line 66.

Fatal error: Unknown column 'severity' in 'field list'
query: INSERT INTO watchdog (uid, type, message, severity, link, location, hostname, timestamp) VALUES (1, 'php', 'Key column \'sid\' doesn\'t exist in table
query: ALTER TABLE users ADD index (sid(4)) in /home/groups/v/vc/vcfbuilder/htdocs/forums-exp2/includes/database.mysql.inc on line 66.', 2, '', '/forums-exp2/update.php?op=update', '162.84.145.61', 1111256698) in /home/groups/v/vc/vcfbuilder/htdocs/forums-exp2/includes/database.mysql.inc on line 66

ddiego’s picture

Try re-running the update.php, and pick the first date in 2005 to start from. That seemed to cure things, at least so far! :)

fwnetwork’s picture

I am not sure I undersatnd your instructions. Where do I pick up / modify the date.

budda’s picture

This comment is non-sense?! You need to update the 4.5.x database to be 4.6.0 compatible before you can do much else.

Running the update.php script doesn't do much but give the above error.

--
www.gadgetspy.co.uk

blovett’s picture

I ran into the exact same problem, and following ddiego's suggestion cleared things up completely.

freyquency’s picture

I had a similar problem upgrading from 4.6RC, just picked the last date on the list and it worked fine.

freyquency’s picture

What I did seemed to work until i tried to edit book pages. It could have been any number of cvs versions, patches, or 4.5 modules conflicting instead, but the point is that something didn't work. Since I was working on a new site with no content it was ok.

daspez’s picture

I Just went through this tedious task trying to find the right version to upgrade from and I found that all works fine if you pick the last stable release, in this case '4.5.0' to upgrade from.

Hope it helps someone.

-- david

Mack Oberman’s picture

Since for some reason the update.php couldn't figure out which updates I needed (defaulting to "All"), I tried exactly what you suggested on a 4.5.2 database. Multiple times, starting from a stable 4.5.2 mysqldump each time. It fails:

2004-10-31: first update since Drupal 4.5.0 release

user error: Table 'search_total' already exists
query: CREATE TABLE search_total (
word varchar(50) NOT NULL default '',
count int(10) unsigned default NULL,
PRIMARY KEY word (word)
) TYPE=MyISAM in /home/foo/testing/includes/database.mysql.inc on line 66.

Fatal error: Unknown column 'severity' in 'field list'
query: INSERT INTO watchdog (uid, type, message, severity, link, location, hostname, timestamp) VALUES (0, 'php', 'Table \'search_total\' already exists
query: CREATE TABLE search_total (
word varchar(50) NOT NULL default \'\',
count int(10) unsigned default NULL,
PRIMARY KEY word (word)
) TYPE=MyISAM in /home/foo/testing/includes/database.mysql.inc on line 66.', 2, '', '/update.php?op=update', '65.114.8.9', 1114099043) in

Jeena-1’s picture

I got the same problem but using the last date on the list hasn't been of use. I tried all the dates without getting drupal 4.6.0 worked. Have you guys any suggestions?

I'm trying to upgrade 4.5.2 to 4.6.0

Webdesign from Sweden http://jeenaparadies.net/webdesign/

Greg Delisle’s picture

I ran into this as well. It seems like if you get any errors in update.php it wants to insert an error into watchdog with the severity column included. Problem is, that column wasn't there in 4.5.2 so if you run an update that's -prior- to the update that creates that column, -and- the script hits an error (say, it's a table that already exists because you've selected the 4.5.0 update) then it'll stop.

There are two solutions. First, you can manually add the severity column in your watchdog table and try again. It looks like 'severity tinyint(3) unsigned not null default=0". Then the problem will disappear and errors will just flow by when you hit them instead of stopping the process.

The simpler way is to just move one date forward in the update script and try again -- the likely reason you're getting an error is because you don't need the update you're trying to run, so you can probably skip it. After a few dates past the first 4.5 update, you'll hit the one where the severity column gets added, and then errors will be handled correctly. The script should then run to the end.

Zot’s picture

The simpler way is to just move one date forward in the update script and try again -- the likely reason you're getting an error is because you don't need the update you're trying to run, so you can probably skip it. After a few dates past the first 4.5 update, you'll hit the one where the severity column gets added, and then errors will be handled correctly. The script should then run to the end.

How do you move one date forward in the update script exactly?

Greg Delisle’s picture

What I mean is this: the list of updates is a select menu of dates, with the most recent dates at the bottom. If the date you chose from the list doesn't work, choose the next most recent date.

Jeena-1’s picture

Thanks it helped. Finaly I had to got until 2004-12-05 because I hadn't had the queue table in my database.

severity is in the 2005-01-07 update:

ALTER TABLE {watchdog} ADD severity tinyint(3) unsigned NOT NULL default '0'

--
Webdesign from Sweden http://jeenaparadies.net

Mack Oberman’s picture

Based on comments here and the stupidity of the chicken vs. egg setup for the watchdog.severity column in updates.inc, my 18th try at upgrading from 4.5.2 to 4.6 was exactly as you suggested. I started with a working 4.5.2 database and chose the 2005-01-07 update. It completed, but now trying configure blocks throws this:

user error: Unknown column 'visibility' in 'field list'
query: INSERT INTO blocks (module, delta, status, weight, region, visibility, pages, custom, throttle, types) VALUES ('aggregator', 'feed:9', 1, -2, 1, 0, '', 1, 0, '') in /home/foo/testing/includes/database.mysql.inc on line 66.

Sigh.

BertG’s picture

How does the SQL statement look like to add the visibility column to the blocks table?

BertG’s picture

After a lot of trial & error, my upgrade path from 4.5.2 to 4.6.0 looks like this:

- Run update.php and choose to update from Jan 7th 2005 on.
- Run the following query on the DB to add the columns 'visibility' and 'pages' to the table 'blocks':

	ALTER TABLE blocks ADD COLUMN visibility TINYINT(1) NOT NULL DEFAULT '0';
	ALTER TABLE blocks ADD COLUMN pages TEXT NOT NULL;

That's it, no more problems for now!

Greg Delisle’s picture

Here's the list of post-4.5 updates, taken directly from updates.inc:
"2004-10-31: first update since Drupal 4.5.0 release" => "update_110",
"2004-11-07" => "update_111",
"2004-11-15" => "update_112",
"2004-11-28" => "update_113",
"2004-12-05" => "update_114",
"2005-01-07" => "update_115",
"2005-01-14" => "update_116",
"2005-01-18" => "update_117",
"2005-01-19" => "update_118",
"2005-01-20" => "update_119",
"2005-01-25" => "update_120",
"2005-01-26" => "update_121",
"2005-01-27" => "update_122",
"2005-01-28" => "update_123",
"2005-02-11" => "update_124",
"2005-02-23" => "update_125",
"2005-03-03" => "update_126",
"2005-03-18" => "update_127",
"2005-03-21" => "update_128",
"2005-04-14" => "update_129"

Now, most of us are running 4.5.2 so the 10/31 - 12/05 updates are probably already in there. But it doesn't hurt to run them. The catch is that #115 isn't in 4.5.2, and that's the one that adds the watchdog column -- but any error, including updates prior to #115, is going to try to write to that column and break the script. I believe the only reason why this would go smoothly is if you're running a 4.5.2 HEAD version from February or later.

So here's two things you can do.

1. Start with update #115. That'll add the watchdog column right away and all errors, if encountered, will be processed smoothly by the script. All subsequent updates will run and then you'll be upgraded to 4.6.

2. If you're the belt-and-suspenders type like me, run #110 (2004-10-31). It will probably fail and crash the script. Then go BACK to update.php and run #111 which will also probably fail and crash the script. Then go BACK to update.php and run #112 and so on down the list. If one of them runs, great -- if it crashes the script, that means you didn't need it!

You can work your way through the list of updates from 110-115 in about 5 minutes and then when it hits 115 it'll run through to the end. Then you'll be upgraded to 4.6.

media girl’s picture

I used the 10/31/4 update script on my 4.5.2 installation I did in January.

I assume that, unlike the contributed modules, which get micro-upgraded on a continual basis (which I believe should be noted as 4.x.x.foo releases, so admins can actually know if they're up to date), Drupal core tarball is not updated continuously, so anyone who has not run patches on the Drupal core should run the script for whatever version of Drupal they are running.

Yes?
--
mediagirl.org

killes@www.drop.org’s picture

ciric@drupal.org’s picture

I had problems in upgrading from 4.52 installed in beginning of March.
I regret having read only the Installation directions and not this topic :(

1) Automatic detection of the version did not work.
2) I decided to start with a version which was apparently close to mine (I tried 124) but I got mistakes

In the end I started with 110 and it worked. Idid it on my remotely hosted website in a separate test directory and separate database.
(You said:
If you're the belt-and-suspenders type like me, run #110 (2004-10-31). It will probably fail and crash the script. so I was cxoncerned but it was OK).

I did it twice always from scratch to be sure.

Then I upgraded to the production website.

Only problem now solved: the blocks administration page did show the new look (the nice one with bold titles for "Left sidebar" and so on and indentedt rows for the blocks...), while in the production site it did not and it was still the 4.5.2 look.

I compared directory and databases and they were the same. So I did nothing, and after some enter-exit manouvre the new look appeared also in the production site.

Does someone know why?

Riccardo

christian_z’s picture

Same Problem http://drupal.org/node/21268 and I can not understand,
versions and numbers of Drupal releases write by hand in the file "update.php"?

The INSTALL.txt in Drupal 4.6.0 say:

5. Run update.php by visiting http://www.example.com/update.php

Yes I did, and now?

christian_z’s picture

Ok now I come slowly to the solution:
I enter example:

http://localhost/drupal-4-6/update.php?op=update_115
// then select the date:
"2005-01-14"
// and click:
"Update"

And now where can I find the number (date) of my drupal version?
In the admin interface or in the CHANGELOG.txt (Drupal 4.5.2, 2005-01-15) ?

JohnG-1’s picture

I re-ran the update to get rid of the 'severity' problem - it inserted ok, but now I have (from update.php output):

2005-03-18
user error: Unknown column 'voters' in 'poll'
query: ALTER TABLE poll CHANGE voters polled longtext in /homepages/17/d102167677/htdocs/DNT1/includes/database.mysql.inc on line 66.
ALTER TABLE {poll} CHANGE voters polled longtext 
FAILED

2005-03-21
user error: Multiple primary key defined
query: ALTER TABLE term_node ADD PRIMARY KEY (tid,nid) in /homepages/17/d102167677/htdocs/DNT1/includes/database.mysql.inc on line 66.
ALTER TABLE {term_node} ADD PRIMARY KEY (tid,nid) 
FAILED

and phpmyadmin says:
PRIMARY and INDEX keys should not both be set for column `tid`

so I tried to set the tid PRIMARY to 'ignore' via phpmyadmin, but it gave me another error (where key 1 is the nid):
#1062 - Duplicate entry '218' for key 1

nor has it changed the PRIMARY tid,nid 'conflict'.

Can anyone help? I don't want to do any more damage!

thanks JohnG

media girl’s picture

I suggest dropping the tables, reinserting your database from your backup, and then run update again, this time choosing the earliest update for the version you're running. (The later dates are only if you were running patches on the Drupal core since you last installed/upgraded.)

That should do it.

--
mediagirl.org

JohnG-1’s picture

yep that seemed to cure everything
:)
thanks

suzanne.aldrich’s picture

I don't really even feel like asking for help. I am going to figure this out on my own. I just want to say that as an up and running system, Drupal is neat, but the whole installation/upgrade process sucks greasy donkey balls. Seriously. I am pretty much getting the same kind of errors, as the other people who posted in this topic. Database errors. I don't want to get into it, and I don't want a stupid response about how not giving you the error doesn't help solve the problem. You know what the problem is; shitty usability and bad planning. I originally picked drupal because of the fact that it's open-source, and kinda-sorta supports postgresql. Now I regret this decision, and I cannot in good faith recommend this software to anyone without a degree in Computer Science or some serious coding experience. And believe me, I was in the Stanford CS program for over 3 years. So I'm not a complete blathering idiot. I just want to blog, and this software is preventing me from being creative.

laura s’s picture

You're right, but it's not easy upgrading a CMS with over 100 contributed modules. You can't just create an upgrade script, one size fits all. The comments here can get you through that.

If you're unwilling, you can wait for CivicSpace to finish its follow-up update incorporating Drupal 4.6. But you'll still have to wait. They've been at it six weeks, and still have yet to have that stable release with a one-click install. And you can be sure they know precisely what they're doing.

Or you can get webhosting with Fantastico and get Drupal installed with one click.

Or you could get WordPress -- if all you want to do is blog, Drupal is overkill, really.

Or you could go pay money for a system where they cater to the consumer who needs things easy. This is open source. It's like a crowd of people that has a general intention of walking in a certain direction. If you want lock step or dress code or tight formations that are easy to understand and appreciate, well, a crowd just isn't going to do that.

Eight months ago I didn't know a stitch of PHP or MySQL. As a designer, I didn't have much of a computer programming background, unless one term of Pascal counts. But I managed to muddle through this process. No it's not ideal, but it's what we have. And the nature of the beast is live with it or help improve it.

As for the update, keep trying the alternative dates on the update script. The scripts are non-destructive, and once it runs without error, you should be in business (as far as the core goes).

I guess you caught me on an ornery night. I really should be much more amiable on a 3-day weekend. Sorry about that. :) Good luck with the upgrade (or migration).

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

suzanne.aldrich’s picture

Hi Laura,

I guess I'm feeling ornery as well ;-) I got a little farther along, no fatal errors (manually inserted the severity column in the watchdog table) but I'm still having failures because of the permissions/ownership of all the tables the update script is trying to alter. The host of my site uses postgresql rather than mysql, and it is definitely a headache to find software that meets the open-source/postgresql requirement. Definitely a lot of tweaking. I know all about the trials and tribulations (and rewards) of open-source, and I guess this is just part of it. I will be sure to post any tips I have for getting this to work. Before I could get Drupal 4.5 to work, my site host had to help me by hacking at database.postgresql.inc's db_connect so that I could even connect to my database via unix sockets (as opposed to http). Boy that was fun. I wish I had money to give him for that fix. Or to give to drupal. But that leads into why I have to use open-source in the first place. Well anyway, thanks for the encouragement - I will forge ahead.

suzanne.aldrich’s picture

This is how to make a drupal update work if you are running postgresql and the www-data user is not priveleged:

0. Backup. Backup backup backup. Use 'pg_dump database > dumpfile', and then if you screw things up you can drop all the tables and use 'psql < dumpfile' to restore the old tables.

1. Manually update the watchdog table with the new severity field; if you don't do this, you will fail and you will be upset.

2. Pester your host admin or another superuser to change the ownership of all the tables to the www-data user (or equivalent) with this command: alter table * owner to "www-data".

3. Run the update.php script. This should work now. There will be a failure on update 115 because that's where it alters the watchdog table you've already manually altered. Bad drupal; bad!

4. Pester your host admin to change the ownership of all the tables back to you.

5. Profit?

My admin says:

<Admin> ideally the drupal authors would have separated the actual upgrade from the UI, enabling one to run the upgrade from the commandline instead
<Admin> In general drupal doesn't appear to have contemplated the possibility that the www-data user is unpriveleged

So there!

nsyll’s picture

I have the same problem with
Drupal 4.5.2, 2005-01-15 update to 4.6
and i fix it

1)have access in mysql db & ---> ALTER TABLE 'watchdog' ADD severity tinyint(3) unsigned NOT NULL default '0'

2) reload /update.php and choose
Drupal 4.5.2, 2005-01-15

Steven’s picture

It sounds like all of you are specificaly picking the wrong update to start from. Just pick what Drupal suggests: "First update since 4.5.0".

The dates refer to the development version and have no correlation with the 4.5.1 or 4.5.2 maintenance releases. When they are made and released, the next branch is already much improved.

--
If you have a problem, please search before posting a question.

suzanne.aldrich’s picture

No, that's not true. If you pick the suggested update, 110 (a number that occurs before 115), and any kind of error occurs, the script attempts to log the error into a field of the watchdog table that doesn't exist until update 115 creates it, resulting in a fatal error. This is because of bad planning on the part of the update developer, not user error. To successfully run the update from the suggested and correct starting place, the user has to manually manipulate the database with various commands that the user shouldn't have to learn in order to do a simple update, assuming that all they know how to do is click on links to update a database.

My particular problem ran a little deeper, starting with the assumption that the www-data user is privileged on my host's postgresql database system. Personally, I don't think it's a good idea to do that. All it would take is someone uploading a malicious script into a writeable folder and executing it from the browser to wipe out my entire database. It is better to err on the side of paranoia when one is dealing with data on the web. Therefore, *I* own my tables. It would be a good idea for update developers to separate the form from the function, as one learns early on in programming classes, and make it possible to execute an update from the commandline, while retaining the ability to run it from the web for those who like having their database tables owned by www-data.

Lastly, I'd like to suggest that before one blames users for problems, one should test the issue to confirm the suspicion.

mikhailian’s picture

I had to manually run
ALTER TABLE watchdog ADD severity tinyint(3) unsigned NOT NULL default '0';
although I saw no reason for this statement to fail. Anyone can explain?

I also had to run

DELETE FROM sessions WHERE uid >1;
DELETE FROM sessions WHERE uid =0;
ALTER TABLE sessions ADD PRIMARY KEY sid (sid);

because I had duplicated sid.

Otherwise, it happened smoothly.

One thing I think is a real bug is that the update script does not recognize where to start from. This is because the date of the last update from 4.5.4 does not match anything in 4.6.2.

mannyd’s picture

For me, all I did was do a fresh database on my test install and ran the 110 update from 10-31 first update since Drupal 4.5.0 release and it OK'ed pretty much everything. my new 4.6 is running smoothly everywhere now, now to get it to 4.62

Manuel Dominguez
Domains and Web Hosting
.US . BIZ . NET $5.95
http://www.airdepth.net

caveman’s picture

I've been following this thread and got much help, but all my nodes have disappeared. When I go to my drupal directory I get a page not found message, but all my blocks are there. Click any link and I go to a 404 error. Can't even login.

Basically I was trying to move my site from a 4.52 drupal version to a 4.62 version on another server. After much searching and reading, I figured out how to back up my database and import it on the new server. Then I got the "severity" error which brought me to this thread.

I then ran the update.php script starting at 2005-01-14 on down. That got rid of all my error message--but no luck getting to any of my nodes. Only the blocks.

Any suggestions? I went to the settings.php file to make sure the base url was right, and it seems to be. Are there any other settings I need to tweak in moving to a new ISP? Since I see the blocks I assume drupal knows where to find the database.

BTW I'm using cpanel. Thanks for any help you can give. I really need to get this up live as soon as possible. I've been working on it for weeks, and have a pressing deadline.

Caveman

Julie B’s picture

Ironically it happened about the same time as your post.

Happened to see this other thread which I copied below: I am very new to Drupal and Cpanel and to webpages in general, but I looked and found that my .htaccess was empty after the upgrade and was able to find this component from a backup; FTP'd that file over and all seems to be working now.

Hope this helps - if someone else with more knowledge of the structure can better explain how to restore this component, it might be helpful for Caveman. Best of luck.

SEE BELOW FOR OTHER THREAD DETAILS THAT PROMPTED MY TRYING THIS FIX:

from 4.6.0 to 4.6.2, no node accessible
Upgrade problems
chema - July 25, 2005 - 01:50

Hi to all!!

another upgrading problem... i followed the instructions for upgrading in "INSTALL.txt", but now i can't access any node in my web (404, not found). I upgraded from 4.6.0 to 4.6.2. But the main page works. So it should be something stupid... can anyone help me with this? I tried to follow some other posts with similar problems, and i erased node.module, and put my old one instead, but no luck at all.

Thanks a lot!!
» add new comment · previous forum topic · next forum topic
resolved
chema - July 25, 2005 - 15:12

Ok, as i thought, i was something stupid. No .htaccess :)

Thanks all!