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

PHP's phar extension is missing #18

Open
maechler opened this issue Feb 8, 2025 · 14 comments
Open

PHP's phar extension is missing #18

maechler opened this issue Feb 8, 2025 · 14 comments

Comments

@maechler
Copy link

maechler commented Feb 8, 2025

I recently updated actions/checkout@v3 to actions/checkout@v4 and started getting the following error:

Run tomasnorre/typo3-upload-ter@v2
  with:
    api-token: ***
    php-version: 8.3

Preparing git configuration (safe.directory)

Preparing upload of release v3.0.1 to TER

Preparing Release
PHP's phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.

PHP Fatal error:  Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in /root/.composer/vendor/symfony/polyfill-mbstring/Mbstring.php:130
Stack trace:
#0 /root/.composer/vendor/symfony/polyfill-mbstring/bootstrap80.php(15): Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding()
#1 /root/.composer/vendor/symfony/console/Application.php(1271): mb_convert_encoding()
#2 /root/.composer/vendor/symfony/console/Application.php(884): Symfony\Component\Console\Application->splitStringByWidth()
#3 /root/.composer/vendor/symfony/console/Application.php(857): Symfony\Component\Console\Application->doRenderThrowable()
#4 /root/.composer/vendor/symfony/console/Application.php(158): Symfony\Component\Console\Application->renderThrowable()
#5 /root/.composer/vendor/symfony/console/Application.php(184): Symfony\Component\Console\Application->Symfony\Component\Console\{closure}()
#6 /root/.composer/vendor/typo3/tailor/bin/tailor(46): Symfony\Component\Console\Application->run()
#7 /root/.composer/vendor/typo3/tailor/bin/tailor(47): {closure}()
#8 {main}
  thrown in /root/.composer/vendor/symfony/polyfill-mbstring/Mbstring.php on line 130

This is my configuration:

name: TER Upload
on:
  push:
    tags:
      - "**"
jobs:
  TERUpload:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Upload to TER
        uses: tomasnorre/typo3-upload-ter@v2
        with:
          api-token: ${{ secrets.TYPO3_API_TOKEN }}

I haven't used the TER upload in over a year, so it could also be related to something else than the GitHub actions version.

Do you know what this could be? Do we maybe just have to add the phar extension to the Dockerfile?

@tomasnorre
Copy link
Owner

Thanks for reporting the issue. How do you composer prepare-release step looks like in your composer.json?

@maechler
Copy link
Author

maechler commented Feb 8, 2025

Thanks for your quick reply! It's simply using some shell commands and looks like this:
https://github.com/bithost-gmbh/pdfviewhelpers/blob/4bd4d10d7185523bc4b6e5bd256bc4a5ecf339dc/composer.json#L61-L78

@tomasnorre
Copy link
Owner

Thanks. Will have to check it out. Don't see at first glace, why you should need phar. But will look into it.

@tomasnorre
Copy link
Owner

I think the FATAL is more the problem than the phar missing.

PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv()

@tomasnorre
Copy link
Owner

Currently I cannot test locally as the composer prepare-release fails.

$ composer prepare-release
> rm -rf Resources/Private/PHP/tcpdf
> wget https://github.com/tecnickcom/TCPDF/archive/refs/tags/6.6.5.zip -O Resources/Private/PHP/tcpdf.zip
--2025-02-08 18:07:03--  https://github.com/tecnickcom/TCPDF/archive/refs/tags/6.6.5.zip
Resolving github.com (github.com)... 4.225.11.194
Connecting to github.com (github.com)|4.225.11.194|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/tecnickcom/TCPDF/zip/refs/tags/6.6.5 [following]
--2025-02-08 18:07:04--  https://codeload.github.com/tecnickcom/TCPDF/zip/refs/tags/6.6.5
Resolving codeload.github.com (codeload.github.com)... 140.82.121.10
Connecting to codeload.github.com (codeload.github.com)|140.82.121.10|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-02-08 18:07:04 ERROR 404: Not Found.

Script wget https://github.com/tecnickcom/TCPDF/archive/refs/tags/6.6.5.zip -O Resources/Private/PHP/tcpdf.zip handling the prepare-release event returned with error code 8

@tomasnorre
Copy link
Owner

I have created a new release v2.2.0 which includes php-mbstring. Please test that. I expect it to work.

@maechler
Copy link
Author

maechler commented Feb 8, 2025

@tomasnorre Thanks for checking this so quickly! The fatal error is gone now, but it's still not working:

Preparing upload of release v3.0.2 to TER

Preparing Release
PHP's phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.

Publishing version 3.0.2 of extension pdfviewhelpers
====================================================

Warning: ] Could not publish version 3.0.2 of extension pdfviewhelpers.         
           Reason: Required request body for 'NewVersion' is missing in the     
           request.  

Maybe this is related to actions/checkout@v4? Have you already successfully run it with v4?

I will have to check the prepare-release script, I haven't used it in over a year and it seems broken, thanks! However I think the error is unrelated to this, as their should still be the rest of the extension to be uploaded.

@tomasnorre
Copy link
Owner

I haven't had a successful run yet, but using actions/checkout@v4 https://github.com/tomasnorre/crawler/blob/main/.github/workflows/Deploy.yml

I know there have been some issues with the TER.
https://typo3.slack.com/archives/C3TEAEA0K/p1738149098790829 (TYPO3 Slack)

And haven't heard it's working yet. I think the next issue is related to TER, but not sure.
Will keep this issue open till we are sure.

@maechler
Copy link
Author

maechler commented Feb 9, 2025

@tomasnorre Thanks for showing me this, I'll have an eye on it! ..and thanks for your extension!

@simonschaufi
Copy link

I have the same issue now: https://github.com/christophlehmann/imageoptimizer/actions/runs/13357068735/job/37301310363

Run tomasnorre/typo3-upload-ter@v2
/usr/bin/docker run --name f22fe6ea[5](https://github.com/christophlehmann/imageoptimizer/actions/runs/13357068735/job/37301310363#step:4:6)83fde444aea4c5f91449e16d9f_e41725 --label 268f22 --workdir /github/workspace --rm -e "INPUT_API-TOKEN" -e "INPUT_PHP-VERSION" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/imageoptimizer/imageoptimizer":"/github/workspace" 268f22:fe6ea583fde444aea4c5f91449e16d9f  "***" "8.3"
Preparing git configuration (safe.directory)

Preparing upload of release 5.0.0 to TER

Preparing Release
PHP's phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.

Publishing version 5.0.0 of extension imageoptimizer
====================================================

Warning: ] Could not publish version 5.0.0 of extension imageoptimizer.         
           Reason: Required request body for 'NewVersion' is missing in the     
           request.

@tomasnorre
Copy link
Owner

I still think it's related to the problems with the TER linked above. But I'll be looking into it.

@tomasnorre
Copy link
Owner

Just for reference TYPO3/tailor#82

@garbast
Copy link

garbast commented Feb 26, 2025

No complaint, just a followup that the error is still present. See https://github.com/evoWeb/sf_register/actions/runs/13552074913/job/37877878770

@tomasnorre
Copy link
Owner

No complaint, just a followup that the error is still present. See https://github.com/evoWeb/sf_register/actions/runs/13552074913/job/37877878770

I know. it's not in the GitHub Action that the problem lies, but in tailor it self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants