Advertisement:
2by2host

Author Topic: Error in database (?)  (Read 673 times)

Offline GUNNERPT

  • Semi-Newbie
  • *
  • Posts: 38
Error in database (?)
« on: June 08, 2012, 05:54:34 AM »
Hello,

Last Monday I made a full backup of my website / SMF forum 2.0.2, and then i found that when people try to post a youtube link in the forum, they get the following error:

Quote
Warning: mysql_real_escape_string () expects parameter 2 to be resource, boolean Given in / home / *** / public_html / forum / Sources / Subs-Db-mysql.php on line 140

I tried to repair the database using the "repair database" function in the CPanel., but it didn't work.

Oh ... Before making the backup I have eliminated some .core files that has emerged in my website

I contacted my webhost service and they suggested to me that I should check the error_log file to see what were the errors that were causing those .core files. And then i should fix those errors.

Well ... The file is full of errors like the one i quoted above. I don't have any idea how to fix it.

I discovered that it was not possible to post new videos from youtube in the forum, but I noticed that those videos who had been previously posted were still working properly.

I uninstalled Aeva Media Gallery and then i found that it was possible to post new links again, but it was not possible to watch any youtube videos inside of the forum.

So I installed AEVA Lite and found that it  returned to the situation before: i can watch the videos previously posted, but it is not possible to post new links.

I don't know whta else i can do ... this situation causes huge inconvenience to my forum. :(

Can anyone, please, help me?

Thank you.



Online Storman™

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,422
Re: Error in database (?)
« Reply #1 on: June 08, 2012, 06:06:42 AM »
Quote
Oh ... Before making the backup I have eliminated some .core files that has emerged in my website

Can you elaborate on that point. No idea what you are referring to ?

Quote
I uninstalled Aeva Media Gallery and then i found that it was possible to post new links again, but it was not possible to watch any youtube videos inside of the forum.

So I installed AEVA Lite and found that it  returned to the situation before: i can watch the videos previously posted, but it is not possible to post new links.

Sounds like your issue relates to the Aeva mod so you really need to post in the mod's own topic located here

I've seen that issue before with Aeva which seems to relate to a mismatch between versions, especially when uninstalling and reinstalling. If you look in the Aeva topic I think there's something about it somewhere in there.

Think these are two separate issues that are unrelated though.
Any Backup method is bettter than no Backup method....

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,817
    • wedgebook on Facebook
Re: Error in database (?)
« Reply #2 on: June 08, 2012, 09:18:18 AM »
-sigh- It isn't an issue with Aeva. It is almost certainly an issue with other mods conflicting with Aeva that causes the links problem.

.core files are where the webserver crashes, very often related to host configuration issues.

Also, with respect to the database issue, that is NOT Aeva related. That is related to an issue with MySQL itself and searching for that exact error would find you a lengthy discussion as to what causes it and a fix from me to the code to prevent it.

Offline GUNNERPT

  • Semi-Newbie
  • *
  • Posts: 38
Re: Error in database (?)
« Reply #3 on: June 08, 2012, 10:27:45 AM »
Tks.

I don't think it is an Aeva problem, too. But ... i didn't install any mod recently ... i don't understand why this is happening now. These are de mods i got installed in my SMF:

1. SMF Arcade 2.5 RC1.1C 
2. Aeva ~ Auto-Embed Video & Audio 7.2   
3. SMF 2.0.1 Update 1.0 
4. AjaxChat Integration 3.2.1 (modified for SMF 2 RC3)
5. SMF 2.0.2 Update 1.0 
6. Spoiler Tag 0.7.2a 

I'm using SMF 2.0.2 (pt_pt); Theme BlackBox by Crip.

I'm attaching de error_log files from my website: home (joomla); forum (SMF); chat (ajax); and the .php file. I don't know if i can leave here any other information so somebody can help me.

