ramsey / composer-install

:gift: A GitHub Action to streamline installation of PHP dependencies with Composer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to extracting archive when use parallel jobs with ramsey/composer-install@v1

alies-dev opened this issue · comments

name: Run tests and deploy

on:
  workflow_dispatch:
  push:
    paths:
      - '**.php'
      - '**.js'
      - '**.json'
      - '**.xml'
      - 'composer.*'
      - '.github/workflows/main.yml'

jobs:

  test_php:
    name: Run PHP tests
    runs-on: ubuntu-18.04

    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          extensions: bcmath, curl, dom, filter, gd, hash, intl, json, libxml, mbstring, openssl, pdo_mysql, pdo, redis, simpleXML
          coverage: none

      - name: Install composer dependencies
        uses: ramsey/composer-install@v1
        with:
          composer-options: "--prefer-dist --no-scripts"


  check_php_syntax:
    name: Check PHP syntax
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          extensions: bcmath, curl, dom, filter, gd, hash, intl, json, libxml, mbstring, openssl, pdo_mysql, pdo, redis, simpleXML
          tools: cs2pr
          coverage: none

      - name: Install composer dependencies
        uses: ramsey/composer-install@v1
        with:
          composer-options: "--prefer-dist --no-scripts"
Failed to extract square1/nova-metrics: (9) '/usr/bin/unzip' -qq '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61' -d '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/344f5f96'

[/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61 or
        /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61.zip, and cannot find /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of square1/nova-metrics failed
Error: '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61' is not a zip archive.

Happens here as well, over and over again.
I cannot give exact numbers, but I'd say at least one in 5 pushes lead to a failed job (I have multiple parallel actions running).
Each time a different composer package is presented as cause, it is completely random. When I hit "Re-run all jobs" it usually works, but sometimes it doesn't.
So yes, @lptn might be right with the assumption that it is somehow caused by parallel jobs.

Happening more and more every day. Have to manually re-run the workflow, sometimes multiple times for it to successfully install composer dependencies.

It happens so often that now I have to look for it every time a workflow run and wait to restart it when fails. It started with a fail every now & then, eventually now becoming a bottleneck in every workflow run 😞

maybe its the same issue then #152

This is fixed in v2, please upgrade using ramsey/composer-install@v2 or ramsey/composer-install@2.0.0. Details are available on the release announcement and the README.

Thanks!