Can't find Composer on deploy

I’m using Radicle/Trellis for the first time and now I’m trying to deploy. It seems that the script can’t find composer, however, if I log into the server and run any composer command, it works. Composer is available globally, but Trellis can’t seem to find it. Anyone can help? Here’s the full log for the failing task:

TASK [deploy : Run composer check] *********************************************
task path: /Users/abc/Work/zzz/myproject/trellis/roles/deploy/hooks/build-after.yml:55
redirecting (type: modules) ansible.builtin.composer to community.general.composer
redirecting (type: modules) ansible.builtin.composer to community.general.composer
Using module file /Users/abc/Work/zzz/myproject/trellis/.trellis/virtualenv/lib/python3.9/site-packages/ansible_collections/community/general/plugins/modules/composer.py
Pipelining is enabled.
<000.000.0.00> ESTABLISH SSH CONNECTION FOR USER: fmtdes14
<000.000.0.00> SSH: EXEC ssh -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o HostKeyAlgorithms=ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="fmtdes14"' -o ConnectTimeout=10 -o 'ControlPath="/Users/abc/.ansible/cp/485236cf23"' 000.000.0.00 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<000.000.0.00> (1, b'\n{"msg": "Failed to find required executable \\"composer\\" in paths: /usr/local/bin:/home4/fmtdes14/perl5/bin:/usr/local/jdk/bin:/usr/local/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/sbin", "failed": true, "exception": "WARNING: The below traceback may *not* be related to the actual failure.\\n  File \\"/tmp/ansible_composer_payload_QWLmDj/ansible_composer_payload.zip/ansible/module_utils/basic.py\\", line 1443, in get_bin_path\\n    bin_path = get_bin_path(arg=arg, opt_dirs=opt_dirs)\\n  File \\"/tmp/ansible_composer_payload_QWLmDj/ansible_composer_payload.zip/ansible/module_utils/common/process.py\\", line 44, in get_bin_path\\n    raise ValueError(\'Failed to find required executable \\"%s\\" in paths: %s\' % (arg, os.pathsep.join(paths)))\\n", "invocation": {"module_args": {"arguments": "", "executable": null, "no_dev": true, "apcu_autoloader": false, "prefer_dist": false, "no_plugins": false, "working_dir": "/home4/fmtdes14/myproject.whatever.com/myproject.com.br/releases/20231230151753", "ignore_platform_reqs": false, "global_command": false, "composer_executable": null, "classmap_authoritative": false, "command": "check-platform-reqs", "prefer_source": false, "no_scripts": false, "optimize_autoloader": true}}}\n', b"OpenSSH_9.4p1, LibreSSL 3.3.6\r\ndebug1: Reading configuration data /Users/abc/.ssh/config\r\ndebug1: /Users/abc/.ssh/config line 36: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files\r\ndebug1: /etc/ssh/ssh_config line 54: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 000.000.0.00 is address\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/abc/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/abc/.ssh/known_hosts2'\r\ndebug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 97980\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n")
<000.000.0.00> Failed to connect to the host via ssh: OpenSSH_9.4p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/abc/.ssh/config
debug1: /Users/abc/.ssh/config line 36: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 000.000.0.00 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/abc/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/abc/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 97980
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet_timeout: read header failed: Broken pipe
debug2: Received exit status from master 1
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_composer_payload_QWLmDj/ansible_composer_payload.zip/ansible/module_utils/basic.py", line 1443, in get_bin_path
    bin_path = get_bin_path(arg=arg, opt_dirs=opt_dirs)
  File "/tmp/ansible_composer_payload_QWLmDj/ansible_composer_payload.zip/ansible/module_utils/common/process.py", line 44, in get_bin_path
    raise ValueError('Failed to find required executable "%s" in paths: %s' % (arg, os.pathsep.join(paths)))
fatal: [000.000.0.00]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "apcu_autoloader": false,
            "arguments": "",
            "classmap_authoritative": false,
            "command": "check-platform-reqs",
            "composer_executable": null,
            "executable": null,
            "global_command": false,
            "ignore_platform_reqs": false,
            "no_dev": true,
            "no_plugins": false,
            "no_scripts": false,
            "optimize_autoloader": true,
            "prefer_dist": false,
            "prefer_source": false,
            "working_dir": "/home4/fmtdes14/myproject.whatever.com/myproject.com.br/releases/20231230151753"
        }
    },
    "msg": "Failed to find required executable \"composer\" in paths: /usr/local/bin:/home4/fmtdes14/perl5/bin:/usr/local/jdk/bin:/usr/local/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/sbin"
}

PLAY RECAP *********************************************************************
000.000.0.00               : ok=21   changed=7    unreachable=0    failed=1    skipped=31   rescued=0    ignored=0   
localhost                  : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

exit status 2

Log when verbose is off:

TASK [deploy : Check for composer.json in project root or project_subtree_path] ***
ok: [162.241.3.42]

TASK [deploy : Fail if composer.json not found] ********************************
skipping: [162.241.3.42]

TASK [deploy : Setup composer authentications (HTTP Basic)] ********************
skipping: [162.241.3.42]

TASK [deploy : Setup composer authentications (BitBucket OAuth)] ***************
skipping: [162.241.3.42]

TASK [deploy : Setup composer authentications (Other Tokens)] ******************
skipping: [162.241.3.42]

TASK [deploy : Run composer check] *********************************************
fatal: [162.241.3.42]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"composer\" in paths: /usr/local/bin:/home4/fmtdes14/perl5/bin:/usr/local/jdk/bin:/usr/local/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/sbin"}

What platform/host are you using for your remote server? Which version of Ubuntu is it? Did you see any errors when you initially provisioned?