I googled for this error and i found another topic like this (http://www.simplemachines.org/community/index.php?topic=423482.0), but it is about an error in the line 143, not in the line 140 (like in my case).

I saw there people talking about changing code ... OMG, i don't understand nothing about those codes :(

There's anything else i can do? I remember a SMF tool called repair_settings, can this be usefull? Should i re-install SMF? I don't want to lose a forum with 470 member, 2314 topics and 116899 msgs.

 :(
« Last Edit: June 08, 2012, 10:48:03 AM by GUNNERPT »

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,637
Re: Error in database (?)
« Reply #4 on: June 08, 2012, 10:55:50 AM »
The "home" errors list lots of "rvs" errors. That has nothing to do with SMF. There are also "out of memory" errors -- can you work with your host to increase your allocated memory size for PHP? You appear to have a very small amount allowed. You're also running Joomla, which is going to demand a lot of memory.

I see a lot of "aba_portal_in" undefined index errors. Did you try installing, or try removing, some sort of portal? If so, the job was incomplete. You will need to "parse" the mod install instructions and manually fix the code (a tough job if you can't even spell PHP!).

I saw one or two "cache" errors (missing cache file). When you get those, you need to go to the SMF cache directory and erase all .php files there. If you keep having problems, just turn off SMF caching. It's often more trouble than it's worth.

repair_settings probably isn't going to help with any of the errors you're seeing. Neither probably will phpMyAdmin's CHECK and REPAIR utilities (although it wouldn't hurt to CHECK for any database problems, and fix them if found). Worst case, you can get the "Large upgrade" package and overwrite all your SMF .php files with fresh copies, and then install your mods again. That should cure the aba_portal_in problem. Needless to say, back up your files and database (using phpMyAdmin) first, and don't use FileZilla until you understand how to force it to properly handle extension-less files.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline GUNNERPT

  • Semi-Newbie
  • *
  • Posts: 38
Re: Error in database (?)
« Reply #5 on: June 08, 2012, 11:21:34 AM »
I see a lot of "aba_portal_in" undefined index errors. Did you try installing, or try removing, some sort of portal? If so, the job was incomplete. You will need to "parse" the mod install instructions and manually fix the code (a tough job if you can't even spell PHP!).

No ... "aba" (in portuguese) it's just a button i created in SMF menu a long ago ... it's a shortcurt to my joomla portal.

I saw that error to ... when i look into my SMF Admin Panel/Error log ... theres a lot of errors like that ... and all those errors are originated by the same user ... i got more than 70 pages of those errors ... always the same error and the same user :x

I saw one or two "cache" errors (missing cache file). When you get those, you need to go to the SMF cache directory and erase all .php files there. If you keep having problems, just turn off SMF caching. It's often more trouble than it's worth.

OMG ... before i made the backup i mentioned at the first post, i deleted those .core files to free some disc space ... and i deleted some temporary files (?) at home/tmp   .... i think i deleted a cache file there :x ... can this be the problem ? :x

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,637
Re: Error in database (?)
« Reply #6 on: June 08, 2012, 12:13:18 PM »
You can safely delete all the cache files (.php) in the SMF "cache" directory. SMF will recreate them.

Be sure to talk with your host about the core files you're getting (unless they only happen once in a great while). A core file is created when a program such as the server, PHP, MySQL, etc. crash, and that's not a good thing to have happen. It could certainly be associated with some of the other errors you're getting.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline GUNNERPT

  • Semi-Newbie
  • *
  • Posts: 38
Re: Error in database (?)
« Reply #7 on: June 08, 2012, 09:27:17 PM »
Tks Phil.  ;)

I deleted the php files but the problem was not resolved.

However I noticed that below that error I mentioned earlier, this message also appears:

Quote
MySQL server has gone away
File: / home / **** / public_html / forum / Sources / Post.php
Line: 1288

Note: It appears that your database needs updating. The files are in version SMF 2.0.2, while your database is at version 2.0. The error can be eliminated if you run the latest version of upgrade.php.

Can this be the problem? How can i update my database?

However I also noticed that the error only occurs if I put the video link from youtube. If I put the link given through the "incorporate" tool at the youtube, does not appear any error when posting this link on the forum. For example:

Error: http://www.youtube.com/watch?v=fJ9rUzIMcZQ

No error: http://youtu.be/fJ9rUzIMcZQ

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,637
Re: Error in database (?)
« Reply #8 on: June 09, 2012, 10:15:00 AM »
"MySQL server has gone away" means you're having database problems (i.e., it is probably crashing constantly). Talk with your host about it. If they simply don't have the horsepower to run your site, with its database demands, you'll have to find a better host. Also check for "core" files being produced, and erase the old ones so they don't fill up all your disk space. Your host will want to look at the newer ones.

Don't worry about the database update. It's not needed. That's just something the developers keep in to amuse themselves by scaring users. There is no difference between 2.0 and 2.0.2 databases. If it bugs you to see this, go into phpMyAdmin and update it:
Code: [Select]
UPDATE `smf_settings` SET `value` = '2.0.2' WHERE `variable` = 'smfVersion'
As for the YouTube-related problems, I would suggest asking about this in the Aeva support topic.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,817
    • wedgebook on Facebook
Re: Error in database (?)
« Reply #9 on: June 09, 2012, 10:23:56 AM »
Quote
Don't worry about the database update. It's not needed. That's just something the developers keep in to amuse themselves by scaring users.

Is it wrong to admit I chuckled at that? There are a *few* times it's been genuinely accurate and useful but most of the time the error alone will tell you at least as much information, and it would be better to remove, really.

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,637
Re: Error in database (?)
« Reply #10 on: June 09, 2012, 10:50:24 AM »
It should be removed unless there is a genuine difference in database schemas between the versions. How about in Settings.php or some file updated with every code update (maybe as an include to Settings.php):
Code: [Select]
$allowable_database = array('2.0', '2.0.2');and in error messages, if the database's smfVersion falls within this range, don't say anything. Otherwise, give the database version mismatch message. The array might have to be a little more complicated to enable comparisons, but that's minor:
Code: [Select]
$allowable_database = array(array(2,0,0), array(2,0,2));SMF 2.0.3 would have (2,0,0) through (2,0,3), unless the database actually changes in that revision.

Quote
Is it wrong to admit I chuckled at that?
Hey everybody! @Arantor is lightening up! Pass the word!
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,817
    • wedgebook on Facebook
Re: Error in database (?)
« Reply #11 on: June 09, 2012, 11:10:35 AM »
Quote
It should be removed unless there is a genuine difference in database schemas between the versions. How about in Settings.php or some file updated with every code update (maybe as an include to Settings.php):

That's the thing: there is no one file updated with every update. Every update is a list of code changes, and while you could theoretically do that, it's just one more thing to screw up.

Honestly, I would simply avoid it entirely. IIRC, there hasn't been a schema change in 2.0 since RC4 while there hasn't been a schema change in 1.1.x since 1.1.9 (again IIRC), and in both cases the error message is going to be as meaningful to observe as this error is.

The other sad part is that it is absolutely possible to directly update the version from package-info.xml files, and it should even work in 1.1.x.

Inside the <install> block:

Code: [Select]
<code type="inline"><![CDATA[<?php
 updateSettings
(array('smfVersion' => '2.0.2'));
?>
]]></code>

Job done, directly from the installer, no extra files, no extra mess.

Of course, people doing manual installs will still have a problem, but they'd have a problem pretty much whatever they did anyway, but perhaps it'd clue them into the fact that they should do some other kind of change.

Quote
Hey everybody! @Arantor is lightening up! Pass the word!

Lightening up? From where I'm standing it's more like other people are seeing the mess that things are from my jaded and cynical standpoint. I chuckled not because I'm lightening up but because someone else is actively seeing the mess that things are and is prepared to admit it in a less than pleasant fashion. From my perspective that's a win.

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,637
Re: Error in database (?)
« Reply #12 on: June 09, 2012, 12:03:02 PM »
The other sad part is that it is absolutely possible to directly update the version from package-info.xml files, and it should even work in 1.1.x.
Well, wouldn't that be assuming that any necessary database upgrade has in fact been properly done? That may be a dangerous assumption. Certainly, if a database upgrade is needed, your XML code shown should not be run, but let the database upgrade itself do that.

Quote
I chuckled not because I'm lightening up but because someone else is actively seeing the mess that things are and is prepared to admit it in a less than pleasant fashion. From my perspective that's a win.
Ah, Great Minds think alike! :)
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,817
    • wedgebook on Facebook
Re: Error in database (?)
« Reply #13 on: June 09, 2012, 12:06:27 PM »
Quote
Certainly, if a database upgrade is needed, your XML code shown should not be run, but let the database upgrade itself do that.

Oh, certainly. That example was more for the rest of the cases where it isn't needed. Just bundle it into the upgrader (it's still calling a base SMF function to do the work anyway) and the problem should be less of a problem.

Quote
Ah, Great Minds think alike!

Why do you think I've been spending time working on an SMF fork? ;) Most of the reason I still hang out here is to observe, in real cases, all the problems an SMF installation will encounter and try to figure out sane solutions around them.

Offline GUNNERPT

  • Semi-Newbie
  • *
  • Posts: 38
Re: Error in database (?)
« Reply #14 on: June 09, 2012, 05:49:19 PM »
Thanks a lot for your attention guys  ;)

As for the YouTube-related problems, I would suggest asking about this in the Aeva support topic.

Are you talking about a topic inside this forum ... or theres any Aeva support forum?


Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,817
    • wedgebook on Facebook
Re: Error in database (?)
« Reply #15 on: June 09, 2012, 05:51:43 PM »
There's no official support for Aeva, its author/maintainer is prevented from posting here, and it is not being maintained for SMF at this time. Support for it is limited to whatever help you'll get here or from me on aeva.noisen.com