Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23268

Composer install fails in a cluster environment if we have a database in a different host

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: InputQ
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.4-dev, 5.4.9, 5.4.10-rc, 5.4.10
    • Fix Version/s: QA tracked issues
    • Labels:
      None
    • Environment:

      Operating System: Debian 7
      PHP Version: PHP 5.4.4-14+deb7u8
      Database and version: Mysql 5.5.35
      Cluster environment with 3 machines. Two with eZ Publish and one with the database.

      Description

      Hi,

      Having my eZ Publish installation in one machine (10.0.5.2) and my database in a different one (10.0.5.4), when doing the composer update i have the following error:

       [eZDBNoConnectionException]
        Unable to connect to the database server 'localhost'
        Error #2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
      
      Steps to Reproduce

      – Clone eZ Publish Platform or community
      $ git clone git@github.com:ezsystems/ezpublish-platform.git ezpublish5
      $ cd ezpublish5
      – Change your ezpublish_setup.yml, updating the following settings:

      doctrine:
          dbal:
              connections:
                  default:
                      driver: pdo_mysql
                      host: 10.0.5.4
                      user: ezp
                      password: myPassword
                      dbname: ezp
      

      – execute the composer install
      $ curl -sS https://getcomposer.org/installer | php
      $ php composer.phar install --prefer-dist

      The error appears during this last command.

      Workaround:

      What seems to be happening.
      When executing the composer install, the ezpublish_legacy folder is fetched. There, we have the default settings in site.ini

      [DatabaseSettings]
      DatabaseImplementation=ezmysqli
      Server=localhost
      Port=
      User=root
      Password=
      Database=nextgen
      

      If we change these site.ini settings to

      [DatabaseSettings]
      DatabaseImplementation=ezmysqli
      Server=10.0.5.4
      Port=
      User=ezp
      Password=myPassword
      Database=ezp
      

      and re-execute the composer install
      $ php composer.phar install --prefer-dist

      then the installation seems to be restarted where is stopped last time, and we can finish the installation
      But... it's not a nice thing to do.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              paulo.nunes-obsolete@ez.no Paulo Nunes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: