I'm a Drupal noob, but I've used Token (with Pathauto) in D.6 and had no problems at all. So I thought I should report this error I received when activating Token in D.7.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fairmont_drupal.cache_token' doesn't exist: TRUNCATE {cache_token} ; Array ( ) in cache_clear_all() (line 170 of /home/fairmont_admin/fairmontschool.org/includes/cache.inc).

I poked around looking for some code that would create these tables, but my cursory search turned up nothing, and I don't remember having to do anything like running SQL commands for Token under D.6.x.

Am I simply overlooking something in my configuration? Thanks.

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

Did you run update.php?

senortim’s picture

Ah-so... Thanks for that! Not sure how all this is working, but I'll be sure to check the pending updates queue after installing future modules. Cheers!

Aren Cambre’s picture

Status: Postponed (maintainer needs more info) » Needs review

I ran into the same problem when enabling Token and Pathauto simultaneously on an upgraded D6 instance. I guess Pathauto wants token's cache_token table, which isn't created until you run update.php.

Dave Reid’s picture

Status: Needs review » Postponed (maintainer needs more info)

Did it fix itself after you ran update.php??

Aren Cambre’s picture

No.

Dave Reid’s picture

@Aren: Did token_update_7000() get run at all when you upgraded or updated? It should have been if you performed a D6 -> D7 upgrade.

Aren Cambre’s picture

I'm sorry!! I looked at the wrong thing. Yes, it's fixed, so disregard my comment in #5.

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ah thanks Aren for the update and confirmation that its fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

DrewMathers’s picture

I had the same issue after a D6 upgrade. I couldn't enable Token separately, so I couldn't use the update.php solution. I went into Modules > Uninstall and uninstalled Pathauto and Token. I was then able to enable them simultaneously without a problem.

simeonabiola’s picture

I am building a new site using Drupal 7, until keep getting this error message while trying
create some field in user's accounts. I have cleared all the cache, trying cron, and update script, yet the same error message. Where do go from here? Thanks

Here is the message
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'talkoauc_drup238.dr_cache_token' doesn't exist: TRUNCATE {cache_token} ; Array ( ) in cache_clear_all() (line 169 of /home/talkoauc/public_html/includes/cache.inc).

Thanks
Simeon

Dave Reid’s picture

I'm not sure how this could happen on a new install. The cache_token table is clearly defined in token_schema().

simeonabiola’s picture

I think i would try a new installation. If i experience the same issue i will let you know
Thanks
Simeon

jbibbings’s picture

I am also encountering this issue upgrading Drupal from 7.7 to 7.12. I just upgraded to token 7.x-1.0-rc1 after running into this problem.

There is no cache_token table in the database, and there are no updates available. I tried disabling pathauto and token, and re-activating token, but I still receive this error. Even when I completely remove token, and re-download and install, I get this message when I try to re-activate.

Somewhere along the line it thinks I should have a cache_token table, but somehow it was never installed.

Masa Nishio’s picture

I had the same problem with D7.12 on my local installation.

I just turned off the Token module and saved the configuration, then I re-enabled it (to be exactly I also turned on the Pathauto module at the same time) and saved the configuration. Then the problem has disappeared.

giorgio79’s picture

Title: Activation error » cache_token doesn't exist: TRUNCATE {cache_token} ; Array ( ) in cache_clear_all()
Version: 7.x-1.x-dev » 7.x-1.0-rc1
Priority: Normal » Major
Status: Closed (fixed) » Active

This is still happening.

To reproduce try to flush all cache with admin menu.

Happens even after complete uninstall, reinstall.

giorgio79’s picture

Priority: Major » Critical

Actually, lets make this critical as it breaks a Drupal site as cache clears fail with this PDOException, in addition for example when saving filefiled paths that use tokens , the file field config cannot be saved because I am getting this pdoexception.

giorgio79’s picture

Status: Active » Closed (fixed)

Eh, after a second reinstall it seems to have created the cache_token table. Weird.

nategasser’s picture

Issue summary: View changes

If anyone comes here looking for a solution to "cache_token' doesn't exist" errors -- restarting MySQL solved this for me.
That is all...