TinyPortal

Development => Support => Installation => Topic started by: coyoteboy on September 30, 2017, 04:16:29 PM

Title: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 04:16:29 PM
Hi,

Hoping someone can help here. I have recently shifted an SMF site over to a different server. In order to move it, at the last minute, I had to run an upgrade process from 1.0.9 > 1.1.21 > 2.0.14. In this process, I think the TP installation died but the forum functioned fine.

I have been fruitlessly trying to install SimplePortal but getting installation errors I couldn't solve (parse problems). I figured I'd try to install TP instead, so downloaded the latest zip and went through the package manager. All the initial tests showed fine so I proceeded. On the next page update it says:
An Error Has Occurred!
Call to undefined function db_query()

I'm not 100% sure where it went wrong yet. Can anyone throw any pointers my way? IF I try to acces my main page I get a pain unformatted message, but if I try to access the admin pages through the back button I get the messages in the area the settings would normally be found.

Can anyone help me un-bork myself?

SMF 2.0.14, TP1.3, PHP7, apache2, mysql, ubuntu16.04.
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on September 30, 2017, 04:24:22 PM
Hi, sorry to hear you're having issues. Have you a link to your forum please
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 04:47:28 PM
Hi,

Thanks for the swift reply!

It can be found here:

http://gt4.bucklevision.co.uk

Cheers
James

Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on September 30, 2017, 04:52:47 PM
Thanks, reason I asked is so I could point you to,

http://gt4.bucklevision.co.uk/index.php?action=tpadmin;noblocks

If you can get to the TP admin try turning off your blocks until the site returns to normal.  Then see what block is causing the problem.

Code for SMF 2.0.xx is completely different from what's used in SMF 1.1.xx hence why you're probably having problems.
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 04:56:12 PM
Hmmm I see. I was under the impression it was fully compatible. Oops. I may end up restoring a backup, I guess!

Attached is all I get, and any menu choice leads to the same page.
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on September 30, 2017, 04:58:56 PM
Try this link instead, http://gt4.bucklevision.co.uk/index.php?action=tpadmin;sa=blocks;noblocks
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 05:01:24 PM
No luck  :'(
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on September 30, 2017, 05:03:03 PM
Hmmm I see. I was under the impression it was fully compatible. Oops. I may end up restoring a backup, I guess!

Attached is all I get, and any menu choice leads to the same page.

