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

Errors when running composer install: Unable to add newly converted phar task_linux_amd64.tar #135

Closed
beto-aveiga opened this issue Oct 26, 2022 · 11 comments
Labels
bug Something isn't working client affected lsm

Comments

@beto-aveiga
Copy link
Collaborator

I'm trying to run functional tests.
When I run the "Build Project" step, on the first line that runs composer install, it fails.
Do you know what is happening?
Thanks!


composer [install] failed, composer command failed: ComposeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-abc-exampleorg-website docker-compose -f /home/runner/work/abc-example.org-website/abc-example.org-website/.ddev/.ddev-docker-compose-full.yaml exec -w /var/www/html/drupal -T web composer install', action='[exec -w /var/www/html/drupal -T web composer install]', err='exit status 1', stdout='Gathering patches for root package.


In BinaryInstaller.php line 214:
Unable to add newly converted phar "/var/www/html/.ddev/.drainpipe-composer-cache/files/lullabot/drainpipe/bin/task/3.9.0/task_linux_amd64.tar" to the list of phars, a phar with that name already exists

image

Workflow code

name: "Functional Tests"

on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  Functional-Tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: actions/cache@v3
        with:
          path: ${{ github.workspace }}/.ddev/.drainpipe-composer-cache
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-composer-

      - uses: ./.github/actions/drainpipe/set-env

      - name: Install and Start DDEV
        uses: ./.github/actions/drainpipe/ddev
        with:
          git-name: Drainpipe Bot
          git-email: no-reply@example.com
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
          ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}

      - name: Build Project
        run: |
          composer install --no-interaction --quiet
          echo "PANTHEON_TOKEN=${{ secrets.PANTHEON_TERMINUS_TOKEN }}" > .env
          ddev task build:ci:functional

@deviantintegral
Copy link
Member

Unable to add newly converted phar "/var/www/html/.ddev/.drainpipe-composer-cache/files/lullabot/drainpipe/bin/task/3.9.0/task_linux_amd64.tar" to the list of phars, a phar with that name already exist

That seems odd that it's trying to interpret this as a phar. Oh, no it's not, we're just borrowing the phar extension's built in support for tar.gz files:

https://github.com/Lullabot/drainpipe/blob/main/src/BinaryInstaller.php#L212

@beto-aveiga can you replicate this locally? I wonder if there's a bug causing this if statement to not trigger correctly: https://github.com/Lullabot/drainpipe/blob/main/src/BinaryInstaller.php#L200-L202

Somewhat related: #114

@beto-aveiga
Copy link
Collaborator Author

@deviantintegral I can't replicate it locally. I ran ddev composer install and all looks good.
I even cleared Composer's cache and ran ddev composer install again, but it was fine.

I tried this and didn't work either 🤷🏼

@beto-aveiga
Copy link
Collaborator Author

@deviantintegral: it fails when installing the binary for task. I thought it was because something else required that library/binary, but I can't find it (yet). Also, task seems to be the first binary, so maybe the issue is unrelated to the task binary.

@justafish
Copy link
Member

@beto-aveiga I've updated the task binary in the latest release, do you still have this issue?

@elvism-lullabot
Copy link
Collaborator

@deviantintegral @justafish I am seeing the aforementioned error while running composer install on the same project Luis has worked on. It seems this is a Lando only error, cause I am not able to reproduce this on my DDev setup. Here is a gist of the output
Also, the following command is executed using Lando tooling cd /app/drupal/ && COMPOSER_PROCESS_TIMEOUT=600 composer install --no-dev

@YesCT YesCT changed the title Errors when running composer install Errors when running composer install: Unable to add newly converted phar task_linux_amd64.tar Mar 28, 2023
@YesCT
Copy link
Contributor

YesCT commented Mar 28, 2023

@elvism-lullabot If you run composer install again (twice), does it complete the second time ok?

I ask, because I ran into the error

In BinaryInstaller.php line 214:

  Unable to add newly converted phar "/mnt/ddev-global-cache/composer/files/lullabot/drainpipe/bin/task/3.18.0/task_linux_amd64.tar"
  to the list of phars, a phar with that name already exists

and @mrdavidburns 's suggestion of running it twice worked for my local.

@baluv3
Copy link

baluv3 commented May 3, 2023

Noting here that we think this issue will be resolved, when #172 is completed.

@tess-ten7
Copy link

Until #172 is completed, is there a workaround?

@deviantintegral
Copy link
Member

@tess-ten7 reviews and testing of #207 would be appreciated. We've been pulling that branch into a single project for a while now, but knowing it's working well on a second (and independent one at that) would be great feedback. And, anything in the code too!

@tess-ten7
Copy link

@deviantintegral Trying that PR as a patch results in a similar failure, and doesn't solve the underlying issue:

Run "composer audit" for a full list of advisories.
🪠 [Drainpipe] vendor/lullabot/drainpipe/scaffold/env/dotenv.php' missing from autoload-dev files

In BinaryInstaller.php line 214:
                                                                               
  Unable to add newly converted phar "/var/www/html/.ddev/.drainpipe-composer  
  -cache/files/lullabot/drainpipe/bin/task/3.28.0/task_linux_amd64.tar" to th  
  e list of phars, a phar with that name already exists                        
                                                                               

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

Composer [install] failed, composer command failed: composeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-***org docker-compose -f /home/runner/work/***.org/***.org/.ddev/.ddev-docker-compose-full.yaml exec -w /var/www/html -T -e XDEBUG_MODE=off web composer install', action='[]', err='exit status 1', stdout='Gathering patches for root package.

@deviantintegral
Copy link
Member

@tess-ten7 you will have to instead point to the branch in composer.json, and then update the extra section to opt-in to global binaries. If you patch it in it comes in too late for the hooks to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client affected lsm
Projects
None yet
Development

No branches or pull requests

9 participants