I have set up a test site based on a 4.7 site with all of its modules up to date. I'm trying to upgrade the test site to 5.x. This works fine but I keep getting an error when I run update.php after installing CCK. I've seen other posts similar to this but always with the errors pre-update.php.
Here's what I've done:
1) Run update.php on the new 5.x site before updating any modules or themes. This works perfectly. No errors.
2) Copy newest version of CCK into sites/all/modules
3) Enable CCK on the Modules admin page and receive this message:
# The content fields table node_page has been created.
# The content fields table node_poll has been created.
# The content fields table node_story has been created.
# The configuration options have been saved.
4) Run update.php again and receive the following error:
* user warning: Table 'shine52.shine_cache_content' doesn't exist query: SELECT data, created, headers, expire FROM shine_cache_content WHERE cid = 'content_type_info' in /var/local/web/dtest/docs/includes/database.mysql.inc on line 172.
* user warning: Table 'shine52.shine_cache_content' doesn't exist query: LOCK TABLES shine_cache_content WRITE in /var/local/web/dtest/docs/includes/database.mysql.inc on line 172.
* user warning: Table 'shine52.shine_cache_content' doesn't exist query: UPDATE shine_cache_content SET data = '', created = 1185551419, expire = 0, headers = '' WHERE cid = 'content_type_info' in /var/local/web/dtest/docs/includes/database.mysql.inc on line 172.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/local/web/dtest/docs/update.php on line 309.
* warning: Invalid argument supplied for foreach() in /var/local/web/dtest/docs/update.php on line 542.
The executed queries on the update results page does say that cache_content was created, however.
I've tried to update CCK with Drupal 5.0, 5.1, and 5.2 and receive the same error. I've turned off and truncated cache and then tried to install CCK, but the same thing.
Can I just ignore the error message since it contains only warnings? Would that be an option if there is no fix?
Comments
Comment #1
mcchuck commentedSince the cache_content was being created too late, a co-worker suggested creating the table before running update.php. I did this and it worked. The create query for cache_content now fails, however the other queries execute successfully and the cache_content table has entries.
I still receive the bottom two warnings, however everything seems to be working.
Comment #2
yched commentedI'm not able to look precisely into the code, but I guess this is because of API calls in the update functions that get executed before the one that creates the content_cache table.
That is a typical yet easy to miss issue with updates (specifically CCK updates, where updates can be quite complex and often use CCK API calls, which in turn make some asumptions on the state of the db which might not be true -yet- when running an update). Not really easy to fix, too, because we can't just change the order of update functions.
Core updates solve this by hardcoding some preliminary update operations in update.php (typically, creation of cache tables...) - not sure how this could be adapted to contrib modules.
Adding something like
if (!db_table_exists('cache_content')) { ... create the table ...}at the top-level of content.install ?This is actually not _that_ important. Those errors should not have any real consequence and the upgrade should be fine in the end, but of course it would be best not to get any error to begin with...
Comment #3
yched commentedShould be fixed in latest 5.x-1.x-dev release (and forthcoming 5.x-1.6 release)
Comment #4
Anonymous (not verified) commentedI am running into something similar, not sure if this is a bug or if there's something else I should have done first.
Setup: Drupal 5.2 (OSX 10.4.10, mysql 4.0.25, php 5.2.2).
Upgrading from CCK 5.x-1.3 to 5.x-1.6.
I disabled CCK module, removed it from the modules directory.
Downloaded cck-5.x-1.6.tar.gz, untarred, put folder in modules directory, ran update.php.
No apparent problems.
Re-activated CCK module (Admin>Modules).
A barrage of dreaded pink error messages about cache_content, I'll just include one below.
I was able to back out without apparent trouble, to CCK 1.3. But am I doing something in the wrong order?
Should I run update.php after I active the new version of the module?
----
user warning: Table 'mysite.cache_content' doesn't exist query: SELECT data, created, headers, expire FROM cache_content WHERE cid = 'content_type_info' in /Volumes/data/WebServer/Documents/drupal/drupal-5.2/includes/database.mysql.inc on line 172.
Comment #5
yched commented@meles : you don't seem to follow the right steps for the update. If a module is disabled when you run update.php, it's updates won't get executed.
You should be doing the following :
- Do _not_ disable CCK modules
- remove the old cck folder from the modules directory, replace with the new one.
- run update.php
Comment #6
yched commentedAnd thus, switching back to the original title, for archiving sake.
Comment #7
Anonymous (not verified) commentedThank you for such a quick reply. That worked.
Comment #8
(not verified) commentedComment #9
jrdixey commentedJust a really late followup for anyone else updating an old Drupal 5 site. I'm updating one (that I haven't been the admin for) from 5.1 to 5.19 and just ran into this same issue. You can create the cache_content and cache_views tables via phpMyAdmin prior to running update.php to avoid the errors. Here is the code:
Hope this helps!
Comment #10
dankohn commentedI'm upgrading a site from 4.7 through 5.2 on its way to 6.14. Just a note that adding your two tables to the 4.7 database enabled the CCK modules to update correctly in 5.2. And for those not familiar with SQL, note that you want to run each command separately in PHPMyAdmin with a semicolon after it. Thanks!
Comment #11
ardiantoindo commentedI use Drupal 6.22 and drigg-6.x-1.x-dev. if create content page and story no have problem, but if after create scoop get error "user warning: Table 'admin567.cache_content' doesn't exist query: DELETE FROM cache_content WHERE cid = 'content:39:39' in /home/admin/domain/includes/cache.inc on line 178"
how to fix it ??