"Slim Application Error" when importing account (error 500)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agri
    Member
    • Mar 2021
    • 89

    "Slim Application Error" when importing account (error 500)

    [ EspoCRM v. 7.2.7]

    I try to import an account for testing. My csv is very short:
    Code:
    name;orgaID;rechtsform
    "Testorganisation";"LSkG1BBORute";"AG"​
    I can do the first two steps of import, i.e. choose entity and upload file, match fields. Import then throws an error 500.
    There's a large error message in the logs, which I cannot make any sense of:

    Code:
    [2022-12-12 13:13:25] ERROR: Slim Application Error Type: TypeError Code: 0
    Message: Argument 1 passed to Espo\ORM\BaseEntity::cloneArray() must be of the type array or null,
    string given, called in /var/www/html/application/Espo/ORM/BaseEntity.php on line 342
    File: /var/www/html/application/Espo/ORM/BaseEntity.php Line: 1112
    Trace:
    #0 /var/www/html/application/Espo/ORM/BaseEntity.php(342): Espo\ORM\BaseEntity->cloneArray()
    #1 /var/www/html/application/Espo/ORM/BaseEntity.php(276): Espo\ORM\BaseEntity->getFromContainer()
    #2 /var/www/html/application/Espo/Classes/FieldValidators/ArrayType.php(76): Espo\ORM\BaseEntity->get()
    #3 /var/www/html/application/Espo/Core/FieldValidation/FieldValidationManager.php(257): Espo\Classes\FieldValidators\ArrayType->checkArrayOfString()
    #4 /var/www/html/application/Espo/Core/FieldValidation/FieldValidationManager.php(164): Espo\Core\FieldValidation\FieldValidationManager->processFieldCheck()
    #5 /var/www/html/application/Espo/Core/FieldValidation/FieldValidationManager.php(216): Espo\Core\FieldValidation\FieldValidationManager->check()
    #6 /var/www/html/application/Espo/Core/FieldValidation/FieldValidationManager.php(134): Espo\Core\FieldValidation\FieldValidationManager->processField()
    #7 /var/www/html/application/Espo/Core/FieldValidation/FieldValidationManager.php(87): Espo\Core\FieldValidation\FieldValidationManager->processInternal()
    #8 /var/www/html/application/Espo/Tools/Import/Import.php(604): Espo\Core\FieldValidation\FieldValidationManager->processAll()
    #9 /var/www/html/application/Espo/Tools/Import/Import.php(368): Espo\Tools\Import\Import->importRow()
    #10 /var/www/html/application/Espo/Tools/Import/Service.php(105): Espo\Tools\Import\Import->run()
    #11 /var/www/html/application/Espo/Controllers/Import.php(121): Espo\Tools\Import\Service->import()
    #12 /var/www/html/application/Espo/Core/Api/ActionProcessor.php(100): Espo\Controllers\Import->postActionCreate()
    #13 /var/www/html/application/Espo/Core/Api/RequestProcessor.php(141): Espo\Core\Api\ActionProcessor->process()
    #14 /var/www/html/application/Espo/Core/Api/RequestProcessor.php(112): Espo\Core\Api\RequestProcessor->proceed()
    #15 /var/www/html/application/Espo/Core/Api/RequestProcessor.php(83): Espo\Core\Api\RequestProcessor->processInternal()
    #16 /var/www/html/application/Espo/Core/Api/Starter.php(103): Espo\Core\Api\RequestProcessor->process()
    #17 /var/www/html/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): Espo\Core\Api\Starter->Espo\Core\Api\{closure}()
    #18 /var/www/html/vendor/slim/slim/Slim/Routing/Route.php(384): Slim\Handlers\Strategies\RequestResponse->__invoke()
    #19 /var/www/html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\Routing\Route->handle()
    #20 /var/www/html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\MiddlewareDispatcher->handle()
    #21 /var/www/html/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle()
    #22 /var/www/html/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run()
    #23 /var/www/html/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(59): Slim\Routing\RouteRunner->handle()
    #24 /var/www/html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\RoutingMiddleware->process()
    #25 /var/www/html/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): class@anonymous->handle()
    #26 /var/www/html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\ErrorMiddleware->process()
    #27 /var/www/html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle()
    #28 /var/www/html/vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle()
    #29 /var/www/html/vendor/slim/slim/Slim/App.php(199): Slim\App->handle()
    #30 /var/www/html/application/Espo/Core/Api/Starter.php(79): Slim\App->run()
    #31 /var/www/html/application/Espo/Core/ApplicationRunners/Api.php(49): Espo\Core\Api\Starter->start()
    #32 /var/www/html/application/Espo/Core/Application/RunnerRunner.php(85): Espo\Core\ApplicationRunners\Api->run()
    #33 /var/www/html/application/Espo/Core/Application.php(81): Espo\Core\Application\RunnerRunner->run()
    #34 /var/www/html/public/api/v1/index.php(37): Espo\Core\Application->run()
    #35 {main} Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor. [] []

    Any help highly appreciated!
    Kind regards
  • lazovic
    Super Moderator
    • Jan 2022
    • 809

    #2
    Hi agri,

    Please tell me what is the type of the rechtsform field?

    Comment

    • agri
      Member
      • Mar 2021
      • 89

      #3
      Hi lazovic ,
      type is Enum.

      Comment

      • lazovic
        Super Moderator
        • Jan 2022
        • 809

        #4
        agri, try importing the following .csv file:
        Code:
        name;orgaID;rechtsform
        Testorganisation;LSkG1BBORute;AG

        Comment


        • agri
          agri commented
          Editing a comment
          Did so, results in Error 500 ...
      • lazovic
        Super Moderator
        • Jan 2022
        • 809

        #5
        agri,

        Do you have any customizations (code changes) in your instance? Try to make a Rebuild in the Administration. Will there be an error in the logs after that?

        Comment

        • agri
          Member
          • Mar 2021
          • 89

          #6
          Only NOTICEs and DEBUG messages after rebuild. No Errors.
          Concerning customizations: we have some custom entities. And a custom \var\www\html\custom\Espo\Custom\Resources\metadat a\app\regExpPatterns.json. And custom fields and relationships as well.
          Wether or not there are more changes in code, unfortunately I cannot say. Espo was already set up, when I took it.

          Comment

          • rabii
            Active Community Member
            • Jun 2016
            • 1250

            #7
            try to import without the enum field and see if import will work or not.
            Rabii
            Web Dev

            Comment


            • agri
              agri commented
              Editing a comment
              Sorry, doesn't work. Still "ERROR: Slim Application Error Type: TypeError Code: 0 Message: Argument 1 passed to Espo\ORM\BaseEntity::cloneArray() must be of the type array or null, string given, called in /var/www/html/application/Espo/ORM/BaseEntity.php on line 342 ..." etc.

            • agri
              agri commented
              Editing a comment
              Still ERROR 500, even if I reduce import to "name", which is the only mandatory field ...
          • victor
            Active Community Member
            • Aug 2022
            • 727

            #8
            agri,

            Please send an example of your import file. It seems to me that the problem is precisely in him.

            Comment

            • agri
              Member
              • Mar 2021
              • 89

              #9
              CSV not allowed, so I zipped it ...
              Attached Files

              Comment

              • victor
                Active Community Member
                • Aug 2022
                • 727

                #10
                By default, the Field Delimiter is set to ",". Your file specifically needed to be set to ";".
                The import was unsuccessful due to the fact that EspoCRM could not separate the columns and they merged into one: both the column headers and the data in them (screenshot 1). And if in the second step you did not choose which field to put the data in (screenshot 2), then after import you received a validation error. And if you had selected a field, for example, name in the second step, you would have received the imported Account as in screenshot 3.

                Therefore, always pay attention to Field Delimiter and Preview on first step, and to Field Mapping on first step for successful import.​

                Resaved your file (in attachments) and the Field Delimiter should use "," (screenshot 4). ​​
                Attached Files
                Last edited by victor; 12-16-2022, 09:50 AM.

                Comment

                • agri
                  Member
                  • Mar 2021
                  • 89

                  #11
                  Well, I did pay attention and had set delimiter to ";". Step 1 nd Step 2 looked normal, import failed.
                  Attached Files

                  Comment


                  • victor
                    victor commented
                    Editing a comment
                    Have you tried importing with my file and are you getting the same error when importing contacts or leads for example?

                  • agri
                    agri commented
                    Editing a comment
                    I just did use your file - again "Error 500"
                    No problems with leads or with a custom entity ...
                • tamalethrift
                  Junior Member
                  • Jun 2023
                  • 1

                  #12
                  I have the same issue. Any tips for solution?

                  Comment


                  • Akemi
                    Akemi commented
                    Editing a comment
                    It helps when you put your:
                    - Espo version
                    - PHP version

                    I assume you checked the delimiter like above?

                  • victor
                    victor commented
                    Editing a comment
                    Akemi had a very similar problem in this thread: https://forum.espocrm.com/forum/gene...tuck-on-import. However, as it turned out, the problem there was in the entity itself, and not in the import.
                Working...