Advertisement:

Author Topic: "Updated Topics" error  (Read 5899 times)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
"Updated Topics" error
« on: May 13, 2016, 04:51:13 PM »
I'm getting the same error now. It's also an upgrade and the "unwatched" column is in the database. Anyone have any ideas? TIA

Database Error
Unknown column 'lt.unwatched' in 'where clause'
File: .../forum/Sources/Recent.php
Line: 891

Split from year old topic and error code pasted into this message from that topic.  Please avoid raising old topics in high traffic boards like this one in the future - Iris.
« Last Edit: May 13, 2016, 05:21:33 PM by Irisado »

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: "Updated Topics" error
« Reply #1 on: May 13, 2016, 07:40:53 PM »
This was fixed ages ago.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #2 on: May 14, 2016, 09:57:43 AM »
This was fixed ages ago.

Umm, maybe, but not for me. I'm using the latest version, 2.1 beta 2, and I assure you I'm not imagining it.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: "Updated Topics" error
« Reply #3 on: May 14, 2016, 10:40:40 AM »
What do YOU mean by "latest" version?

Because the beta2 from our diwnload site is now outdated... the latest version, on github is almost ready for beta3
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #4 on: May 14, 2016, 11:05:42 AM »
What do YOU mean by "latest" version?

Because the beta2 from our diwnload site is now outdated... the latest version, on github is almost ready for beta3

So...if I install the latest update from the github site, it will fix the issue? Maybe it would have been better for me, and saved us all time, if someone had just helpfully told me that you need to get the latest development update from github to fix the problem.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #5 on: May 14, 2016, 11:17:18 AM »
And for the record, the latest github download did not fix the issue. So... I guess I'll just wait till beta 3 is actually finished, which will hopefully resolve it.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #6 on: May 14, 2016, 11:30:46 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #7 on: May 14, 2016, 11:34:51 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #8 on: May 14, 2016, 11:36:55 AM »
@shapeshifter

