terminal42 / contao-shortlink

Extension to create shortlinks in Contao CMS
MIT License
2 stars 5 forks source link

Updating Contao results in critical error #11

Closed christophbach closed 2 years ago

christophbach commented 3 years ago

Hi,

everytime I'm updating Contao the composer install process results in an error and afterwards the website is killed into a critical 500. A prior dry run was fine without problems. The Contao installation bundle was the only thing, I wanted to update.

This time I tried updating from Contao 4.9.20 to .21. Had this problem the prior versions, too.

prod log:

[2021-10-11 12:21:01] console.CRITICAL: Error thrown while running command "cache:warmup --env=prod". Message: "Argument 3 passed to Terminal42\ShortlinkBundle\Routing\RouteProvider::__construct() must be of the type string, null given, called in /home/www/xxx/contao_4.9/var/cache/prod/ContainerKxS25kJ/appContao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php on line 2143" {"exception":"[object] (TypeError(code: 0): Argument 3 passed to Terminal42\\ShortlinkBundle\\Routing\\RouteProvider::__construct() must be of the type string, null given, called in /home/www/xxx/contao_4.9/var/cache/prod/ContainerKxS25kJ/appContao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php on line 2143 at /home/www/xxx/contao_4.9/vendor/terminal42/contao-shortlink/src/Routing/RouteProvider.php:32)","command":"cache:warmup --env=prod","message":"Argument 3 passed to Terminal42\\ShortlinkBundle\\Routing\\RouteProvider::__construct() must be of the type string, null given, called in /home/www/xxx/contao_4.9/var/cache/prod/ContainerKxS25kJ/appContao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php on line 2143"} []

[2021-10-11 12:21:22] request.CRITICAL: Uncaught PHP Exception TypeError: "Argument 3 passed to Terminal42\ShortlinkBundle\Routing\RouteProvider::__construct() must be of the type string, null given, called in /home/www/xxx/contao_4.9/var/cache/prod/ContainerKxS25kJ/appContao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php on line 2143" at /home/www/xxx/contao_4.9/vendor/terminal42/contao-shortlink/src/Routing/RouteProvider.php line 32 {"exception":"[object] (TypeError(code: 0): Argument 3 passed to Terminal42\\ShortlinkBundle\\Routing\\RouteProvider::__construct() must be of the type string, null given, called in /home/www/xxx/contao_4.9/var/cache/prod/ContainerKxS25kJ/appContao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php on line 2143 at /home/www/xxx/contao_4.9/vendor/terminal42/contao-shortlink/src/Routing/RouteProvider.php:32)"} []

Are these lines of any help? Do you need the composer task logs?

config.yml was configured correctly. Had to remove the settings in order to get the uninstall process completed.

aschempp commented 3 years ago

did you copy the bundle configuration from the README to your config.yml? This error happens if the host is null, but the default value is an empty string. https://github.com/terminal42/contao-shortlink/blob/main/src/DependencyInjection/Configuration.php#L25

christophbach commented 3 years ago

I used your config template

terminal42_shortlink:
    host: ~
    salt: terminal42_shortlink
    log_ip: false

I just changed the salt. So ~ isn't a placeholder for "localhost" or something and I just should have used my domain?

aschempp commented 2 years ago

Do not set host and log_ip then, and it will fall back to the default 😊