vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Database Error when Searching (https://vborg.vbsupport.ru/showthread.php?t=319311)

Master Of Unive 07-02-2015 07:50 AM

Database Error when Searching
 
I received an email which notifies me a database error, it is as below

My forum doesn't happen a problem with it, search functions are still working.
Can anyone spot where the problem comes from, and how to reproduce it?

Quote:

Database error in vBulletin 4.2.2:

Invalid SQL:

SELECT post.*,userfield.*, usertextfield.*, user.*, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid,avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar,
customavatar.dateline AS avatardateline, customavatar.width AS width, customavatar.height AS height,
customavatar.height_thumb AS height_thumb, customavatar.width_thumb AS width_thumb, customavatar.filedata_thumb
FROM post AS post
LEFT JOIN user AS user ON (user.userid = post.userid)
LEFT JOIN userfield AS userfield ON (user.userid = userfield.userid)
LEFT JOIN usertextfield AS usertextfield ON (user.userid = usertextfield.userid)
LEFT JOIN avatar AS avatar ON (avatar.avatarid = user.avatarid)
LEFT JOIN customavatar AS customavatar ON (customavatar.userid = post.userid)
WHERE post.postid IN (.);

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 10
Error Number : 1064
Request Date : Thursday, July 2nd 2015 @ 10:15:46 AM
Error Date : Thursday, July 2nd 2015 @ 10:15:46 AM
Script : http://xxxx.com/forum/search.php?searchid=318478
Referrer : http://xxxx.com/forum/search.php
IP Address : 60.xx.xx.xx
Username : someone
Classname : vB_Database

tanzeelniazi 07-02-2015 06:32 PM

i think you need to repair tables in php admin

ForceHSS 07-02-2015 09:25 PM

Invalid SQL errors are almost always related to modified code.

To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

[Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

Next, disable all products (except vB Blog and vB CMS if you are running the Suite.)

Admin CP -> Plugins & Products -> Manage Products -> Disable

Then manually uncheck all plugins that are not for 'vBulletin Blog' and vBulletin CMS' here:

Admin CP -> Plugins & Products -> Plugin Manager

Then if you still have this problem, create a new style and choose no parent style. This will force it to use the default templates. Finally empty your browser cache, close all browser windows then try again. Make sure you change to the new style and view your forums with it.

Do you have the same problem?

Master Of Unive 07-03-2015 12:09 AM

Thanks for your replies.

But tasks mentioned above wouldn't solve the situation. The problem isn't consistent, it happened only once in a while. I'm trying to debug and reproduce but it will take too much time.

The only idea I can see through right now is the error comes from "Find user's latest posts"

ForceHSS 07-03-2015 02:13 AM

You should follow my above, post it will at least rule out some things that can cause these problems and if it is what I said above it will find what is causing it so a fix can be found, but if you don't want to even try why post for help when a possible solution might be just a few mins of work

Master Of Unive 07-05-2015 09:35 AM

Sorry, it seems that you misunderstood.

I will soon do as you mentioned but not now. My forum is quite large so I can't easily close it for a while just to find an error which rarely occurs (and doesn't really affect security)

However, the tasks you tell me to do are more likely reinstalling the forum, so I'm afraid I couldn't follow thoroughly.

ForceHSS 07-05-2015 12:31 PM

You are not reinstalling your forum only uploading the files and you don't need to close your site while doing it

Lynne 07-05-2015 02:29 PM

If you don't want to close your live site, then make a database backup of the live site and create a test forum. Then you can try to reproduce the error on the test forum and diagnose the problem there.

QSTR 12-08-2015 06:25 PM

@master

I have the same error.
If I type in search 'dac diy' as unregistered user.... and I switch to the second page, voila:
PHP Code:

SELECT post.*,userfield.*, usertextfield.*, user.*, IF(displaygroupid=0user.usergroupiddisplaygroupid) AS displaygroupid,avatar.avatarpathNOT ISNULL(customavatar.userid) AS hascustomavatar,
                        
customavatar.dateline AS avatardatelinecustomavatar.width AS widthcustomavatar.height AS height,
                        
customavatar.height_thumb AS height_thumbcustomavatar.width_thumb AS width_thumbcustomavatar.filedata_thumb
            FROM post 
AS post
                LEFT JOIN user 
AS user ON (user.userid post.userid)
LEFT JOIN userfield AS userfield ON (user.userid userfield.userid)
LEFT JOIN usertextfield AS usertextfield ON (user.userid usertextfield.userid)
LEFT JOIN avatar AS avatar ON (avatar.avatarid user.avatarid)
LEFT JOIN customavatar AS customavatar ON (customavatar.userid post.userid)
            
WHERE post.postid IN (.); 

vb 4.2.3, hooks disabled
No susp. files found.

PM with your plugins/products list. We can compare them.

Thanks.

--------------- Added [DATE]1449689399[/DATE] at [TIME]1449689399[/TIME] ---------------

Soo, I spent a half day with this, and I got something - so, what I did:
- copy of my PRD -> TEST, 1:1
- all non standard plugins/products -> DELETE
- cron jobs -> DISABLED
- overwrite vB files -> DONE
- check susp. files and delete non vB files -> DONE
- create new, clean style -> DONE
and.... what, nothing....

But - the funny thing now.
I didn't want to lose my time for Human Verfication, so I went to CP and disabled this function.
And... haha. Its working!

When I enable 'Human Verification' (Q&A) it crashes my board when I'm searching fe. 'dac diy' - of course I have to switch to the second page (or further)

@VB support - I can share You my board with files/db (with wiped passwords / emails / etc.) for tests.


All times are GMT. The time now is 05:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01040 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete