Roots Discourse

Trellis Deploy Staging Composer Fails, Referencing Old .env Variables

Having some composer dependency update problems on a staging site.

Seems that it is referencing old .env variables that no longer exist in the current site/composer.json

If I run ansible-playbook deploy.yml -e env=staging -e site=mysite.com --limit=kinsta_staging -vvvv it seems to be pulling from outdated “releases” directory on staging, e.g. ~/public/releases/20210301183854/composer.json or composer.lock .e.g.:

kinsta_staging]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "apcu_autoloader": false,
            "arguments": "",
            "classmap_authoritative": true,
            "command": "install",
            "executable": null,
            "global_command": false,
            "ignore_platform_reqs": false,
            "no_dev": true,
            "no_plugins": false,
            "no_scripts": true,
            "optimize_autoloader": true,
            "prefer_dist": false,
            "prefer_source": false,
            "working_dir": "/www/mysite_466/public/releases/20210301183854"
        }
    },

And the error is something like:
[FFraenz\\PrivateComposerInstaller\\Exception\\MissingEnvException] \n Can't resolve placeholder {%WP_ALL_EXPORT_PRO_URL}. Environment variable 'WP_ALL_EXPORT_PRO_URL' is not set.

The updated composer.json / composer.lock no longer uses this env variable.

Is there a way to clear this out / force the build to use the one updated in version control?

Sincerely,
Jess

Seems that my site/vendor/composer/installed.json wasn’t matching my site/composer.json site/composer.lock. Instead the installed.json had the old stuff, causing the build to fail. Removing it and making composer rebuild it seemed to work.

1 Like

May I ask how to get this WP_ALL_EXPORT_PRO_URL url?
Can’t find it in the docs anywhere, I just purchased the pro plugin but can’t get it to work with Composer 2.
Thanks!