Skip to main content

error: Could not open Tokyo database at path (OpenTokyoDatabase: invalid record header)

I run my server out of space and after that I got these messages when running cf-agent:

error: Could not open Tokyo database at path '/var/cfengine/cf_classes.tcdb'. (OpenTokyoDatabase: invalid record header)
error: Could not write key to Tokyo path '/var/cfengine/state/cf_lock.tcdb'. (tchdbput: invalid record header)

To solve this problem first run these commands:

ls /var/cfengine/*.tcdb |xargs -n1 tchmgr optimize
ls /var/cfengine/**/*.tcdb |xargs -n1 tchmgr optimize

If the problem persists remove the tcdb files and restart cfengine:

# rm /var/cfengine/state/cf_lock.tcdb
rm /var/cfengine/state/cf_observations.tcdb
rm /var/cfengine/cf_classes.tcdb
/etc/init.d/cfengine restart

There is an open issue in Cfengine 3 community


Notice: Undefined variable: wp_sh_class_name in /var/www/elkano.org/blog/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1002

Notice: Undefined variable: wp_sh_class_name in /var/www/elkano.org/blog/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1002

Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /var/www/elkano.org/blog/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048