Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2012-08-31 20:10:50

andrewowens
New Member
From: Chicago, IL
Registered: 2012-08-30
Posts: 9

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Thanks Ruud. Unfortunately, any attempts at accessing the admin side are met with:

internal_error.
get_off_my_lawn: ,

Do you think this is a database issue? One thing I noticed when I did a clean install of 4.5 is that the textpattern database had two parts, the information_schema and the actual textpattern database. In the 4.0.7 version, there’s no information_schema.

I even tried importing the backup of the 4.0.7 database into the 4.5 database but it wouldn’t work.

Andy

Last edited by andrewowens (2012-08-31 20:13:22)

Offline

#14 2012-08-31 20:24:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Hmmm Unknown column 'user_name' in 'where clause' is a known and expected issue as part of the upgrade to 4.2.0, but it should be temporary and normally goes away after second login (which of course, you can’t do in this case because of the broken lawn).

Can you remember if you ever got as far as the login page, or actually managed to login at all after updating the files to 4.5.0? That might give us a clue if something broke during the database upgrade script(s), or if it’s a corrupt file upload or something. Perhaps if you step us through exactly what you did and what you saw/noticed/what didn’t go as expected, it might shed some light on things.

I’m curious about the information_schema. Where do you see that? In phpMyAdmin? [EDIT: re-read your OP and found the answer to that!] I don’t see it in my version, though I know that MySQL uses it internally.. Weird that the two DBs differ in this regard. Might just be a version thing if your old 4.0.8 installation was on a prior version of MySQL that handled things differently (I’m not a wiz at MySQL so I’ll leave any diagnostics of this portion to other professionals here!)

Last edited by Bloke (2012-08-31 20:27:17)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2012-08-31 20:35:11

andrewowens
New Member
From: Chicago, IL
Registered: 2012-08-30
Posts: 9

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

As far as I can remember, after upgrading to 4.5 I went to visit the site’s homepage. I noticed that dynamic content wasn’t loading – there’s a random image on the homepage.

From there I went to the admin section and received the get off my lawn error. I don’t believe I could get into the admin section after the 4.5 upgrade.

I’m not a database guy either. The site was made in 2008. I imagine there’ve been all sorts of upgrades to PHP and MySQL since then. I know that GoDaddy, the host, no longer supports PHP 4.x, which is what was in place at the time of development. Now they’re pushing PHP 5.3.

When I did the clean install of TXP 4.5, I created a new database. According to GoDaddy, the new DB is on MySQL version 5.0 whereas the old DB is on MySQL version 4.1.

Offline

#16 2012-08-31 20:56:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

I can reproduce the error, starting with a fresh install of TXP 4.0.8 (setup completed), then install TXP 4.5. This probably affects all upgrades from pre-4.1 versions to TXP 4.5.

/textpattern/index.php

line 86: set_error_handler('adminErrorHandler', error_reporting());
line 94: $prefs = get_prefs();

/textpattern/lib/txplib_db.php

line 506: $r = safe_rows_start('name, val', 'txp_prefs', 'prefs_id=1 AND user_name=\'\'');

That probably fails because the user_name column was added in TXP 4.2 and the database update to 4.2 hasn’t happened yet at this point (if you’re upgrading from pre-4.2). This triggers adminErrorHandler:

/textpattern/lib/txplib_misc.php

line 571: if ($production_status != 'live' && in_array($errno, array(E_ERROR, E_USER_ERROR))) {
line 572:    die($c['in'].gTxt('get_off_my_lawn', array('{event}' => $event, '{step}' => $step)).$c['out']);
line 573: }

Resulting in the “get of my lawn” error. Interesting is that this triggers only when $production_status != ‘live’… but $production_status isn’t defined on the admin side yet at this point. That happens only after the prefs are extracted (see above), and that precisely what TXP tried to do when this happens.

WORKAROUND
Edit /textpattern/config.php and add this just above the ?> line:

$production_status = 'live';

Then log in on the admin side. It’ll perform the database update. Afterwards, remove that line again from config.php.

Bloke, wet, there’s probably a cleaner solution. Feel free to jump in.

Offline

#17 2012-08-31 21:11:44

andrewowens
New Member
From: Chicago, IL
Registered: 2012-08-30
Posts: 9

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

You. Are. Awesome. Thank you many times over!

That worked perfectly. No errors on the public-facing side. No errors on admin login. No logging in with every page change in the admin side.

Is there anything I can do to repay you?

Offline

#18 2012-08-31 21:41:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

You already did by responding like that :)

Offline

#19 2012-08-31 22:10:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

ruud wrote:

I can reproduce the error

Eegads. Today’s super-sleuthing brain plaudits go to you, good sir. A fine diagnosis.

And you’re right, we should either document this in the upgrade notes or (better) find some way round it. Quite how I don’t know yet.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#20 2012-09-01 02:38:48

echols85
New Member
Registered: 2012-08-31
Posts: 4

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Ruud, thanks so much! That worked like a charm.

Offline

#21 2012-09-01 06:29:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Issue 258 tracks this bug.

I think we can either use !defined('TXP_UPDATE'), isset($production_status) or $dbversion === $thisversion as an additional condition inside adminErrorHandler() to catch this and similar issues.

Offline

#22 2012-09-02 08:51:47

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Fixed in r4091. Please test.

Offline

#23 2013-01-23 21:12:05

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Will this – direct – upgrade to the most recent version (4.5.4) also work when coming from 4.0.4 or 4.0.6? Thanks!

Offline

#24 2013-01-24 06:07:20

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

It will. Plugins are a separate issue, though.

Offline

Board footer

Powered by FluxBB