I found that the 'unwatched' column is added by 'other/upgrade_2-1_mysql.sql' - perhaps you could try running 'other/upgrade.php' and see if that fixes this issue for you - if not, you could try to manually run the SQL file (e.g. use phpmyadmin or similar tools after making a backup).

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #9 on: May 14, 2016, 11:40:06 AM »

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(

No one is putting any blame on anyone.  I already adressed the issue.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #10 on: May 14, 2016, 11:54:28 AM »
@shapeshifter

I found that the 'unwatched' column is added by 'other/upgrade_2-1_mysql.sql' - perhaps you could try running 'other/upgrade.php' and see if that fixes this issue for you - if not, you could try to manually run the SQL file (e.g. use phpmyadmin or similar tools after making a backup).

PS: Why am the first one actually addressing the issue instead of putting blame on @shapeshifter, whose only mistake is trusting the SMF download section being up to date? :(

This is what the current db structure looks like now, if anyone notices anything amiss feel free to point it out:



But thanks, qc. Maybe I'll try a new install later and see how it goes. I suspect it might not be a problem if I did a completely new install, but I upgraded an old 2.0 forum with existing database and I'm guessing that's at the root of the problem, somehow.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,551
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: "Updated Topics" error
« Reply #11 on: May 14, 2016, 11:55:21 AM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)


Run this on your hosting's phpmyadmin or similar:

ALTER TABLE {$db_prefix}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';

UPDATE {$db_prefix}log_topics
SET unwatched = 0;

replace {db_prefix} with the actual prefix of your tables.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #12 on: May 14, 2016, 12:15:14 PM »
@shapeshifter Is that the structure of the log_topics table? If yes, is the error message you are now getting exactly as stated in your initial posting?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #13 on: May 14, 2016, 12:19:05 PM »
DB related errors cannot be solved by just uploading a fresh set of files, you need to either run the upgrade process again or manually add/remove the DB column. Yes, this is why we don't encourage installing a beta on your production forum.


I just ran the upgrade process again, and the problem remains. And the DB columns are all there, so I'm not sure what I'd need to change. And I'm not using it on a live site. But thank you for not treating me like an enemy combatant. :)


Run this on your hosting's phpmyadmin or similar:

ALTER TABLE {$db_prefix}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';

UPDATE {$db_prefix}log_topics
SET unwatched = 0;

replace {db_prefix} with the actual prefix of your tables.

Okay, I'm guessing by the error I got that I maybe picked a wrong server db option during the initial upgrade, because I'm seeing this:

Quote
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{$db_smf}log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0'' at line 1


I don't know anything about MariaDB, so I confess the fault may have been entirely mine. I'll have to see about a complete redo when I get the time. Thank you

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #14 on: May 14, 2016, 12:22:19 PM »
@shapeshifter Is that the structure of the log_topics table? If yes, is the error message you are now getting exactly as stated in your initial posting?

Yes, and the exact error is:

Database Error
Unknown column 'lt.unwatched' in 'where clause'
File: /home/..../public_html/forum/Sources/Recent.php
Line: 891

But see my last post above. I may have upgraded incorrectly. I make no claims to being very bright when it comes to all this db stuff. ;)
« Last Edit: May 14, 2016, 12:35:12 PM by shapeshifter »

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #15 on: May 14, 2016, 12:42:49 PM »
@shapeshifter You need to replace {$db_prefix} in the code Suki gave you with the correct database prefix, i.e. {$db_prefix}log_topics must be replaced with the correct / full name of the log_topics table in your database.

It seems that right now, you just replaced it with {$db_smf} ? Perhaps your database prefix is not set up correctly in your Settings.php?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #16 on: May 14, 2016, 01:03:43 PM »
@shapeshifter You need to replace {$db_prefix} in the code Suki gave you with the correct database prefix, i.e. {$db_prefix}log_topics must be replaced with the correct / full name of the log_topics table in your database.

It seems that right now, you just replaced it with {$db_smf} ? Perhaps your database prefix is not set up correctly in your Settings.php?

I actually tried every combination I could think of, just because I didn't count on myself to know what I was doing, but every one resulted in an error. The table is named "smf_log_topics." Would you mind writing out the query for more me just so that I know it's idiot-proof? If I copy and paste it and it still doesn't work, at least I'll know I'm not going crazy.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #17 on: May 14, 2016, 01:13:23 PM »
Well, if you execute the following SQL query...
Code: [Select]
ALTER TABLE smf_log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';
...you might get an error, because you already seem to have that "unwatched" column in your smf_log_topics table.

But if you execute...
Code: [Select]
UPDATE smf_log_topics
SET unwatched = 0;
...you should not get any error, right?

Can you confirm that the Settings.php in your forum root folder contains the following entry?
Code: [Select]
$db_prefix = 'smf_';
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #18 on: May 14, 2016, 01:22:08 PM »
Well, if you execute the following SQL query...
Code: [Select]
ALTER TABLE smf_log_topics
ADD COLUMN unwatched TINYINT(3) NOT NULL DEFAULT '0';
...you might get an error, because you already seem to have that "unwatched" column in your smf_log_topics table.

But if you execute...
Code: [Select]
UPDATE smf_log_topics
SET unwatched = 0;
...you should not get any error, right?

Can you confirm that the Settings.php in your forum root folder contains the following entry?
Code: [Select]
$db_prefix = 'smf_';

Okay, believe it or not, I'd just figured it out before you replied, but thank you. I was thinking I had to include the brackets in the command, rather than realizing they were basically just a parenthetical reference. Doh. Anyway, you are correct, I did get a duplicate column error. I tried your command and it executed but it didn't fix the problem, unfortunately. And yes, I can confirm that Settings.php has the correct entry: $db_prefix = 'smf_'; (That's a copy and paste from the file.)

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #19 on: May 14, 2016, 02:31:43 PM »
It seems your database is correct.

* Are you using the correct database in your Settings.php or perhaps pointing to another, older one?
* Did you download the most up-to-date code from https://github.com/SimpleMachines/SMF2.1/archive/release-2.1.zip (note that it is the release-2.1 branch, not master or development)?
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #20 on: May 14, 2016, 06:56:22 PM »
Yes, it's the correct database in settings.php, and that release is the one I used to update this morning. Thanks

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #21 on: May 14, 2016, 07:47:52 PM »
Ok, so if nobody else has a better idea, I would suggest you to do the following:
  • Open Sources/Recent.php
  • At line 909 you should find the following code: list ($num_topics, $min_message) = $smcFunc['db_fetch_row']($request);
  • Add a new line just before that line 909 with the following code: die(print_r($request, true));
  • Try to reproduce the error. You should see some debug output. Please post that output here and revert your changes made to Sources/Recent.php.
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #22 on: May 14, 2016, 08:02:00 PM »
I found it on line 913 and added your code before it and got this as soon as I clicked "Unread Posts":

mysqli_result Object ( [current_field] => 0 [field_count] => 2 [lengths] => [num_rows] => 1 [type] => 0 )

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #23 on: May 14, 2016, 08:05:20 PM »
I found it on line 913
Ah, would you mind posting lines 891 to 913 of your Recent.php here then? You seem to have another version of that file than at github ( https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Recent.php#L891 )!
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #24 on: May 14, 2016, 08:17:00 PM »
I found it on line 913
Ah, would you mind posting lines 891 to 913 of your Recent.php here then? You seem to have another version of that file than at github ( https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Recent.php#L891 )!

Well, I definitely did download the zip from github and upgraded, got the upgrade menu and went through the usual steps, so I'm not sure why that file wouldn't have been updated. This is the page I got it from, in case there's another I missed somewhere:

https://github.com/SimpleMachines/SMF2.1

But good news! It's fixed! All I needed was for you to point out that something was off with the lines and to see that page you linked to, copied it over to my own recent.php file and now everything works. Wow! Thanks so much for your patience and going back and forth with me on this all day. It's very much appreciated.

Offline qc

  • Jr. Member
  • **
  • Posts: 140
Re: "Updated Topics" error
« Reply #25 on: May 14, 2016, 08:28:09 PM »
Better make sure all your files are really updated to the newest version at github - https://github.com/SimpleMachines/SMF2.1/archive/release-2.1.zip

At least you thoroughly tested the SMF 2.1 database upgrade process today ;)
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Offline shapeshifter

  • Semi-Newbie
  • *
  • Posts: 29
Re: "Updated Topics" error
« Reply #26 on: May 14, 2016, 11:04:36 PM »
I've actually deleted the contents of the entire directory at least twice today, did a full install with 2.1 beta 2 and then upgraded with the github package each time. I'm not sure how any file couldn't have been overwritten/updated already - which is why it didn't occur to me that the recent.php file might not be the correct one. Bit of a mystery. But I guess that means you're right, I should maybe do it one more time, just in case.  O:)

Thanks again!

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: "Updated Topics" error
« Reply #27 on: May 15, 2016, 05:36:35 PM »
no no no no no....   that won't work


that's why we say don't use the beta unless you know what you are doing.

You can not upgrade between beta versions

You need to either do a clean install of the NEWEST beta from github -- or do an upgrade from 2.0.x
there is no upgrade path from beta to beta
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,295
Re: "Updated Topics" error
« Reply #28 on: May 15, 2016, 06:36:07 PM »
You can not upgrade between beta versions

You need to either do a clean install of the NEWEST beta from github -- or do an upgrade from 2.0.x
there is no upgrade path from beta to beta

yes there is an upgrade path from beta to beta, you can still upgrade from a beta to another beta. this was discussed but has not changed in behavior. bugs that have been reported on the upgrade process from a beta to a beta are still being fixed.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: "Updated Topics" error
« Reply #29 on: May 15, 2016, 08:01:48 PM »
I was told very clearly that there was no and would be no database update script for beta to beta...   
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,295
Re: "Updated Topics" error
« Reply #30 on: May 15, 2016, 08:28:04 PM »
well it seems to be working and related bugs are still being fixed. the person that made that decision did not let others know that may or may not be on the dev team.