Context_mgr_exists: Failed! - context_connectors_exists: Failed! -

Ubuntu 18
Mysql 5.x
PHP-FPM 7.3
MODX 2.7.2

CLI INSTALL

unzipped pacakge into /usr/src/modx

config:

<!--
 This file is part of MODX Revolution.

<modx>
    <database_type>mysql</database_type>
    <database_server>localhost</database_server>
    <database>modx</database>
    <database_user>modx</database_user>
    <database_password>modx</database_password>
    <database_connection_charset>utf8</database_connection_charset>
    <database_charset>utf8</database_charset>
    <database_collation>utf8_general_ci</database_collation>
    <table_prefix>modx_</table_prefix>
    <https_port>443</https_port>
    <http_host>localhost</http_host>

    <cache_disabled>0</cache_disabled>

    <inplace>1</inplace>
    <unpacked>0</unpacked>
    <language>en</language>

    <cmsadmin>admin</cmsadmin>
    <cmspassword>admin</cmspassword>
    <cmsadminemail>email@address.com</cmsadminemail>

    <core_path>/var/www/modx/core/</core_path>

    <context_mgr_path>/var/www/modx/manager/</context_mgr_path>
    <context_mgr_url>/manager/</context_mgr_url>
    <context_connectors_path>/var/www/modx/connectors/</context_connectors_path>
    <context_connectors_url>/connectors/</context_connectors_url>
    <context_web_path>/var/www/modx/</context_web_path>
    <context_web_url>/</context_web_url>

    <remove_setup_directory>1</remove_setup_directory>
</modx>

/var/www/modx is EMPTY

sudo -u www-data php ./index.php --installmode=new --config=/home/ubuntu/config.xml

Get frustrating error that makes no sense. What exists??? The directories that I’m trying to specify surely do not. Fresh database, fresh unzip.

Pre-Install Tests Failed! Errors:
context_mgr_exists: Failed! - context_connectors_exists: Failed! -

If I set it to inplace 0 it works, sort of but get a 503 error. Pretty sure inplace should be 1 as I’m installing it to another location not simply using the expanded zip file as the web root.

Doesn’t inplace mean the files are already in place?

inplace

Set this to 1 if you are using MODX from Git or extracted it from the full MODX package to the server prior to installation

Even this description to me is weird. I mean we extract it from a zip prior to installation as this is what you need to do to run the setup anyway?

What is “it”?

And if I specify both paths and they’re empty, they don’t exist as that is where id like it to install too per the config. A lot of ambiguity here.

Yeah it could be written better definitely. :slight_smile:

https://docs.modx.com/current/en/getting-started/installation/cli

What is the point of linking to that really?

Just to make sure, this is a standard distribution downloaded from MODX.com that you want to install with the CLI script? Or is it an actual git-based installation?

You say /var/www/modx/ is empty - but where did you unpack the files to then?

Yeah the pl zip I downloaded straight from modx and uncompressed as /usr/src/modx and pointing my config xml to use /var/www paths for core manager and connections etc etc. running index.php from /usr/src/modx/setup

You need to point the config to where the files are. So if you want to run MODX from /var/www, unzip the files to that location and run the setup from there as well – not /usr/src/modx.

@markh that isn’t true… modx supports an install from src files to a separate location. Setting the inplace flag to 0 works for this. The documentation just needs a little clarity.

In my decade of using (and building) MODX I’ve never come across anything that says you can use it like that. The setup is definitely not meant to be used as a separate install script to use for other arbitrary locations. If it works, I’d say that’s incidental rather than on purpose, and definitely not the recommended approach.

I’m always happy to be proven wrong though - can you point to where you found instructions to use it in this way? There are also edit links on each page in the documentation, if you want to fix it yourself.

It’s in the CLI doc and will be offering edits to them this week to help clarify. I don’t feel it’s unsupported at all really speaking with their support team directly.

It is true, as this is what I’ve done to create an automated containerized installation of the stack.

“Their support team” probably means MODX LLC? MODX is an open source project, and the LLC is just one party that’s involved. Just because someone at the LLC doing support says something, does not mean it’s gospel. :wink:

Neither the code, nor any documentation that I know off, instructs or suggests using a separate location for the source, from the target location where it needs to be installed. That it works with inplace=0 and unpacked=0 is an amazing feat, but not necessarily intentional.

If LLC wants to provide support for it, that’s up to them (you probably pay them enough for that privilige :wink: ), but as integrator/code owner I cannot in good conscious recommend behavior that’s not documented or even hinted at anywhere. Because it’s not a documented feature, it is not tested, and that means a change to the setup may cause your automation to fail without it being considered a breaking change, versioning wise.

Don’t get me wrong - I’m glad you have it working, and I learned something new today, just be careful relying on things that are not deliberately built or promised to work a certain way.

I’m looking forward to reviewing your edits. I’ve just checked the CLI installation docs again but while the descriptions for the options are indeed not great at explaining what they’re for, I still don’t see anything instructing to use it the way you are.

Fair enough. I dont believe in any one entity as gospel whether it’s support or someone with 10 years of experience. I’d prefer to have dialogue around it and figure out what’s really happening intended or not. i’m just the new guy in the middle trying to make something work, in a good way, as how I perceive it from different somewhat obscure sources.

I extracted some of the logic by how they’re creating a container here:

My support was with the modxcloud support team.