Announcement

Collapse
No announcement yet.

Urgent: Update to 7.0: Error 500: No database driver specified

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

  • #31
    You need to have a user in "data/config.php" in defaultPermissions to be the same user you run upgrade from (either your user or www-data, but not root). I recommend keep it www-data but run upgrade from www-data. You also need to have all files to have the same ownership (not mixed-up) www-data.

    You also need to remove the empty data/config-internal.php file if it exists.
    Last edited by yuri; 10-07-2021, 02:23 PM.

    Comment


    • #32
      After the last update attempt that failed but which did not corrupt the system as happened the first time, here is what I have. (Note "me" is not the real owner name... I didn't want to use the real owner here in public)

      /etc/passwd

      me:x:1000:1000:,,,:/home/me:/bin/bash
      www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

      config.php:

      file permission - 664
      owner:group - me: www-data

      'defaultPermissions' => [
      'user' => 33,
      'group' => 33
      ],

      ========

      config-internal.php:

      file permission - 664
      owner:group - me: www-data

      file is empty

      ======

      Here is a ls -l listing for /data:

      Code:
      ls -l /data
      
      drwxrwxr-x 3 www-data    www-data 4096 Oct 6 08:26 cache
      -rw-rw-r-- 1 me     www-data 0 Oct 5 14:08 config-internal.php
      -rw-rw-r-- 1 me    www-data 6086 Oct 7 01:01 config.php
      drwxrwxr-x 2 www-data    www-data 4096 Oct 6 01:01 logs
      drwxrwxr-x 2 www-data    www-data 4096 Oct 7 01:01 tmp
      drwxrwxr-x 3 www-data    www-data 4096 Oct 5 13:34 upload
      =====

      What do you want me to change in /data?

      Do you want all files to be owned as "me www-data" (via chown command)?
      Do you want me to change permissions to a different setting (via chmod command?
      Do you want me to use 1000 (user) and 33 (group) in config.php (via text editor)?

      I'll try the update via terminal again after you tell me if the above is correct or if there are changes you want me to make.

      To upgrade I will use: (with "./")


      cd /var/www/html/xxxx.net/public_html/espocrm2

      php command.php upgrade

      OR let me know if you want me to use:

      sudo -u www-data php command.php upgrade

      ====

      I will help you out as much as possible. Just tell me what you want me to do to get the problem that many of us are having behind us and so we can run 7.x.

      Comment


      • #33
        Keep www-data:www-data (33 and 33) in config.

        Change dir to espo root directory:
        Code:
        cd /path/to/espo
        All files and dirs should be www-data:www-data (always be cautious with chown to not to screw up the system by applying ownership to a wrong directory):
        Code:
        sudo chown -R www-data:www-data .
        Delete file data/config-internal.php:
        Code:
        rm data/config-internal.php
        Run upgrade from www-data:
        Code:
        sudo -u www-data php command.php upgrade

        We always run upgrade from www-data user otherwise we would have had mixed ownerships like you have (unless we run from root, cause root can change ownership).

        Before v7.0 Espo was tolerant to failing to set ownership that is set in config. Now it throws an exception if it can't set required permissions.
        Last edited by yuri; 10-07-2021, 03:21 PM.

        Comment


        • #34
          Thanks, I amended the UIDs in the config.php to my default user, deleted the empty config-internal.php and after that, the update went smoothly. Running 7.0.3 now.

          Best wishes!

          Comment


          • #35
            I just want to make sure I understand. You want ALL files in the espocrm directory to be owned/group as: www-data: www-data
            or just /data and the files in it?

            You want me to run as user www-data? If so, no problem.

            I've never had a system where ALL files were www-data:www-data. Most systems (i.e. WordPress) are me:www-data. I've also never run a program with "sudo -u www-data.... " before. But if this is how the 'new' EspoCRM 7.x works, I have no problem with it.

            Let me know and I'll try the update again today (it is morning here in CA, USA)
            Last edited by dev77; 10-07-2021, 04:41 PM.

            Comment


            • #36
              This is the way we used to. All files and directories www-data:www-data.

              Here's the deal. When Espo creates a file from a script running from the webserver (e.g. create an entity in entity manager), it will create with www-data:www-data. Linux does not allow setting ownership under a non-root user. So eventually you will have files with different owners. To avoid it I recommend to stick to www-data:www-data always.
              Last edited by yuri; 10-07-2021, 04:47 PM.

              Comment


              • #37
                If you have a root access, it will be even easier. When Espo is running under root, it can set any ownership for created files (ownership is defined in config > defaultPermissions). So it will set all new files to www-data:www-data.

                Comment


                • #38
                  Originally posted by yuri View Post
                  If you have a root access, it will be even easier. When Espo is running under root, it can set any ownership for created files (ownership is defined in config > defaultPermissions). So it will set all new files to www-data:www-data.
                  I have root access since I run EspoCRM on my Linode server (Ubuntu 20.x).

                  You want me to run the update: sudo php command.php upgrade or is it sudo -u root php command.php upgrade ?

                  I don't think I've ever run anything as a root user. I've used sudo many times but I thought that just give me root privileges for that particular command and does not actually make me the root user? I'm not a bad Linux admin but I'm not anywhere near your level of knowledge or experience.... so I know i ask dumb questions!

                  Are you telling me that if I run as root user (how?) I do not have to run the chown command to change everything to www-data:www-data?

                  I'll run the update after I hear back from you... and after breakfast... 10AM here in CA/USA... 8PM in Ukraine which is where I believe you are?

                  I'm sure we will get this solved... TODAY.

                  Comment


                  • #39
                    I'm more into programming. Definitely not a Linux specialist.

                    sudo php command.php upgrade or is it sudo -u root php command.php upgrade
                    They are equal.

                    Running with sudo will execute only one command under the superuser. It won't give any privileges further. https://man7.org/linux/man-pages/man8/sudo.8.html

                    Are you telling me that if I run as root user (how?) I do not have to run the chown command to change everything to www-data:www-data?
                    You won't need to run it if you run as root user. But I'd recommend setting all www-data:www-data anyway. Just make sure you specified a proper destination, it's quite often when chown accidentally run with a wrong path and the whole system gets screwed up.

                    Comment


                    • #40
                      You can update tomorrow (or even later). Not need to hurry. The good thing is that after investigation we are now sure where the problem was.

                      Comment


                      • #41


                        sudo su -p -l www-data -s /bin/bash -c "php command.php upgrade" (for futur use )

                        Comment


                        • #42
                          Success!

                          I followed the steps in your post...

                          https://forum.espocrm.com/forum/inst...5344#post75344

                          ...step by step... and the update ran perfectly and everything works fine.

                          Thank you for taking the time to work with me to get my system up and running again.


                          Comment


                          • #43
                            Hi, The problem persist in 7.0.4? I'm configuring a new espo enviroment to test a new version, but I can't running the application! On the logs the error is always "ERROR: Uncaught Exception RuntimeException: "No database driver specified.", but the screen is about apache configuration! I did all steps above, but nothing! Can you help me?
                            Attached Files
                            Last edited by fabiomorais; 10-12-2021, 10:59 AM.

                            Comment


                            • #44
                              Error seems to show wrong configuration of your www folder. Please point your domain to main directory of espo. Make sure that your web server support htaccess files.
                              In case of issue with database driver, please make sure that you have pdo php extension enabled on your server and also if you have config file, please make sure that you have there specified pdo_mysql database driver.

                              Comment


                              • #45
                                Should work. Give it a try. Anyway it should revert if any error occurs.

                                Comment

                                Working...
                                X