enterprisemediawiki / meza

Setup an enterprise MediaWiki server with simple commands
MIT License
41 stars 27 forks source link

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

Closed hans-pistor closed 3 years ago

hans-pistor commented 3 years ago

Environment

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

jamesmontalvo3 commented 3 years ago

Closed by #1275