Forum

Thread tagged as: Problem

Can't get past Software Update (and Continue)

One of my customers has asked me for help with an old Perch site (on release 2.4.2) she has, that we didn't develop and don't host.

As background, in Oct 2015, we took a look with a view to taking it on. We told them to leave the site as it was. That's because it didn't need enhancing, it worked, and the previous developer had developed the site by hacking into core code. We felt that updating the site beyond 2.4.2 would probably break it. The site's worked fine since then, and until now.

The customer went to log in (to do a news update), and gets the message 'Software Update' and 'Successfully updated to version 2.4.2.'. Clicking the 'continue' button just displays the same screen again. Version 2.4.2 is the same level the site was on back in Oct 2015. So, I'm unsure why logging on should display such a message.

I've requested FTP access (we don't host it) so I can look around. I'm wondering if the username I have isn't an admin user. I'm also wondering if the site's had the PHP version increased and that's the issue. When I get a chance I can look at these things and try to work out what's wrong. Anyone come across this or have any other ideas of what it might be?

Thanks, Graham

Graham Street

Graham Street 17 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

My bet would be on database table corruption. Log into MySQL and try repairing tables.

Thanks Drew. I'll try that as soon as I get access to the server.

More info now ...

The PHP level hasn't been changed (its still 5.3) so that's not the issue. I've made a database backup and repaired the tables. All were 'ok'. One could not be repaired - that was 'perch2_user_role_privileges' and is presumably because its InnoDB and not MyISAM? The repair hasn't changed anything and logging in is still not possible. Forgot to add that the public site's working fine.

Can I change perch2_user_role_privileges to MyISAM, just in case the environment I'm in doesn't support InnoDB?

Can I edit the 'userEmail' field to get the master/admin password reset? Or edit the password in the 'users' table?

Thanks, Graham

I've now managed to switch on Debug and found this in the first few statements (and see the screen shot).

Invalid query: SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'equestli_chrisb1.perch2_settings.userID' which is not in SELECT list; this is incompatible with DISTINCT

Screen Shot

Does this narrow down the cause and possible solution?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it looks like MySQL has been updated under you.

According to phpinfo, MySQL is at version 5.7.21 on this site's server. Does the error message make sense given that info? I've also temporarily got phpMyAdmin running and see this message ... "Your PHP MySQL library version 5.0.77 differs from your MySQL server version 5.7.21. This may cause unpredictable behavior".

If I managed to get the above fixed (both on the same levels) on that server, would Perch 2.4.2 likely work again?

If I can't get that changed, I may try to move the site to my hosting - where I can provide PHP 5.6 (my minimum currently supported) and where various levels of Perch are running (oldest is 2.8.34). I may then be able to keep this site going for the customer until she can consider having a rebuild with Perch used correctly and then put on the latest levels.

What do you think, Drew?

Drew McLellan

Drew McLellan 2638 points
Perch Support

If Perch hasn't changed then it's something in the hosting environment that has changed. As you're now having problems, I'd recommend running a supported version of Perch 2, which is currently only 2.8.34.

There's no reason you shouldn't be able to keep an old version running if the hosting doesn't change, but when it does, there's not much we can do if you can't update Perch.

Thanks Drew

You've concluded the same as me. Unfortunately we can't update Perch to 2.8.34 as we know the site will break. We tried before. The developer was oblivious to how Perch works and changed and renamed chunks of the core code. As a result, a simple update process will break the site. So, we are where we are - the site works and admin doesn't.

Incidentally, the same thing happened 3-4 years ago. I found this (same site) - https://forum.grabaperch.com/forum/11-24-2014-cant-login-to-perch-admin?page=1

In time, the current host is likely to pull old PHP levels (can't blame them) and then it will fail anyway. So, I'm suggesting the customer freezes the site (it works publicly) and plans for a replacement. In the meantime, we may try to move the site to my hosting to keep it stable for the next few months, as the customer isn't ready to have a new site yet. I've emailed you about the Perch licence for the site.

Thanks for your time on the old release question ... Graham

In case someone else searches and finds this thread ...

The problem's been fixed. The hosting server's MySQL had been updated to 5.7.21 a few months ago and this was the first time Perch Admin had been logged into for a few months. But the website had some special/different PHP environment/settings where the PHP MySQL library was on a much older version. This setup was probably to fix the issues encountered 3-4 years ago. The database has now been moved to a different setup in the existing hosting, and the site's now using PHP 5.6. As a result, Perch Admin works again.

In the meantime, we've also tested the entire site and admin on my hosting and it works there too. We are now awaiting a decision from the site owner on where to go forward from here. Most likely it will be a revised website in a few months, to get around the issues of the Perch core code being heavily modified and stopping us updating to the latest version of Perch.