Composer fails to update module with error

Created on 28 January 2023, almost 2 years ago
Updated 21 April 2023, over 1 year ago

Problem statement

composer update on Windows fails to update module with following error

In ZipDownloader.php line 210:

  The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): ZipArchive::extractTo(D:\Git\asn9.sk/vendor/composer/faa30b5c/flood_control\migrations\state/flood_control.mig
  rate_drupal.yml ): Failed to open stream: Permission denied

In ZipDownloader.php line 197:

  ZipArchive::extractTo(D:\Git\asn9.sk/vendor/composer/faa30b5c/flood_control\migrations\state/flood_control.migrate_drupal.yml ): Failed to open stream: Permission denied

PHP Version

php -v
PHP 8.1.11 (cli) (built: Sep 28 2022 11:08:17) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.11, Copyright (c) Zend Technologies
πŸ› Bug report
Status

Fixed

Version

2.3

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia Matus Grinvalsky

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Matus Grinvalsky
  • πŸ‡ΊπŸ‡ΈUnited States wolfborg

    Encountered a similar issue with this file as well tonight. Was able to update with composer but it would somehow not let me commit the update of that file to our project repo.

    Looking into it, it appeared my system wasn't actually recognizing it as a YAML file despite having a .yml ending. Figured out there is somehow an invisible character at the end of the file name that's causing problems. Not sure how or why it's there, but you can see the extra space in the original post when it's listing the file.

    ZipArchive::extractTo(D:\Git\asn9.sk/vendor/composer/faa30b5c/flood_control\migrations\state/flood_control.migrate_drupal.yml ): Failed to open stream: Permission denied

    In your case, the update likely sees the existing file but doesn't think they're different because of the invisible character. Meanwhile your system interprets them as different because of the space. Which probably caused the error.

    Manually removing the extra space in the name isn't quite enough to fix this because your system will usually throw similar errors because they appear as different files in the same place but with the same exact name.

    Fixed it on my end by changing the filename to a different name entirely first then changing it to the original filename without the extra space.

  • πŸ‡ΊπŸ‡ΈUnited States anthonyroundtree

    Running D9.5.2 and having a similar issue after an attempt to upgrade from 2.2.3 to 2.3.

     - Updating drupal/flood_control (2.2.3 => 2.3.0): Downloading (100%)    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): ZipArchive::extractTo(C:\.../vendor/composer/.../flood_control\migrations\state/flood_control.migrate_drupal.yml ): failed to open stream: Permission denied
        Unzip with ZipArchive class failed, falling back to unzip command
  • πŸ‡ΊπŸ‡ΈUnited States anthonyroundtree

    I believe this is the same issue:
    YAML filename ends in space, git checkout in windows fails. - https://www.drupal.org/project/flood_control/issues/3337620 πŸ› YAML filename ends in space, git checkout in windows fails. Fixed

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡³πŸ‡±Netherlands fabianderijk Alphen aan den Rijn

    Can you check with the new dev branch? I have just fixed πŸ› YAML filename ends in space, git checkout in windows fails. Fixed which fixes the extra space

  • Assigned to fabianderijk
  • πŸ‡³πŸ‡±Netherlands fabianderijk Alphen aan den Rijn
  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024