Bad server response

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tosalman
    Junior Member
    • Jun 2017
    • 5

    Bad server response

    After successful installation I got "Bad server response" error message whenever navigating throughout the app.
    Unable to upload any file in the document section. I get "Bad server response" and "Error 500" error messages
    When creating new leads or opportunities or any other records can't amend or add to that record. I get "Bad server response" and "Error 500" error messages

    In the log file I have the following

    [2017-06-25 15:15:40] Espo.ERROR: Uncaught Exception PDOException: "SQLSTATE[HY000] [2002] No such file or directory" at /EspoCRM-4.7.1/application/Espo/ORM/EntityManager.php line 138 {"exception":"[object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory at /EspoCRM-4.7.1/application/Espo/ORM/EntityManager.php:138)"} []

    [2017-06-25 15:26:49] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/EspoCRM-4.7.1/application/Espo/Core/Utils/Config.php","line":255,"context":{"data":"","isAdm in":true,"restrictItems":["systemItems","adminItems","configPath","cachePath ","database","crud","logger","isInstalled","defaul tPermissions","systemUser","permissionMap","permis sionRules","passwordSalt","cryptKey","restrictedMo de","userLimit","portalUserLimit","stylesheet","us erItems","internalSmtpServer","internalSmtpPort"," internalSmtpAuth","internalSmtpUsername","internal SmtpPassword","internalSmtpSecurity","internalOutb oundEmailFromAddress"],"values":[]}} []


    I am using EspoCRM 4.7.1, PHP 5.5, MySQL 5.6.32

    Please help...
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello

    try to change database hostname in data/config.php from localhost to 127.0.0.1

    Comment

    • tosalman
      Junior Member
      • Jun 2017
      • 5

      #3
      Hi Thanks. It is already mapped to the hostname provided by the host provider. Please look at screenshot of the error I am getting. In addition to that, when I try to update a record the following error appears in the server log.

      20170628T102621: /EspoCRM-4.7.1/api/v1/index.php PHP Fatal error: Cannot unset string offsets in /EspoCRM-4.7.1/application/Espo/Services/Record.php on line 612

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        push the button F12 in browser, check what data you send while updating and what you response

        Comment

        • tosalman
          Junior Member
          • Jun 2017
          • 5

          #5
          Hi, This what I got.


          VM3115:456 PATCH http://XXXXXXXXXX.XXX/CRM/EspoCRM-4....29bb4ee6b889ba 500 (Internal Server Error)


          Request Payload:

          {emailAddress: "abc@abc.com",…}
          1. emailAddress:"abc@abc.com"
          2. emailAddressData:[{emailAddress: "abc@abc.com", primary: true, optOut: false, invalid: false, lower: "abc@abc.com"}]
            1. 0:{emailAddress: "abc@abc.com", primary: true, optOut: false, invalid: false, lower: "abc@abc.com"}
              1. emailAddress:"abc@abc.com"
              2. invalid:false
              3. lower:"abc@abc.com"
              4. optOut:false
              5. primary:true

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            You can create new records, but can't update, right? Check if PATCH is available

            Originally posted by pk2r

            httpd.conf in conf apache directory...use vi httpd.conf to edit, and put at the top

            <ifModule mod_headers.c>
            Header always set Access-Control-Allow-Methods "POST, GET, PUT, PATCH, DELETE"
            </ifModule>

            at the bottom

            <Limit GET POST PUT DELETE HEAD OPTIONS PATCH>
            Order allow,deny
            Allow from all
            </Limit>

            then save and restart apache...

            Comment

            • tosalman
              Junior Member
              • Jun 2017
              • 5

              #7
              I have added these two lines at the top and the bottom of file htaccess with no luck

              server error is:
              20170702T063812: EspoCRM-4.7.1/api/v1/index.php PHP Fatal error: Cannot unset string offsets in /EspoCRM-4.7.1/application/Espo/Services/Record.php on line 612
              Last edited by tosalman; 07-03-2017, 01:17 PM.

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #8
                Hello
                No idea, what data is passed
                open /hermes/walnaweb09a/b1346/moo.stargazerbeauty/CRM/EspoCRM-4.7.1/application/Espo/Services/Record.php,
                add on line 611
                Code:
                $GLOBALS['log']->error(print_r($data, true));
                save the file,
                try to edit some record in crm.
                If you get an error, remove string you added before in this file and save it again.
                open the espocrm log and check, what data was passed

                Comment

                • tosalman
                  Junior Member
                  • Jun 2017
                  • 5

                  #9

                  Hi Now this is the error in the log. Plus "error 500" as red label in the top 20170703T164845: /EspoCRM-4.7.1/api/v1/index.php PHP Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in /EspoCRM-4.7.1/application/Espo/Services/Record.php on line 675

                  Comment

                  Working...