How to fix the warning jinstaller: :install: error sql duplicate column name 'head_script'?

Brayan

Member
I was attempting to update a component on my Joomla site today and I was presented with an enormous red box which had the following message: warning jinstaller: : install: error SQL duplicate column name head script. It appears as though the database is attempting to add a column which has already been added in an earlier failed installation or a partial update. I can access phpMyAdmin, the only question that I have is what table I should be expecting to view and drop the column manually or I can simply ignore the warning. Is this something that has been experienced by other people during an extension update? I am concerned that leaving it as it is will create issues with the rest of the scripts on the site.
 
Go into phpMyAdmin and look for the #__extensions or the specific table related to that component (usually prefixed with your site's DB string). Since it’s a script error, check the #__assets or the component’s main configuration table. You don't necessarily need to drop the column; you might just need to remove the pending update record so the installer doesn't trip over itself. 💻
 
Oh, the joys of Joomla updates! 🙄 If the column is already there, it usually means the previous update actually succeeded in changing the schema but failed to tell the manifest file. You can usually ignore it if the component works, but my OCD would never let me leave that red box alone.
 
Check the administrator/components/com_yourcomponent/sql/updates/ folder. Look at the latest .sql file to see exactly which table it’s trying to alter. Once you find the table name in that file, go to phpMyAdmin, find that table, and see if the head_script column is already there. If it is, you're actually "ahead" of the installer. 🕵️‍♂️
 
I’ve seen this a dozen times. Don’t just ignore it! If the SQL script stops midway because of a duplicate error, the rest of the database changes in that update file might not execute. This leaves your DB in a "half-updated" state which is a recipe for a site crash later. ⚠️
 
Honestly, Joomla's "Manage -> Database -> Fix" button was invented for exactly this kind of headache. Try hitting that first before you start poking around in phpMyAdmin manually. It usually realigns the schema versions. 🔄
 
This is typically caused when Joomla tries to add a database column that is already there. Open phpMyAdmin, your Joomla database Extensions Manage Database, and click Fix. If the error is still there, go to the table concerned and delete or correct the duplicate head_script column, then do the fix again.
 
Back
Top