Invalid response from the server when submitting post and images (always)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blackleaf
    New Member
    • Nov 2015
    • 17
    • 5.1.x

    Invalid response from the server when submitting post and images (always)


    Hi,

    when sending a new post to the forum we get this error always:


    Click image for larger version

Name:	error_foro.png
Views:	250
Size:	14.0 KB
ID:	4339107

    "Invalid response from the server"

    I have looked for the error in apache logs, but I've found nothing. In the access logs these POSTs are sent:


    XX.XX.XX.XX - - [29/Feb/2016:09:06:26 +0100] "POST /forum/create-content/text/ HTTP/1.1" 200 742 "https://www.mysite.com/forum/forum/ayuda/ayuda-y-sugerencias-sobre-el-foro/232466-error-en-el-servidor" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0"
    XX.XX.XX.XX - - [29/Feb/2016:09:06:26 +0100] "POST /forum/create-content/loadnewposts HTTP/1.1" 200 12082 "https://www.mysite.com/forum/forum/ayuda/ayuda-y-sugerencias-sobre-el-foro/232466-error-en-el-servidor" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0"

    The new posts are written correctly, but the page is not reloaded. If you refresh the page you can see your new post there.


    vBulletin 5.2.0 Patch Level 1
    Apache v2.4.10
    Mysql 5.5.47
    PHP 5.6.17

    Thanks for your help,

  • blackleaf
    New Member
    • Nov 2015
    • 17
    • 5.1.x

    #2

    Could anyone help me with this issue please? How can I debug this error?

    Comment

    • Mark.B
      vBulletin Support
      • Feb 2004
      • 24286
      • 6.0.X

      #3
      Can you please try running these queries?

      DELETE FROM cache
      DELETE FROM cacheevent

      NOTE: Do not run DELETE queries on any other table - you will break your site.
      MARK.B
      vBulletin Support
      ------------
      My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
      My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

      Comment

      • blackleaf
        New Member
        • Nov 2015
        • 17
        • 5.1.x

        #4
        Thanks for your response Mark.B . I've truncated both tables, but unfortunately the error persists in every new post.

        Comment

        • glennrocksvb
          Former vBulletin Developer
          • Mar 2011
          • 4011
          • 5.7.X

          #5
          Turn on debug mode in the config. Then try it again while the debugger tool (F12) is open and check the ajax response in the Network tab. The loadnewposts ajax request was expecting a JSON response but it returned an HTML markup. The HTML returned should contain the php error stack trace.

          Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

          Comment

          • blackleaf
            New Member
            • Nov 2015
            • 17
            • 5.1.x

            #6
            Hi Glenn Vergara, I used the debugger tool as you said with debug mode enabled, this is the info I got (IP and site has been changed), I don't see any error there?


            Code:
            General
            Request URL:https://www.mysite.com/foro/create-content/loadnewposts
            Request Method:POST
            Status Code:200 OK
            Remote Address:AA.BB.CC.DD:443

            Code:
            Response Headers
            view source
            Cache-Control:max-age=0,no-cache,no-store,post-check=0,pre-check=0
            Connection:Close
            Content-Length:0
            Content-Type:application/json; charset=UTF-8
            Date:Tue, 01 Mar 2016 22:16:03 GMT
            Expires:Sat, 1 Jan 2000 01:00:00 GMT
            Last-Modified:Tue, 01 Mar 2016 22:16:03 GMT
            Pragma:no-cache
            Server:Apache/2.4.10 (Debian)
            X-Powered-By:PHP/5.6.17-0+deb8u1
            X-UA-Compatible:IE=edge,chrome=1
            Code:
            Request Headers
            view source
            Accept:application/json, text/javascript, */*; q=0.01
            Accept-Encoding:gzip, deflate
            Accept-Language:es,en;q=0.8,en-GB;q=0.6
            Authorization:Basic YWRtaW46M0tEeWVGZXJ6WTdZ
            Connection:keep-alive
            Content-Length:453
            Content-Type:application/x-www-form-urlencoded; charset=UTF-8
            Cookie:__utma=78049542.447397439.1448102167.1454797629.1454797629.1; __utmc=78049542; __utmz=78049542.1454797629.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); bblastvisit=1456867804; _gat=1; bblastactivity=1456870534; bbsessionhash=f0b9a609304a8be39ea89bd6299ab71d; _ga=GA1.2.447397439.1448102167
            Host:www.mysite.com
            Origin:https://www.mysite.com
            Referer:https://www.mysite.com/foro/forum/foro-privado/mantenimiento-foro/5367-nueva-era-mysite-2011?_=1456870536298
            User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
            X-Requested-With:XMLHttpRequest
            Form Data
            view source
            view URL encoded
            parentid:5367
            channelid:30
            newreplyid:232481
            loadednodes[]:5367
            loadednodes[]:141103
            loadednodes[]:141105
            loadednodes[]:142393
            loadednodes[]:142406
            loadednodes[]:142659
            lastpublishdate:1307541446
            lastloadtime:1456870535
            pageload_servertime:1456870535
            view:thread
            currentpage:1
            pagetotal:1
            postcount:6
            postsperpage:15
            commentsperpage:25
            past_page_limit_aware:false
            securitytoken:1456870535-c65109c40568537d26359d7d5d1c9aff7abafb6b

            Comment

            • glennrocksvb
              Former vBulletin Developer
              • Mar 2011
              • 4011
              • 5.7.X

              #7
              You only got the content of the Headers tab but not the Response tab which contains the response text from the server.

              Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

              Comment

              • blackleaf
                New Member
                • Nov 2015
                • 17
                • 5.1.x

                #8
                The Response tab is empty, I got "SyntaxError: JSON.parse: unexpeted end of data at line 1 column 1 of the JSON data" because it is empty. You can see it too in the Content-Lenght of the response header.

                Comment

                • blackleaf
                  New Member
                  • Nov 2015
                  • 17
                  • 5.1.x

                  #9
                  Could it be for some problem in the database? A few days ago I had to repair some tables.

                  Comment

                  • blackleaf
                    New Member
                    • Nov 2015
                    • 17
                    • 5.1.x

                    #10
                    After viewing the code in the function sendAsJson (includes/vb5/frontend/controller.php) I've managed to solve the issue converting all the database content to UTF-8.
                    I had the database in latin1 and it seems that the the funciontion sendAsJson was not properly handling the charset because it was not doing the conversion to UTF-8 before calling jsonEncode function.

                    May be it was a configuration mistake somewhere, but I haven’t had this issue before v5.2.

                    Now, after converting the database charset everything is running Ok.

                    Comment

                    Related Topics

                    Collapse

                    Working...