Announcement

Collapse
No announcement yet.

Upgrading 6.1.10 to 7.0.1 - Warning: array_keys() expects parameter 1 to be array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrading 6.1.10 to 7.0.1 - Warning: array_keys() expects parameter 1 to be array

    Current version is 6.1.10.
    EspoCRM will be upgraded to version 7.0.1 now. Enter [Y] to continue.
    y
    Downloading...
    Upgrading... This may take a while..........PHP Warning: array_keys() expects parameter 1 to be array, int given in public_html/application/Espo/Core/Utils/Config.php on line 303

    Error: Could not read config-internal.

    That's what I get in my terminal when running `php command.php upgrade`

    Any thoughts guys? I've done a `sudo chmod -R 777 ./*` but I get the same error...





  • #2
    Hello,
    look content of files ... if empty, delete.. and upgrade.. certainly some error of permission.
    you must check config.php for permission user/number


    /data/config-internal.php

    PHP Code:
    <?php
    return [
    'cryptKey' => 'xxx',
    'hashSecretKey' => 'xxx',
    'apiSecretKeys' => (object) [
    'xxx' => 'xxx'
    ],
    'database' => [
    'driver' => 'pdo_mysql',
    'host' => 'localhost',
    'port' => '',
    'charset' => 'utf8mb4',
    'dbname' => 'xxx',
    'user' => 'xxx',
    'password' => 'xxxx'
    ],
    'passwordSalt' => 'xxxxx',
    'microtimeInternal' => xxx.xxx
    ];

    Comment


    • #3
      What happened after the error occurred? Did your instance reverted to 6.1.10?

      Try running upgrade from the webserver user or from the root user.

      sudo -u www-data php command.php upgrade

      Comment


      • shalmaxb
        shalmaxb commented
        Editing a comment
        How would that be on shared hosting without root access?

    • #4
      So I've tried with `www-data` and `root` and here are the latest errors...

      ```
      [2021-10-06 00:05:54] ERROR: Upgrade Error: Error: Permission denied: .htaccess [] []
      [2021-10-06 00:06:01] WARNING: Cron is not run because it's disabled with 'cronDisabled' param. [] []
      [2021-10-06 00:06:14] ERROR: Upgrade Error: Error: Permission denied: .htaccess [] []
      [2021-10-06 00:07:07] WARNING: E_WARNING: array_keys() expects parameter 1 to be array, int given {"code":2,"message":"array_keys() expects parameter 1 to be array, int given","file":"/home/admin/web/crm.brandreflections.com/public_html/application/Espo/Core/Utils/Config.php","line":303} []
      [2021-10-06 00:07:07] ERROR: Database rebuild failure, details: Could not read config-internal.. [] []
      [2021-10-06 00:07:10] ERROR: Upgrade Error: Error: Could not read config-internal. [] []
      ```

      I've also attached the log file from today... Espo is still up but it's in maintenance mode....

      Attached Files

      Comment


      • #5
        Check ownership of data folder. It should be owned by webserver user.

        Comment


        • #6
          I almost turned grey after upgrading from 6.1.10 to 7.0.1. It's good that I did the backup before the update. The CRM stopped responding after updating. Please fix the errors.

          Comment


          • #7
            I did casting the file application/Espo/Core/Utils/Config.php:303 (line 303), adding (array), and it works:

            Code:
            $this->internalParamList = array_keys((array) $internalData);

            Comment


            • #8
              To avoid the issue run upgrade under the webserver user or root user.

              Comment


              • #9
                I'm still wresting with upgrading from 6.1.10 to 7.0.8...

                The first error is below...

                Code:
                [2021-11-11 02:03:40] WARNING: E_WARNING: array_keys() expects parameter 1 to be array, int given {"code":2,"message":"array_keys() expects parameter 1 to be array, int given","file":"/home/admin/web/espo/public_html/application/Espo/Core/Utils/Config.php","line":303} []
                I think I solved this by editing the file as per post 7 and upgrading via the zip file in the browser...

                I did casting the file application/Espo/Core/Utils/Config.php:303 (line 303), adding (array), and it works:
                Code:
                $this->internalParamList = array_keys((array) $internalData);
                The next entry in the log file is

                Code:
                [2021-11-11 04:40:52] ERROR: (500) Could not read config-internal.; POST /Admin/rebuild; line: 137, file: /home/admin/web/espo/public_html/application/Espo/Core/Utils/Config/ConfigWriter.php [] []
                And I'm not sure what the solution might be? I've tried a variety of chown, chmod, php command.php upgrade, sudo -u www-data php command.php upgrade and so on but with no luck...

                Any thoughts?


                Comment


                • #10
                  I was in the same position. I tried and tried and tried to fix a corrupted codebase (after update failed) like you tried, but finally gave up and did a re-install but used the old database. Read this all the way to the end and then do it.

                  Can I do a new install (of 7.x) but use the current database? Will the installer recognize the already filled up database? In the past I would create a new empty database, install Espo with parms for new database, and then do a MySQLDump of the 'old' database and then do an import to the new one. Can I omit the dump and


                  Comment


                  • bruce185
                    bruce185 commented
                    Editing a comment
                    Sorted, thank you...
                Working...
                X