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

Fatal error after composer install #598

Closed
dipohl opened this issue Aug 14, 2021 · 5 comments
Closed

Fatal error after composer install #598

dipohl opened this issue Aug 14, 2021 · 5 comments

Comments

@dipohl
Copy link
Contributor

dipohl commented Aug 14, 2021

Environment:

  • Rocky Linux 8.4
  • php-fpm-7.4.6-4.module+el8.4.0+415+e936cba3.x86_64
  • nginx-1.14.1-9.module+el8.4.0+542+81547229.x86_64

Installation with composer

# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

# php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
php composer-setup.php --version=1.10.22
All settings correct for using Composer
Downloading...

Composer (version 1.10.22) successfully installed to: /usr/share/nginx/html/composer.phar
Use it: php composer.phar

# php composer.phar create-project picocms/pico-composer pico
Creating a "picocms/pico-composer" project at "./pico"
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Installing picocms/pico-composer (v2.1)
  - Installing picocms/pico-composer (v2.1): Loading from cache
Created project in /usr/share/nginx/html/pico
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Package operations: 9 installs, 0 updates, 0 removals
  - Installing picocms/composer-installer (v1.0.1): Loading from cache
  - Installing erusev/parsedown (1.8.0-beta-7): Loading from cache
  - Installing erusev/parsedown-extra (0.8.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.23.0): Loading from cache
  - Installing symfony/yaml (v2.8.52): Loading from cache
  - Installing twig/twig (v1.44.4): Loading from cache
  - Installing picocms/pico (v2.1.0): Loading from cache
  - Installing picocms/pico-deprecated (v2.1.0): Loading from cache
  - Installing picocms/pico-theme (v2.1.0): Loading from cache
Writing lock file
Generating autoload files
> Pico\Composer\Installer\PluginInstaller::postAutoloadDump
Creating Pico plugins file
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Got a blank page website and the following error messages in nginx error log:

2021/08/14 18:20:37 [error] 475353#0: *4 FastCGI sent in stderr: 
PHP message: PHP Notice:  Undefined index: text in /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 213
PHP message: PHP Notice:  Undefined index: text in /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 213
PHP message: PHP Notice:  Undefined index: markup in /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 232
PHP message: PHP Warning:  DOMDocument::loadHTML(): Empty string supplied as input in /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 483
PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given in /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php:484
Stack trace:
#0 /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php(484): DOMNode->removeChild()
#1 /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php(232): ParsedownExtra->processTag()
#2 /usr/share/nginx/html/pico/vendor/erusev/parsedown/Parsedown.php(221): ParsedownExtra->blockMarkupComplete()
#3 /usr/share/nginx/html/pico/vendor/erusev/parsedown/Parsedown.php(52): Parsedown->linesElements()
#4 /usr/share/nginx/html/pico/vendor/erusev/parsedown/Parsedown.php(26): Parsedown->textElements()
#5 /usr/share/nginx/html/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php(46): Parsedown->text()
#6 /usr/share/nginx/html/pico/vendor/picocms/pico/lib/Pico.php(1661): ParsedownExtra->text()
#7 /usr/share/nginx/html/pico/vendor/picocms/pico/" while reading response header from upstream, client: XX.XX.XX.XX, server: example.org, request: "GET / HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "example.org"`
@dipohl
Copy link
Contributor Author

dipohl commented Aug 14, 2021

Same was reported before from other peoples in (unfortunately closed without fixing) issue #525

I was glad to find this via internet search as the recipe "install from archive not with composer" also worked for me.

@dipohl
Copy link
Contributor Author

dipohl commented Aug 14, 2021

My first try with current composer version 2.x following your installation docs brought an alarming warning, therefore I tried with the older composer version 1.x as described above.

Loading "picocms/composer-installer" which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.

@PhrozenByte
Copy link
Collaborator

PhrozenByte commented Aug 15, 2021

The dependencies are wrong. I'm not sure why, because Pico's composer.json is specifically pinning down Parsedown Extra 0.8.0-beta.1 - the installed Parsedown Extra 0.8.1 is not compatible with Parsedown 1.8.0-beta-7 (yeah, it's a total mess on Parsedown's side...). Not sure why Composer is doing this, it contradicts the version constraint. Can you please check the Pico version installed via Composer? Either check your composer.lock and search for version below the picocms/Pico package, or check Pico's VERSION constant in vendor/picocms/pico/lib/Pico.php.

@PhrozenByte
Copy link
Collaborator

PhrozenByte commented Aug 15, 2021

We did some research via IRC and it isn't reproducible. It looks like Composer sometimes chooses to install Pico v2.1.0 instead of the latest Pico 2.1 version (Pico 2.1.4 right now), causing the issues reported. After clearing caches it started working for @dipohl, too. Thank you very much for your time and help @dipohl! ❤️

So, for everyone else experiencing this issue: You can force Composer to install Pico v2.1.4 (or later - please check Pico's latest version first and update the following command accordingly). After you've executed composer create-project change into Pico's install directory (cd /var/www/html/pico/) and execute the following: composer require picocms/pico ^2.1.4

If this fails, too, use one of Pico's pre-bundled releases (instructions) instead. By using a pre-bundled release you end up with the exact same setup, i.e. you can still follow the "I've used Composer to install Pico" instructions later.

Duplicate of #525

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

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

No branches or pull requests

2 participants