1) Introduction: Why This Error Happens
The Lingotek module is a powerful translation integration tool in Drupal that syncs content with the Lingotek Cloud Translation service. While it offers great flexibility, uninstalling it can lead to unexpected errors—especially if the module was not fully initialized or if translation-related database tables were deleted.
The most common uninstall error looks like this:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lingotek_metadata' doesn't exist
This prevents the module from being removed and can affect other multilingual components. Let’s break down why this happens and walk through two safe, effective ways to fix it.
2) 📚 Background: What Causes This Error?
When the Lingotek module is enabled, it creates several database tables to manage translation metadata, such as:
lingotek_metadata
lingotek_config
lingotek_content
If these tables were deleted manually, corrupted, or never created properly, Drupal will fail to uninstall the module because the uninstall process attempts to query them for dependency checks.
💡 Even if you disabled the module, Drupal will still validate and expect those tables during uninstallation.
3) ✅ Recommended Fix: Rebuild the Missing Table and Uninstall Normally
This solution is safe for production environments, and was tested in:
Drupal: 10.1.4
MySQL: 8.0.33
PHP: 8.2+
Server: Ubuntu 22.04 LTS
Step 1: Manually Rebuild the Minimal Table
Open your database tool (phpMyAdmin, TablePlus, command line) and run:
CREATE TABLE `lingotek_metadata` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
This creates a lightweight placeholder table. Drupal only needs the table to exist during the uninstall validation—data is not required.
Step 2: Use Drush to Uninstall the Module
Run the following in your Drupal project root:
drush pmu lingotek -y
drush cr
pmu stands for pm:uninstall
cr clears caches and finalizes changes
If successful, the table will automatically be deleted during uninstall.
Step 3 (Optional): Drop the Table Manually
If the table still exists after uninstall, clean it up with:
DROP TABLE IF EXISTS `lingotek_metadata`;
4) 💡 Alternative Fix: Force Uninstall by Deleting Config (Dev Only)
This method is NOT recommended for production sites, but is useful for local dev environments where full data integrity is not required.
Step 1: Delete All Lingotek-Related Config
drush config:delete $(drush config:list | grep lingotek)
Or delete individual keys:
drush config:delete lingotek.settings
Step 2: Uninstall the Module
drush pmu lingotek -y
drush cr
Step 3 (Optional): Clean Database Residues
Use with extreme caution:
DELETE FROM key_value WHERE name LIKE '%lingotek%'; DELETE FROM config WHERE name LIKE '%lingotek%';
⚠️ Always back up your database before performing direct SQL modifications.
5) ❓ Frequently Asked Questions (FAQ)
Q1: Why does Lingotek throw uninstall errors more than other modules?
Because it tightly integrates with translation metadata and cloud services, and sets up custom database tables that Drupal expects even after being disabled.
Q2: Is it safe to delete the Lingotek module manually via filesystem?
No. Always use Drush or the Drupal admin interface. Deleting modules from /modules/contrib without uninstalling first can result in ghost entries and broken site config.
Q3: Can I reinstall Lingotek later?
Yes, but ensure all residual config and schema are clean. Use:
drush config:status | grep lingotek
to verify before re-enabling.
6) ✅ Conclusion: Use Method 1 for Stability, Method 2 for Recovery
For most users, rebuilding the missing table and uninstalling with Drush is the safest and most stable approach.
If you’re managing multilingual workflows with Lingotek, it’s important to follow structured uninstall steps to prevent data loss or module ghosting.
Back to top
Comments