System user is not retrieveable after rebuilding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stevengpn
    Junior Member
    • Nov 2018
    • 18

    System user is not retrieveable after rebuilding

    I got below error after rebuilding even though the system user is right in the user table(active=1, delete=0), and the user object is returned as Null by the entityManager in the Espo\Core\Utils\Auth.php

    Please see the attached screenshots.

    Espo.ERROR: Uncaught Exception Espo\Core\Exceptions\Error: "System user is not found" at C:\WinNMP\WWW\EspoCRM\application\Espo\Core\Utils\ Auth.php line 113 {"exception":"[object] (Espo\\Core\\Exceptions\\Error(code: 500): System user is not found at C:\\WinNMP\\WWW\\EspoCRM\\application\\Espo\\Core\ \Utils\\Auth.php:113)"} []

    Don't really want to reinstall it


    Cheers!
    Steven
    Last edited by stevengpn; 11-27-2018, 01:54 PM.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello,
    run php rebuild.php as webserver user in cli

    Comment

    • stevengpn
      Junior Member
      • Nov 2018
      • 18

      #3
      yes, I ran it in the first place lead to this problem and ran again with the same error.

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Check whether config.php wasn't crashed? Check permissions as well. Do you have files backup?

        Comment

        • stevengpn
          Junior Member
          • Nov 2018
          • 18

          #5
          EspoCRM\data\config.php is intact, seems fine to me. Yes, I have backup source code always.
          I work on windows, BTW.

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            do you have any customization related with User entity?
            try to empty custom folder and execute again rebuild.

            Comment

            • stevengpn
              Junior Member
              • Nov 2018
              • 18

              #7
              this is the last line of the log rebuilding:
              [2018-12-04 02:11:06] Espo.ERROR: Fault to rebuild database schema. Details: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'system' for key 'PRIMARY' [] []

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #8
                weird...
                try to remove this record from the table and run again rebuild in cli

                Comment

                • stevengpn
                  Junior Member
                  • Nov 2018
                  • 18

                  #9
                  thanks, that error is gone, now I got new one, please help:
                  [2018-12-05 01:48:53] Espo.ERROR: Uncaught Exception TypeError: "Argument 2 passed to Espo\Core\Acl::__construct() must be an instance of Espo\Entities\User, null given, called in C:\WinNMP\WWW\EspoCRM\application\Espo\Core\Contai ner.php on line 263" at C:\WinNMP\WWW\EspoCRM\application\Espo\Core\Acl.ph p line 41 {"exception":"[object] (TypeError(code: 0): Argument 2 passed to Espo\\Core\\Acl::__construct() must be an instance of Espo\\Entities\\User, null given, called in C:\\WinNMP\\WWW\\EspoCRM\\application\\Espo\\Core\ \Container.php on line 263 at C:\\WinNMP\\WWW\\EspoCRM\\application\\Espo\\Core\ \Acl.php:41)"} []

                  Comment

                  • tanya
                    Senior Member
                    • Jun 2014
                    • 4308

                    #10
                    Is system user created after rebuild?
                    And, again ... do you have any customization related with User entity?

                    Comment

                    • stevengpn
                      Junior Member
                      • Nov 2018
                      • 18

                      #11
                      Yes, it got inserted into user table.

                      Yes, I searched it and deleted any custom entity files from the custom folder. Not sure if I deleted completely.

                      Comment

                      • tanya
                        Senior Member
                        • Jun 2014
                        • 4308

                        #12
                        is it work well after removing customization?

                        Comment

                        • stevengpn
                          Junior Member
                          • Nov 2018
                          • 18

                          #13
                          nope, re-installed

                          Comment

                          Working...