TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 16, 2024, 05:54:21 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,158
  • Total Topics: 21,219
  • Online today: 106
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 86
  • Total: 86

db_query error on 2.0.14 installation

Started by coyoteboy, September 30, 2017, 11:16:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

coyoteboy

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.

lurkalot

Hi, sorry to hear you're having issues. Have you a link to your forum please

coyoteboy

Hi,

Thanks for the swift reply!

It can be found here:

http://gt4.bucklevision.co.uk

Cheers
James


lurkalot

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.

coyoteboy

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.



lurkalot

Quote from: coyoteboy on September 30, 2017, 11: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.

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

coyoteboy

After the upgrade to 2 all the mods were lost (in the package list but all showed as "install" with no option to remove.

coyoteboy

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!

coyoteboy

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.

lurkalot

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.

coyoteboy

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:


  • 1.0.9 - Forum had TP 0.9 installed but needed porting to new server. New server ran new PHP7 so needed to upgrade SMF to 2.0.14.
  • Upgraded to SMF to 2.0.14, no trace of TP visible other than package list, showing as not installed.
  • Didnt know I needed to uninstall TP to do the upgrade, so left it all installed
  • Tried to upgrade TP to 1.3 - errors all over the show, looked to find out why - hadn't uninstalled TP 0.9
  • Now stuck with TP 0.9 database features and some php files but no reference to TP in the main forum PHP, and want to install TP 1.3




lurkalot

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.

coyoteboy

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.

illori

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.

coyoteboy

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

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?

coyoteboy

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?

lurkalot

Quote from: coyoteboy on October 21, 2017, 10: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?

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.   

coyoteboy


Arantor

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.

lurkalot

Thanks Arantor, that would be brilliant.  O0

I did wonder if it was a MySQL thing, after I googled the error. 

coyoteboy

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