Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2023-01-12 00:05:58
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
But the error message described at the beginning of this article
User_Error “Unknown column ‘ip’ in ‘light00_txp_log’”
I still have.
Offline
Re: DB column 'log' suddenly and unexpectedly
pexman wrote #334508:
For this I had to delete some lines
You could maybe have got away with just changing mysql_num_rows
to mysqli_num_rows
. Untested.
Anyway. I just looked at your OP in more depth and it seems the error is being triggered from the upgrade script.
That implies the upgrade hasn’t completed for some reason. If you’re sure that you have copied all files up correctly for v4.8.8 (check the Admin>Diagnostics panel to see if all checks pass and no warnings are there) then please check your database.
In phpMyAdmin (or equivalent) look in the txp_prefs table and find the version
string. What value is it?
When the upgrade completes successfully it sets this to the latest version number. If it’s anything lower then the upgrade script tries to run all the scripts in between that version and the latest.
So a way round this (last resort!) might be to log out of the Txp admin side, alter the version
string to, say, 4.6.0 and then log in to trigger the upgrade from that point forward. Hopefully it got far enough through the update to 4.5.7 before it hit the IP column roadblock so there won’t be much fallout. However, I’d advise against that, as some table column widths might not be altered properly.
A safer alternative is to simply log out, edit the file textpattern/update/_to_4.5.7.php and comment out line 32:
// safe_alter('txp_log', …);
Then log back in to retrigger the update. That will skip trying to alter the non-existent column, and the upgrade should then complete normally. When you’ve done that and verified that your version string reads 4.8.8, you can safely revert the change to the file above by uncommenting the line.
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 2023-01-14 23:07:45
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
You are probably right, because after updating and logging in again, no script seemed to run through.
The diagnosis shows no errors, only in the header area the already mentioned warnings showed up.
I add the deleted lines in the yab again and use your suggestion.
Wouldn’t it be better to do the installation again? The lines:
User_Error “Unknown column ‘ip’ in ‘light00_txp_log’”
in /var/www/vhosts/arteurope.de/arteurope.de/textpattern/lib/txplib_db.php at line 453.
indicate that some entry, a trigger perhaps, is not present.
What do you advise me to do if I reinstall again?
Offline
#16 2023-01-14 23:50:19
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
Surprise
In phpMyAdmin (or equivalent) look in the txp_prefs table and find the version string. What value is it?
The version is 4.5.0.
Offline
Re: DB column 'log' suddenly and unexpectedly
The problem is that the column doesn’t exist (presumably it was removed during an upgrade attempt) but the upgrade script didn’t finish. So as far as Textpattern is concerned, your installation is still on an old version.
Thus, every time you log in or refresh the page it tries to run the scripts from that version onwards.
When it encounters the line that tells it to remove the ip column, it can’t do so because it’s already deleted. And the upgrade falls over.
What we should have done is check first in the upgrade script and only perform the deletion if it hadn’t been done already. We can change that in future installs so this doesn’t happen again but in your case, the damage is done.
Hence, if you comment out that line I mentioned and log in, it should silently skip the erroneous operation and carry on with the upgrade. When it gets to the end, it’ll set your version string to 4.8.8 and from that point on, you’ll be fine as it won’t keep trying to trigger the upgrade.
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
#18 2023-01-15 18:03:08
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
i did it this way, but only got as far as 4.5.7. The next version would be the 4.6.0 but it does not go through. I can edit the tables of the database. What also puzzles me is the message:
User_Error “Duplicate entry ‘default’ for key ‘name’”
in /var/www/vhosts/arteurope.de/arteurope.de/textpattern/lib/txplib_db.php at line 453.
That means there is a duplicate entry, doesn’t it?
Offline
Re: DB column 'log' suddenly and unexpectedly
Drat. That’s another error due to a partial upgrade. This is getting tricky to unpick. I wonder why it failed in the first place. Hmmm …
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 2023-01-16 19:49:06
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
I have disabled several lines in the textpattern/update/_to_6.0.0 file that were specified in the error message.
// Not using safe_create_index here, because we just dropped the index.
//safe_alter('txp_css', "ADD UNIQUE name (name(250))");
safe_alter('txp_file', "ADD UNIQUE filename (filename(250))");
//safe_alter('txp_form', "ADD PRIMARY KEY (name(250))");
//safe_alter('txp_page', "ADD PRIMARY KEY (name(250))");
safe_alter('txp_section', "ADD PRIMARY KEY (name(250))");
safe_alter('txp_prefs', "ADD INDEX name (name(250))");
safe_alter('textpattern', "ADD INDEX section_status_idx (Section(249), Status)");
safe_alter('textpattern', "ADD INDEX url_title_idx (url_title(250))");
// Specifically, txp_discuss_nonce didn't have a primary key in 4.0.3
// so it has to be done in two separate steps.
safe_drop_index('txp_discuss_nonce', "PRIMARY");
//safe_alter('txp_discuss_nonce', "ADD PRIMARY KEY (nonce(250))");
With the following success
Diagnostics
Pre-flight check
Some Textpattern files have been modified:
../textpattern/update/_to_4.5.7.php,
../textpattern/update/_to_4.6.0.php Help
But in the database now:
txp_prefs
name val
Version 4.8.8
Please, tell me what to do.
Last edited by pexman (2023-01-16 19:50:11)
Offline
#21 2023-01-16 20:05:59
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
Don`t know. if it is important:
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: opcache_get_status Help
Offline
Re: DB column 'log' suddenly and unexpectedly
pexman wrote #334522:
I have disabled several lines
That’s probably thr best thing you can do when an upgrade is botched like this. It’s dirty but at least it bypasses the choke points and means …
txp_prefs
name val
Version 4.8.8
Which is exactly what should happen.
You can now safely revert all your changes to the update files and hopefully everything will work fine from this point forward.
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
Re: DB column 'log' suddenly and unexpectedly
pexman wrote #334523:
Don`t know. if it is important:
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: opcache_get_status Help
Shouldn’t be an issue. Only important if you’re using that feature.
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
#24 2023-01-17 16:35:15
- pexman
- Member
- Registered: 2016-02-27
- Posts: 63
Re: DB column 'log' suddenly and unexpectedly
Okay, thank you. I can`t restore the delete lines in plugin yab-language…, recieve error-messages, but otherwise everything works fine. Thank you for help to solve my problem.
Offline