Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force Meza to use Composer 1.x (Composer 2.0 breaks deploy) #1272

Closed
hans-pistor opened this issue Nov 11, 2020 · 4 comments
Closed

Force Meza to use Composer 1.x (Composer 2.0 breaks deploy) #1272

hans-pistor opened this issue Nov 11, 2020 · 4 comments

Comments

@hans-pistor
Copy link

Environment

  • Machine or Virtual Machine details: Digital Ocean CentOS 7 Droplet
  • Operating System: CentOS Linux release 7.8.2003 (Core)
  • meza version hash: 8b5c112

Issue details

With the release of composer 2.0 on Oct 24, meza deploy monolith is no longer working. In order to fix, you have to edit the ansible composer script to install version <2. I was successful using 1.4.1, haven't tested any others. To downgrade to any composer version simply specify the version number after self-update.

/opt/meza/src/roles/composer/tasks/main.yml

- name: Update Composer to version 1.4.1
  shell: >
    {{ php_executable }} {{ composer_path }} self-update 1.4.1
  register: composer_update
  changed_when: "'Updating to version' in composer_update.stdout"
  when: composer_keep_updated
@jamesmontalvo3
Copy link
Contributor

I just ran into an issue where a server upgraded Composer, and the deploy failed with this:

TASK [composer : Update Composer to latest version (if configured).] ***********
Thursday 17 December 2020  19:03:01 -0600 (0:00:00.038)       0:02:41.483 *****
changed: [ser.ver.ip.addr]

TASK [Ensure composer cache is clear] ******************************************
Thursday 17 December 2020  19:03:04 -0600 (0:00:03.042)       0:02:44.525 *****
fatal: [ser.ver.ip.addr]: UNREACHABLE! => {
    "changed": false,
    "unreachable": true
}

MSG:

Failed to connect to the host via ssh: Shared connection to ser.ver.ip.addr closed.

PLAY RECAP *********************************************************************
ser.ver.ip.addr            : ok=80   changed=8    unreachable=1    failed=0    skipped=17   rescued=0    ignored=0
localhost                  : ok=25   changed=2    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0

Since this was run as root, I ran sudo /usr/local/bin/composer clear-cache manually. Composer doesn't like this and discourages doing so. I made it run anyway, and on the following deploy it got past this point without issue.

I believe the deploy failed because it hit the point where it required user input to say "yes I do want to run this as root". Meza should be fixed to not require root for this or any Composer action.

@jamesmontalvo3
Copy link
Contributor

I worked through some other issues, then got hit with another Composer 2.x issue. So agreed Composer 2.x doesn't seem to be supported.

@jamesmontalvo3 jamesmontalvo3 changed the title Composer 2.0 release breaks install script Force Meza to use Composer 1.x (Composer 2.0 breaks deploy) Dec 18, 2020
@jamesmontalvo3
Copy link
Contributor

Fixed in 31.x branch. Have some work to do to cleanup master vs 31.x vs everything else.

@jamesmontalvo3
Copy link
Contributor

Closed by #1275

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants