Hello, wonderful people of the internet
I am still quite new to Neos, but I am getting to a point, where I can work with it reasonably well. However, I encountered a problem with which I require a bit of outside help:
My setup:
My current Neos project has a custom command controller, that uses some components injected via @Flow\Inject
, like NodeSearchService
and NodeDataRepository
. The command provided by this controller syncs some nodes from a different server via a REST API. For every piece of content fetched from the other server, I create a new content node or update an already existing one.
The local development version runs in a local web server, while the LIVE version runs on a shared server, where I have a shell user that is placed inside a JailKit environment.
Running the command locally works just fine and the command also does excactly what it is supposed to do.
My problem:
Running the command on the LIVE system with the line FLOW_CONTEXT=Production/Live php5 flow <myCustomCommand>
produces the following error output:
An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Type: Doctrine\DBAL\Exception\ConnectionException
File: Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriv
er.php
Line: 103
Nested exception:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Type: Doctrine\DBAL\Driver\PDOException
Code: 2002
File: Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
Line: 47
Nested exception:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Type: PDOException
Code: 2002
File: Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
Line: 43
As I understand it, the JailKit environment does not allow direct access to the MySql socket. When asked, the server provider made clear that the JailKit environment will not be changed under any circumstances. The only information I got from the provider support was that I instead should connect to the database via IP and (quote) “use the option -H 127.0.0.1”, without specifying what program/script would need this option.
- php5 has a -H option, but it is not related to this problem.
- the flow script does not seem to have this option.
I really don’t know what to do here anymore. Did anyone run into this problem before? Any idea on how I can get the system to use an IP-based database connection when a command is called from the CLI?
Thanks for any replies <3
REAL