We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE 3 > EE5 upgrade issue: SQL Error only on some templates

News and General

liberty79's avatar
liberty79
135 posts
6 years ago
liberty79's avatar liberty79

I’m getting this error on some templates and not others after upgrading from EE3 to EE5. I can’t isolate the problem. It looks like it’s member data related (maybe?) but I have disable=”member_data” on all channel entries loops on the affected pages.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm.url' in 'field list':
SELECT t.entry_id, t.channel_id, t.forum_topic_id, t.author_id, t.ip_address, t.title, t.url_title, t.status, t.view_count_one, t.view_count_two, t.view_count_three, t.view_count_four, t.allow_comments, t.comment_expiration_date, t.sticky, t.entry_date, t.year, t.month, t.day, t.edit_date, t.expiration_date, t.recent_comment_date, t.comment_total, t.site_id as entry_site_id, w.channel_title, w.channel_name, w.channel_url, w.comment_url, w.comment_moderate, w.channel_html_formatting, w.channel_allow_img_urls, w.channel_auto_link_urls, w.comment_system_enabled, m.username, m.email, m.url, m.screen_name, m.location, m.occupation, m.interests, m.aol_im, m.yahoo_im, m.msn_im, m.icq, m.signature, m.sig_img_filename, m.sig_img_width, m.sig_img_height, m.avatar_filename, m.avatar_width, m.avatar_height, m.photo_filename, m.photo_width, m.photo_height, m.group_id, m.member_id, m.bday_d, m.bday_m, m.bday_y, m.bio, md.*, wd.* FROM exp_channel_titles AS t LEFT JOIN exp_channels AS w ON t.channel_id = w.channel_id LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id LEFT JOIN exp_member_data AS md ON md.member_id = m.member_id WHERE t.entry_id IN (3609) ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc

mysqli_connection.php:117

Any ideas? I get the error whether I’m logged into the CP or not.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

I’d first try to clear caches, do so manually if necessary in your system/user/cache folder. If you still have it, it could be a PHP opcache still compiling a stale mod.channel.php file from v3. Is this happening locally or on a managed server? If the latter, a dedicated server/VM or shared environment?

       
rokker's avatar
rokker
175 posts
6 years ago
rokker's avatar rokker

i had some similar errors, the only way i was able to fix it was to delete the bad templates and make new ones with the same name and paste in from my back up. i bet i had 15 templates that went crazy. if you don’t have a good back up you can probably download your mysql as a spreadsheet and the template code is in the table there i bet.

it wasn’t that hard or painful, took about an hour and was easier than paying for support to crawl through my installation to diagnose…

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

These are not the same errors you had, rokker.

       
liberty79's avatar
liberty79
135 posts
6 years ago
liberty79's avatar liberty79

Derek, I have a few files and folders in that cache directory. Which specifically are you recommending I trash?

       
liberty79's avatar
liberty79
135 posts
6 years ago
liberty79's avatar liberty79

Derek (and anyone else googling this error), I trashed the files in

system/user/cache/default_site/page_cache

system/user/cache/default_site/sql_cache

system/user/cache/default_site/tag_cache

and that seems to have fixed it!

I notice in the upgrading documents (https://docs.expressionengine.com/latest/installation/upgrade_from_3.x_4.x.html) that it doesn’t mention clearing caches before starting the update process, and I feel like older versions of ExpressionEngine recommended this. Should we still be clearing caches in the control panel before upgrading?

For what it’s worth, this issue was on a MAMP/local environment. I wanted to test the upgrade locally before pushing to production.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

The system will take care of what it needs to in a normal environment. I was suggesting getting rid of all caches, and doing it manually bypasses any potential environmental issues you might be having. Since it’s a cache folder, there’s no need to be selective especially on an upgrade. Glad it worked, I knew that query looked impossible. 😊

       
liberty79's avatar
liberty79
135 posts
6 years ago
liberty79's avatar liberty79

thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.