I am trying to create a local setup with trellis and bedrock on my linux mint machine with vagrant.
I have run into this error:
non-zero return code
Changed current directory to /root/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for
details
[RuntimeException]
No composer.json present in the current directory, this may be the cause of
the following exception.
My setup is as follows:
site (directory with bedrock files created by composer)
trellis (clones from git repo)
The only thing i changed in the vagrant.default.yml file was the syncing protocol to rsync as nfs was giving me issues.
I am experiencing the same issue when deploying staging and production servers today. This seems to be related to Prestissimo and the release of Composer 2:
I run across a similar issue as well. In my case the resent release of version 2 of Composer (2 days ago) was causing the issue. We are using an older version of Trellis (1.0.0-rc2), so I’m not sure if the following will apply to everyone.
The way we solved this was by setting composer_keep_updated: false and adding composer_version: '1.10.6' (or probably whatever <2 version works best for you) to the group_vars/all/main.yml file.
So basically the first two lines of the file now look like this:
I had to provision a server today, which was fine but now I can’t deploy anything. I’ve tried everything possible to get past this but no cigar.
non-zero return code
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run
composer update.
Problem 1
- composer/installers is locked to version v1.6.0 and an update of this
package was not requested.
- composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found
composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found
composer-plugin-api[2.0.0] but it does not match the constraint.
- soberwp/controller 2.1.1 requires composer/installers ^1.0 ->
satisfiable by composer/installers[v1.6.0].
- soberwp/controller is locked to version 2.1.1 and an update of this
package was not requested.
You are using Composer 2, which some of your plugins seem to be incompatible
with. Make sure you update your plugins or report a plugin-issue to ask them
to support Composer 2.
Have you ensured that the actual composer executable on the Trellis web server is 1.x, not 2.x?
You can use the composerself-update command to force a specific version of composer, in this case 1.x.
Trellis should also offer a composer version field.
Anyone with the issue of Trellis automatically updating to version 2.0. See this response on Github, it’s exactly what I’ve used and works fine, sticking to the version you define.
If you make this change, don’t modify/remove this. Leave as-is (if you’re forcing Trellis to use specific 1.x version.)
ystem info:
Ansible 2.10.2; Vagrant 2.2.10; Linux
Trellis version (per changelog): "Allow WP cron intervals to be configurable"
---------------------------------------------------
The "roots/wordpress-core-installer" plugin was skipped because it requires a
Plugin API version ("^1.0") that does not match your Composer installation
("2.0.0"). You may need to run composer update with the "--no-plugins"
option. Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform. Your lock
file does not contain a compatible set of packages. Please run composer
update. Problem 1 - roots/wordpress-core-installer is locked to version 1.1.0
and an update of this package was not requested. - roots/wordpress-core-
installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-
api[2.0.0] but it does not match the constraint. Problem 2 - roots/wordpress-
core-installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-
plugin-api[2.0.0] but it does not match the constraint.
So it seems like i need to try to keep the composer version to below 2.0.
tkhara@tkhara-lenovo:~/envs/trellis/trellis_example_1/trellis$ sudo composer self-update 1.10.6
[sudo] password for tkhara:
Updating to version 1.10.6 (stable channel).
Downloading (100%)
Use composer self-update --rollback to return to version 1.10.13
tkhara@tkhara-lenovo:~/envs/trellis/trellis_example_1/trellis$
But, I keep getting this error:
The "roots/wordpress-core-installer" plugin was skipped because it requires a
Plugin API version ("^1.0") that does not match your Composer installation
("2.0.0"). You may need to run composer update with the "--no-plugins"
option. Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform. Your lock
file does not contain a compatible set of packages. Please run composer
update. Problem 1 - roots/wordpress-core-installer is locked to version 1.1.0
and an update of this package was not requested. - roots/wordpress-core-
installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-
api[2.0.0] but it does not match the constraint. Problem 2 - roots/wordpress-
core-installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-
plugin-api[2.0.0] but it does not match the constraint. - roots/wordpress
5.5.1 requires roots/wordpress-core-installer >=1.0.0 -> satisfiable by
roots/wordpress-core-installer[1.1.0]. - roots/wordpress is locked to version
5.5.1 and an update of this package was not requested. You are using Composer
2, which some of your plugins seem to be incompatible with. Make sure you
update your plugins or report a plugin-issue to ask them to support Composer
You have to apply the server playbook (provision step) before you can run the deploy script (separate playbook), otherwise the composer version is not ensured by ansible.
I now uncommented those two lines and ran vagrant up --provision and landed up with this error:
non-zero return code
Changed current directory to /root/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for
details
[RuntimeException]
No composer.json present in the current directory, this may be the cause of
the following exception.
[InvalidArgumentException]
Package hirak/prestissimo at version @stable has a PHP requirement
incompatible with your PHP version, PHP extensions and Composer version
The composer version line and now my main.yml looks like the above.
composer version in the server is 1.10.6
The dev setup looks good to go.
I know this is not related to this thread, but could I ask you to suggest some documentation or resource you may have used to do your first deploy using trellis?
I’d like to make a few changes to this local environment and see if I can deploy it properly.