Error 500: Error while rebuilding database. See log file for details.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DEN
    Senior Member
    • Apr 2021
    • 106

    #31
    I think the problem is most likely in the database.
    But you have to collect more information.

    First to do is enable a debug mode for a logger
    More detail here:


    Then you need to recreate the error.

    Then check the logs
    More detail here:
    https://docs.espocrm.com/administrat...ng/#check-logs.

    Comment

    • punkyard
      Member
      • Oct 2020
      • 53

      #32
      Thanks DEN
      I enabled debug mode for log, in data/config.php, I changed :

      'logger' => [
      ... 'level' => 'WARNING',
      << to >>
      'level' => 'DEBUG',

      I reproduced the error: I clicked "rebuild" in the admin panel, and found this in /data/logs/ log file:


      [2021-05-06 15:16:17] ERROR: (500) Error while rebuilding database. See log file for details.; POST /Admin/rebuild; line: 134, file: /var/www/clients/client71/web202/web/application/Espo/Core/DataManager.php [] []
      [2021-05-06 15:25:02] ALERT: Rebuild database fault: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-structures (id INT AUTO_INCREMENT NOT NULL COLLATE `utf8mb4_unicode_ci`, acc...' at line 1 in /var/www/clients/client71/web202/web/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:82 Stack trace: #0 /var/www/clients/client71/web202/web/vendor/doctrine/dbal/src/Driver/PDO/Connection.php(82): PDO->query('CREATE TABLE sc...') #1 /var/www/clients/client71/web202/web/vendor/doctrine/dbal/src/Connection.php(1035): Doctrine\DBAL\Driver\PDO\Connection->query('CREATE TABLE sc...') #2 /var/www/clients/client71/web202/web/application/Espo/Core/Utils/Database/Schema/Schema.php(230): Doctrine\DBAL\Connection->executeQuery('CREATE TABLE sc...') #3 /var/www/clients/client71/web202/web/application/Espo/Core/Utils/Database/Schema/SchemaProxy.php(53): Espo\Core\Utils\Database\Schema\Schema->rebuild() #4 /var/www/clients/client71/web202/web/application/Espo/Core/DataManager.php(122): Espo\Core\Utils\Database\Schema\SchemaProxy->rebuild(NULL) #5 /var/www/clients/client71/web202/web/application/Espo/Core/DataManager.php(93): Espo\Core\DataManager->rebuildDatabase(NULL) #6 /var/www/clients/client71/web202/web/application/Espo/Controllers/Admin.php(54): Espo\Core\DataManager->rebuild() #7 /var/www/clients/client71/web202/web/application/Espo/Core/ControllerManager.php(106): Espo\Controllers\Admin->postActionRebuild(Array, '', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #8 /var/www/clients/client71/web202/web/application/Espo/Core/Api/RouteProcessor.php(84): Espo\Core\ControllerManager->process('Admin', 'rebuild', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #9 /var/www/clients/client71/web202/web/application/Espo/Core/ApplicationRunners/Api.php(184): Espo\Core\Api\RouteProcessor->process('/Admin/rebuild', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #10 /var/www/clients/client71/web202/web/application/Espo/Core/ApplicationRunners/Api.php(112): Espo\Core\ApplicationRunners\Api->processRequest(Array, Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper), Array) #11 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): Espo\Core\ApplicationRunners\Api->Espo\Core\ApplicationRunners\{closure}(Object(S li m\Psr7\Request), Object(Slim\Psr7\Response), Array) #12 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Routing/Route.php(381): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array) #13 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\Routing\Route->handle(Object(Slim\Psr7\Request)) #14 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #15 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #16 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run(Object(Slim\Psr7\Request)) #17 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(60): Slim\Routing\RouteRunner->handle(Object(Slim\Psr7\Request)) #18 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Psr7\Request), Object(Slim\Routing\RouteRunner)) #19 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): class@anonymous->handle(Object(Slim\Psr7\Request)) #20 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Psr7\Request), Object(class@anonymous)) #21 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle(Object(Slim\Psr7\Request)) #22 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #23 /var/www/clients/client71/web202/web/vendor/slim/slim/Slim/App.php(199): Slim\App->handle(Object(Slim\Psr7\Request)) #24 /var/www/clients/client71/web202/web/application/Espo/Core/ApplicationRunners/Api.php(94): Slim\App->run() #25 /var/www/clients/client71/web202/web/application/Espo/Core/Application.php(95): Espo\Core\ApplicationRunners\Api->run() #26 /var/www/clients/client71/web202/web/api/v1/index.php(37): Espo\Core\Application->run('Espo\\Core\\Appli...') #27 {main} Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corres... [] []
      [2021-05-06 15:25:02] ERROR: (500) Error while rebuilding database. See log file for details.; POST /Admin/rebuild; line: 134, file: /var/www/clients/client71/web202/web/application/Espo/Core/DataManager.php [] []

      Comment


      • punkyard
        punkyard commented
        Editing a comment
        i tried on two different shared servers, they don't meet all the expectations of EspoCRM

        ovh
        max_execution_time 165
        max_input_time -1

        independant (chatons)

        max_execution_time 30
        max_input_time 60
        memory_limit 128M
        post_max_size 8M
        upload_max_filesize 2M

        on both, i'm getting the same Error 500, but not after a fresh install, only when I migrate the version I've customized (base, labels, ..)
    • DEN
      Senior Member
      • Apr 2021
      • 106

      #33
      You need to look the problem in the settings, because they cause a conflict.
      In a fact I also ran into a similar error, the error was in the server settings.

      Comment


      • punkyard
        punkyard commented
        Editing a comment
        which settings please?
    • DEN
      Senior Member
      • Apr 2021
      • 106

      #34
      Server setting,
      Apache, PHP, MySQL...

      Comment


      • punkyard
        punkyard commented
        Editing a comment
        It's a shared server. I have access to phpinfo of course
        I could mention here all settings possible
        But myself isn't enough to read and understand the logs or any problem in the database, i'm afraid

      • punkyard
        punkyard commented
        Editing a comment
        could it be linked to the charts ? utf8 / utf8mb4 / unicode_ci / general_ci ?
    • punkyard
      Member
      • Oct 2020
      • 53

      #35
      does my log give any clue to someone who'd help towards the next step please?
      what is this error exactly, I can't find it, everybody has his own

      Comment


      • punkyard
        punkyard commented
        Editing a comment
        and just now, after 3 days without being able to 'rebuild', it just went through .. difficult to understand ..
    • velokurier
      Junior Member
      • May 2021
      • 1

      #36
      Having similar problems here, also on shared hosting, PHP8, MariaDb 10.4:


      [2021-05-20 13:52:33] ALERT: Rebuild database fault: TypeError: Espo\Core\Currency\DatabasePopulator::exchangeRate s(): Argument #2 ($defaultCurrency) must be of type string, null given, called in /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Currency/DatabasePopulator.php on line 59 and defined in /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Currency/DatabasePopulator.php:79 Stack trace: #0 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Currency/DatabasePopulator.php(59): Espo\Core\Currency\DatabasePopulator->exchangeRates('CHF', NULL, Array) #1 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Utils/Database/Schema/rebuildActions/Currency.php(40): Espo\Core\Currency\DatabasePopulator->process() #2 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Utils/Database/Schema/Schema.php(328): Espo\Core\Utils\Database\Schema\rebuildActions\Cur rency->afterRebuild() #3 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Utils/Database/Schema/Schema.php(240): Espo\Core\Utils\Database\Schema\Schema->executeRebuildActions('afterRebuild') #4 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Utils/Database/Schema/SchemaProxy.php(53): Espo\Core\Utils\Database\Schema\Schema->rebuild() #5 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/DataManager.php(122): Espo\Core\Utils\Database\Schema\SchemaProxy->rebuild(NULL) #6 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/DataManager.php(93): Espo\Core\DataManager->rebuildDatabase(NULL) #7 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Controllers/Admin.php(54): Espo\Core\DataManager->rebuild() #8 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/ControllerManager.php(106): Espo\Controllers\Admin->postActionRebuild(Array, '', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #9 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/Api/RouteProcessor.php(84): Espo\Core\ControllerManager->process('Admin', 'rebuild', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #10 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/ApplicationRunners/Api.php(184): Espo\Core\Api\RouteProcessor->process('/Admin/rebuild', Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper)) #11 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/ApplicationRunners/Api.php(112): Espo\Core\ApplicationRunners\Api->processRequest(Array, Object(Espo\Core\Api\RequestWrapper), Object(Espo\Core\Api\ResponseWrapper), Array) #12 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): Espo\Core\ApplicationRunners\Api->Espo\Core\ApplicationRunners\{closure}(Object(S li m\Psr7\Request), Object(Slim\Psr7\Response), Array) #13 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Routing/Route.php(381): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Psr7\Request), Object(Slim\Psr7\Response), Array) #14 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\Routing\Route->handle(Object(Slim\Psr7\Request)) #15 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #16 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #17 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run(Object(Slim\Psr7\Request)) #18 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(60): Slim\Routing\RouteRunner->handle(Object(Slim\Psr7\Request)) #19 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Psr7\Request), Object(Slim\Routing\RouteRunner)) #20 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(Slim\Psr7\Request)) #21 /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Psr7\Request), Object(Psr\Http\Server\RequestHandlerInterface@ano nymous)) #22 /ho... [] []
      [2021-05-20 13:52:33] DEBUG: API (500) Error while rebuilding database. See log file for details.; POST /Admin/rebuild; Route pattern: /Admin/rebuild; Route params: Array ( [controller] => Admin [action] => rebuild ) [] []
      [2021-05-20 13:52:33] ERROR: (500) Error while rebuilding database. See log file for details.; POST /Admin/rebuild; line: 134, file: /home/clients/2bdb8a0ba8db584338d7e3b412390d87/web/espocrm_prod/application/Espo/Core/DataManager.php [] []

      Comment

      • DEN
        Senior Member
        • Apr 2021
        • 106

        #37
        This problem occurs during installation?

        If ESPO is functioning try to change the settings
        For Administration > Currency.
        Last edited by DEN; 05-20-2021, 02:41 PM.

        Comment


        • velokurier
          velokurier commented
          Editing a comment
          This error was happening when adding custom fields. There was also a error when installing, which I resolved with installing Espo on a different hosting and migrating it. At the hosting with the errors I was not able to run cron jobs, so I switched back to the hosting where I didn't have any errors.
      • DEN
        Senior Member
        • Apr 2021
        • 106

        #38
        What version of EspoCRM you have installed?
        I recommend you upgrade to the most recent version.

        And don't forget to check the 'Permissions', detail here:


        When moving from server to server, use the information from this article:
        https://docs.espocrm.com/administrat...nother-server/.

        Comment

        Working...