glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.25k stars 1.29k forks source link

Problem with composer.json - build apereo/phpcas. #13750

Closed Wolvverine closed 1 year ago

Wolvverine commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.5

Bug description

Problem with build apereo/phpcas.

Warning: file_get_contents(/var/www/vendor/glpi-project/inventory_format/lib/php/../../source_files/pci.ids): Failed to open stream: No such file or directory in /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php on line 205

Fatal error: Uncaught RuntimeException: Empty content in /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php:209

Relevant log output

2023-01-05T10:49:03.0264892Z Step 7/57 : RUN curl --silent --show-error --fail --remote-name-all       https://raw.githubusercontent.com/glpi-project/glpi/${GLPI_VERSION}/composer.json       https://raw.githubusercontent.com/glpi-project/glpi/${GLPI_VERSION}/composer.lock     && COMPOSER_HOME=/tmp/composer composer require       --apcu-autoloader       --classmap-authoritative       --ignore-platform-reqs       --no-interaction       --no-progress       --no-suggest       --optimize-autoloader       --prefer-dist       --update-no-dev       --working-dir ${GLPI_PATHS_ROOT}       apereo/phpcas     && rm -fv composer.json
2023-01-05T10:49:03.0391029Z  ---> Running in ab6257ffa92e
2023-01-05T10:49:04.1119869Z You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
2023-01-05T10:49:04.7303709Z Info from https://repo.packagist.org: #StandWithUkraine
2023-01-05T10:49:04.7561543Z ./composer.json has been updated
2023-01-05T10:49:04.9244083Z Running composer update apereo/phpcas
2023-01-05T10:49:04.9314141Z Loading composer repositories with package information
2023-01-05T10:49:05.5676846Z Updating dependencies
2023-01-05T10:49:05.5797490Z Lock file operations: 1 install, 0 updates, 0 removals
2023-01-05T10:49:05.5800097Z   - Locking apereo/phpcas (1.6.0)
2023-01-05T10:49:05.5822782Z Writing lock file
2023-01-05T10:49:05.5825259Z Installing dependencies from lock file
2023-01-05T10:49:05.5859020Z Package operations: 1 install, 0 updates, 0 removals
2023-01-05T10:49:05.5866715Z   - Downloading apereo/phpcas (1.6.0)
2023-01-05T10:49:05.6493293Z   - Installing apereo/phpcas (1.6.0): Extracting archive
2023-01-05T10:49:05.8578279Z Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
2023-01-05T10:49:05.8578788Z Package true/punycode is abandoned, you should avoid using it. No replacement was suggested.
2023-01-05T10:49:05.8579137Z Generating optimized autoload files
2023-01-05T10:49:07.5899604Z     Skipped installation of bin bin/sabredav for package sabre/dav: file not found in package
2023-01-05T10:49:07.5900091Z     Skipped installation of bin bin/naturalselection for package sabre/dav: file not found in package
2023-01-05T10:49:07.5900537Z     Skipped installation of bin bin/vobject for package sabre/vobject: file not found in package
2023-01-05T10:49:07.5900974Z     Skipped installation of bin bin/generate_vcards for package sabre/vobject: file not found in package
2023-01-05T10:49:07.5901491Z     Skipped installation of bin bin/pscss for package scssphp/scssphp: file not found in package
2023-01-05T10:49:07.5902014Z     Skipped installation of bin bin/jsonlint for package seld/jsonlint: file not found in package
2023-01-05T10:49:07.5902554Z     Skipped installation of bin bin/cam for package wapmorgan/unified-archive: file not found in package
2023-01-05T10:49:07.5902991Z 39 packages you are using are looking for funding.
2023-01-05T10:49:07.5903578Z Use the `composer fund` command to find out more!
2023-01-05T10:49:07.7396239Z > @php -r "file_put_contents('.composer.hash', sha1_file('composer.lock'));"
2023-01-05T10:49:07.7550945Z > @php -f vendor/bin/build_hw_jsons
2023-01-05T10:49:07.7815501Z 
2023-01-05T10:49:07.7816314Z Warning: file_get_contents(/var/www/vendor/glpi-project/inventory_format/lib/php/../../source_files/pci.ids): Failed to open stream: No such file or directory in /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php on line 205
2023-01-05T10:49:07.7816733Z 
2023-01-05T10:49:07.7817107Z Fatal error: Uncaught RuntimeException: Empty content in /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php:209
2023-01-05T10:49:07.7817473Z Stack trace:
2023-01-05T10:49:07.7817958Z #0 /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php(227): Glpi\Inventory\FilesToJSON->getSourceFile('pciid')
2023-01-05T10:49:07.7818563Z #1 /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php(118): Glpi\Inventory\FilesToJSON->convertPciFile()
2023-01-05T10:49:07.7819356Z #2 /var/www/vendor/glpi-project/inventory_format/bin/build_hw_jsons(7): Glpi\Inventory\FilesToJSON->run()
2023-01-05T10:49:07.7819850Z #3 /var/www/vendor/bin/build_hw_jsons(120): include('/var/www/vendor...')
2023-01-05T10:49:07.7820114Z #4 {main}
2023-01-05T10:49:07.7820508Z   thrown in /var/www/vendor/glpi-project/inventory_format/lib/php/FilesToJSON.php on line 209
2023-01-05T10:49:07.7848006Z Script @php -f vendor/bin/build_hw_jsons handling the post-update-cmd event returned with error code 255

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

cedric-anne commented 1 year ago

Hi,

It seems that you are trying to mix the release archive with an updated composer.json file. Release archive is cleaned to remove files that are useless on production environment. If you want to do such thing, you should remove the vendor directory and then use composer install to force fetching all vendor files.

github-actions[bot] commented 1 year ago

This issue has been closed as we only track bugs here.

You can get community support on forums or you can consider taking a subscription to get professional support. You can also contact GLPI editor team directly.

Wolvverine commented 1 year ago

@cedric-anne Maybe in that case add apereo/phpcas to the standard GLPI build ?

As far as I can see, the licensing problem that caused the library to be removed 4 years ago currently does not exist.

https://www.apache.org/licenses/GPL-compatibility.html

composer.json: "ext-zlib": "*", "apereo/phpcas": "^1.6", "blueimp/jquery-file-upload": "^10.32",

trasher commented 1 year ago

see https://github.com/glpi-project/glpi/pull/13388