TP 1.5 should be ok running on php7 but you upgraded from SMF 1.1 to SMF 2.0 with a old version of TP installed which isn't compatible with php7
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 05:04:55 PM
After the upgrade to 2 all the mods were lost (in the package list but all showed as "install" with no option to remove.
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on September 30, 2017, 06:46:39 PM
Gave up, have reinstated backup and will figure out how to strip out all remnants of the old installation.

Thanks for your help though, much appreciated!
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 09, 2017, 04:06:21 AM
So I've decided to try to manually uninstall TP from this site (due to the corrupted nature of it). Naturally I can go in via phpmyadmin and remove all tp_ tables from the database, and bin all folders in the forum tree, but I don't know what else exists and would need to be flushed to effectively start from a fresh installation place. Is there a list of changes that TP makes when it installs? If I delete the tables, folders and any tp_ file I find, given that I think I've probably over-written anything tp related in the base forum phps with 2.0.14 files, should this be safe? I scanned through things like Settings.php and others and can't actually find any internal references to tp.
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on October 09, 2017, 10:26:36 AM
So you're getting rid of TP and not reinstalling it?

If that's the case, did you check the box "Remove all data associated with this modification" when you uninstalled TP?  Only do this if you're not going to reinstall TP.
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 09, 2017, 10:58:34 AM
Not exactly, no. I'm going to re-instate it but you said not to install over the top of an old install. However it's physically impossible for me to uninstall it using the normal method because I wasn't aware I had to uninstall it before upgrading from SMF 1.0.9 to SMF 2.0.14 and so it's lost any link to the original install in the upgrade process. In summary:




Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on October 09, 2017, 12:07:18 PM
So if you are running SMF 2.0.14 and emulate to SMF 2.0.9 in the package manager, the uninstall link wasn't showing? 

https://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version (same applies to uninstalling.
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 09, 2017, 12:25:37 PM
With emulate SMF 1.0.9 and TP 1.3 I get no "install mod" link (expected, I think)
when I upgraded from 1.0.9 to 2.0.14 I also lost that "install mod" link from TP 0.9, but also had no "uninstall" option - this was what scuppered me.
Title: Re: db_query error on 2.0.14 installation
Post by: illori on October 09, 2017, 03:43:51 PM
when you upgrade SMF, it uninstalls all mods. do if you had all clean files from the install, no mods would be installed and you can just go ahead and install TP. if you have now partly removed TP and some may still exist you just need to make sure no file edits exist and install TP.
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 10, 2017, 01:03:40 AM
OK with that thought in mind I scanned all files for reference of the TP mod and found nothing. I then tried to install TP 1.3, which worked to the extent that I got access to the TP admin centre and all went through without showing any errors, but when I go to the root of the forum URL I got:

Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sjbpepms_smf1.a.id_attach' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
File: <somepathinfo>forum/Sources/TPortal.php
Line: 1639

So I uninstalled it, dropped all existing tp_ tables from the database and re-installed, with the same result.

Reading this:
https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html (https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html)

It looks like I want to keep that enabled, but it seems like this is more fundamental to the TP code than just a server mode setting. Can anyone advise?
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 21, 2017, 03:24:17 PM
OK I'm confused. The download page clearly says it's PHP7.1 compatible, but fails due to 7's only_group_by mode.

Is this something that's been missed or something that my installation has messed up?
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on October 21, 2017, 04:58:15 PM
OK I'm confused. The download page clearly says it's PHP7.1 compatible, but fails due to 7's only_group_by mode.

Is this something that's been missed or something that my installation has messed up?

Could you please attach the TP zip that you're trying to install, and I'll check that all the edits were added.  It is quite possible I missed one somewhere.   
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 21, 2017, 05:39:20 PM
Hi, Sure! Here's the zip.
Title: Re: db_query error on 2.0.14 installation
Post by: Arantor on October 22, 2017, 03:57:17 AM
Before we go any further, part of the problem is the assumption that GROUP BY has anything to do with PHP - it absolutely doesn't.

PHP 7 doesn't do anything related to GROUP BY. Neither does PHP 7.1. They don't change how the database expects to be communicated with, the only_group_by stuff is a change made by MySQL themselves and I'd assume you've upgraded from something like MySQL 5.5 to MySQL 5.7 where this is a newer ruling they added for strictness.

You will want to turn this setting off because other parts of SMF and other SMF mods still rely on it (it's something that has been tackled in SMF 2.1)

Tackling this particular code in TP is a little tricky as it involves rewriting the query in a really complicated way but I'll see if I have any ideas as the day goes on.
Title: Re: db_query error on 2.0.14 installation
Post by: lurkalot on October 22, 2017, 04:08:35 AM
Thanks Arantor, that would be brilliant.  O0

I did wonder if it was a MySQL thing, after I googled the error. 
Title: Re: db_query error on 2.0.14 installation
Post by: coyoteboy on October 22, 2017, 09:18:11 AM
Yeah sorry folks, my very early morning brain screwed the two up. I need to sleep more.

You're right of course, it's not PHP at all.

I can turn off the setting, and I will, but I have other systems on this server that are expecting it (but not necessarily needing it).

Having read further into it (mysql isn't my thing) it looks like turning it off won't give any major issues and doesn't stop me doing what I need with my other systems. I'll disable it for now, but it would be nice to be up to current spec as it's not going to go away. I appreciate there may be other priorities though :)

Cheers folks