Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2023-01-11 17:36:58
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
DB column 'log' suddenly and unexpectedly
User_Error “Unknown column ‘ip’ in ‘light00_txp_log’”
there are no entries in the ‘log’ table
I always get this error displayed in the admin panel. After that I did an update to 4.8.8
The page works. How do I get rid of the error message. Below it still says:
textpattern/lib/txplib_admin.php:772 adminErrorHandler()
updateErrorHandler()
textpattern/lib/txplib_db.php:453 trigger_error()
textpattern/lib/txplib_db.php:588 safe_query()
textpattern/update/_to_4.5.7.php:32 safe_alter()
textpattern/update/_update.php:101 include()
textpattern/index.php:177 include()
it has nothing to do with the update, because the error came before.
Offline
Re: DB column 'log' suddenly and unexpectedly
Are you using any plugins that might collect or process IP addresses? We removed the column in Txp 4.7.0 a long time ago.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#3 2023-01-11 17:53:44
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
I have a little yab_shop and also a cooky popup. I don`t think, that it grabs an id. That is all. Should I delete this table?
Offline
Re: DB column 'log' suddenly and unexpectedly
Deleting the table might be a bit drastic!
Can you temporarily disable the plugins one by one without impacting your site too much? Just to see if the error goes away and if so, which plugin we need to hack.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#5 2023-01-11 18:12:46
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
Not possible? I get:
Sorry, the form could not be submitted. Please try again later.
Offline
#6 2023-01-11 18:21:56
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
the last plugin, I installed, was smd_tags. The error came when I was working with this tags. The plugin makes new tables in the db. But I worked with it since 3 days, without complication.
Offline
#7 2023-01-11 18:29:12
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
okay, I can begin to take off the plugs.
Offline
#8 2023-01-11 18:50:34
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
yab_shop take off, nothing happend, when I load the browser new. I loged out, after in again, then I activated the plug ins, and when I logged out, and in again, it wasn`t possible.
the website is functional except for the yab_shop. I can order a merchandise, the shopping cart shows the total, but when I then “go” to the checkout, no order is displayed there.
This error I get, when I want to login on admin-page.
Fatal error: Uncaught Error: Call to undefined function mysql_num_rows() in /var/www/vhosts/arteurope.de/arteurope.de/textpattern/plugins/yab_shop_add_language_de-de/yab_shop_add_language_de-de.php:4 Stack trace: #0 /var/www/vhosts/arteurope.de/arteurope.de/textpattern/lib/txplib_misc.php(1479): include() #1 /var/www/vhosts/arteurope.de/arteurope.de/textpattern/index.php(212): load_plugins() #2 {main} thrown in /var/www/vhosts/arteurope.de/arteurope.de/textpattern/plugins/yab_shop_add_language_de-de/yab_shop_add_language_de-de.php on line 4
Last edited by pexman (2023-01-11 18:53:02)
Offline
Re: DB column 'log' suddenly and unexpectedly
Okay, well that last error is due to PHP incompatibility. Which version of yab,_shop is it? I presume the latest 0.8.5? If so, I thought trenc had patched it for mysqli_* calls.
If you want to play with installing, enabling or disabling misbehaving plugins, add ?event=plugin (or it could be plugins, I never remember) to the URL and it’ll drop you on the plugins panel when you successfully log in.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#10 2023-01-11 20:36:52
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
Unfortunately, I can’t log in now. But I can access the database. I can edit the records.
Offline
#11 2023-01-11 20:47:10
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
I tried downgrading PHP to 7.4.30, but it has no effect. But I also get into the folder of textpattern/plugins and can edit the yab folders.
Offline
#12 2023-01-12 00:00:00
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
Re: DB column 'log' suddenly and unexpectedly
I can log in again. For this I had to delete some lines in /textpattern/plugins/yab_shop_add_language_en/yab_shop_add_language_en.php.
<?php
if (@txpinterface == ‘admin’)
{ if (mysql_num_rows(safe_query(“SHOW TABLES LIKE ‘”.PFX. “yab_shop_lang’”))) { $yab_shop_lang_code = ‘en-de’;if (!safe_count(‘yab_shop_lang’, “lang=’”.doSlash($yab_shop_lang_code).”’)) { yab_shop_add_language($yab_shop_lang_code); } else { return false; } } else { return false; }
} …I had to delete the first part and of course the bracket further down:
<?php
if (@txpinterface == ‘admin’)
{if (!safe_count(‘yab_shop_lang’, “lang=’”.doSlash($yab_shop_lang_code).”’”)) { yab_shop_add_language($yab_shop_lang_code); } else { return false; }
} …
Last edited by pexman (2023-01-12 00:01:25)
Offline
#13 2023-01-12 00:05:58
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#15 2023-01-14 23:07:45
- pexman
- Member
- Registered: 2016-02-27
- Posts: 65
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