Results 1 to 9 of 9

Thread: SQL error - statement that failed below:

  1. #1
    Join Date
    Aug 2004
    Location
    São Paulo - Brasil.
    Age
    39
    Posts
    151

    Default SQL error - statement that failed below:

    Heloo people.

    I'm having a problem atypical, I am working on this web site (emovimento.com), and I'm getting some SQL errors messages, (below).

    I tried to discover the error, pasting the query in phpmyadmin "SQL tab", but nothing was informed, the more strange is, some times i´m access the Web Site and i get the error, and sometimes not, i´m very confused.

    O.R Ver. 2.5.2
    Yes, i´m use 3 addons in main.html.

    - Smooth Gallery ADD-ON (My)
    - Latest agents (Marques)
    - Ultimate Quick-Login with welcome-user (Adamck)

    Any help is welcome !!!

    SQL statement that failed below:
    ---------------------------------------------------------
    DELETE FROM default_forgot WHERE forgot_time < NOW() - INTERVAL 1 DAY

    ---------------------------------------------------------

    ERROR REPORT emovimento.com: July 29, 2008, 5:07:51 pm

    ---------------------------------------------------------
    SQL ERROR: DELETE FROM default_forgot WHERE forgot_time < NOW() - INTERVAL 1 DAY Server Type: Apache CustomConfig Request Method: GET Query String:
    User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Request URI: / POST Variables: array (
    )
    GET Variables: array (
    'printer_friendly' => false,
    'action' => 'index',
    'PageID' => 1,
    )

    ...a blind padawan...

  2. #2
    Join Date
    Aug 2004
    Location
    São Paulo - Brasil.
    Age
    39
    Posts
    151

    Default Re: SQL error - statement that failed below:

    I´m assuming that was a server error, and not the addon's above reported.
    Tnks.

    ...a blind padawan...

  3. #3
    Join Date
    Jul 2008
    Posts
    1

    Default Re: SQL error - statement that failed below:

    i too am getting the same problem. (see below) the problem is, im a developer who was asked to 'fix' things on an OR setup which was not originally done by me or my company. (and the guys who did it heavily customized the installation). so im at a loss on how to go about figuring out what version/add-ons are actually installed. but any help would be appreciated.

    =========
    SQL ERROR: DELETE FROM default_forgot WHERE forgot_time < NOW() - INTERVAL 1
    DAY

    Server Type: Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g
    Request Method: POST
    Query String:
    User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET
    CLR 2.0.50727; .NET CLR 3.0.04506; InfoPath.2)

    Request URI: /admin/
    POST Variables: array (
    &#160; 'user_name' => 'xxxxx',
    &#160; 'user_pass' => 'password',
    &#160; 'remember' => 'on',
    )
    GET Variables: array (
    &#160; 'printer_friendly' => false,
    &#160; 'action' => 'index',
    )

  4. #4
    Join Date
    Aug 2004
    Location
    São Paulo - Brasil.
    Age
    39
    Posts
    151

    Default Re: SQL error - statement that failed below:

    There are some addon working to do login in your O.R Web Site?

    ...a blind padawan...

  5. #5
    Join Date
    Dec 2003
    Location
    Costa Rica
    Posts
    63

    Default Re: SQL error - statement that failed below:

    I have the same error and I find this in the logs:

    Access denied with code 501 (phase 2). Match of "rx ^((?:(?:POS|GE)T|OPTIONS|HEAD))$" against "REQUEST_METHOD" required. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "38"] [id "960032"] [msg "Method is not allowed by policy"] [severity "CRITICAL"] [tag "POLICY/METHOD_NOT_ALLOWED"This error appeared after hardening the server and the message is in the mod_security logs. ( modsecurity_org)

    I am using version 2.5.3 - will upgrading solve this issue? I will try to comment out the rule which should work but also could open the server to attack.

  6. #6
    Join Date
    Dec 2003
    Location
    Costa Rica
    Posts
    63

    Default Re: SQL error - statement that failed below:

    No that did not work, I still get the same error.

    It is strange that running the query in phpmyAdmin there is no error.

  7. #7
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: SQL error - statement that failed below:

    Quote Originally Posted by Riomacho View Post
    will upgrading solve this issue? I will try to comment
    No, upgrading won't change this, your mod_security rule is probably not properly formed.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  8. #8
    Join Date
    Dec 2003
    Location
    Costa Rica
    Posts
    63

    Default Re: SQL error - statement that failed below:

    Ok, I am in contact with server support staff. here is the rule that is causing the error, if I get the answer I will post it or if anyone has the correct answer ....?


    # allow request methods
    SecRule REQUEST_METHOD "!^((?:(?:POS|GE)T|OPTIONS|HEAD))$" \
    "phase:2,t:none,log,auditlog,status:501,msg:'Metho d is not allowed by policy', severity:'2',id:'960032',tag:'POLICY/METHOD_NOT_ALLOWED'"

    I tried commenting out the rule and restarting Apache, but it didn't seem to work. In any case the rules should not be commented out.

  9. #9
    Join Date
    Dec 2003
    Location
    Costa Rica
    Posts
    63

    Default Re: SQL error - statement that failed below:

    It looks like the mod_security rules and Open Realty 2.5.2 work fine. I cut out the security rule and still got the same SWL error message. But I could not see anything in the log (cPanel - mod_security)

    So I realized it my be something in the admin template, or addons as explained in another thread in these forums (I searched mod_security) - we have some custom addons and links for agents in the admin template.

    So I uploaded the default template and the login was fine.

    So I replaced the mod_security rule listed above and it also works.

    Now we can put back in the custom template code and see what is causing the problem. At least agents can change their listings now, so problem solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •