Exceptions
Exceptions 2
Twig\Error\ RuntimeError
Show exception properties
Twig\Error\RuntimeError {#10721 -lineno: 14 -columnno: null -rawMessage: "An exception has been thrown during the rendering of a template ("Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development.")." -source: Twig\Source {#10719 -code: """ {% import "@SyliusUi/macro/rtl.html.twig" as rtl %}\n \n {% set generic_hook = 'sylius_shop.base' %}\n {% set prefixes = prefixes|default([])|merge([generic_hook]) %}\n \n <!DOCTYPE html>\n \n <html lang="{{ app.request.locale|slice(0, 2) }}" {{ rtl.default(sylius.localeCode) }}>\n <head>\n {% block metatags %}\n {% hook '#metatags' with { _prefixes: prefixes } %}\n {% endblock %}\n \n <title>{% block title %}{{ sylius.channel.name }}{% endblock %}</title>\n \n {% block stylesheets %}\n {% hook '#stylesheets' with { _prefixes: prefixes } %}\n {% endblock %}\n \n {% hook 'head' with { _prefixes: prefixes } %}\n </head>\n \n <body data-route="{{ app.request.attributes.get('_route') }}">\n {% block body %}\n <div class="{% apply escape %}{% hook '#body_classes' with { _prefixes: prefixes } %}{% endapply %}">\n {% block header %}\n {% hook 'header' with { _prefixes: prefixes } %}\n {% endblock %}\n \n {% block content %}{% endblock %}\n \n {% block footer %}\n {% hook 'footer' with { _prefixes: prefixes } %}\n {% endblock %}\n </div>\n {% hook 'offcanvas' with { _prefixes: prefixes } %}\n {% endblock %}\n \n {% block javascripts %}\n {% hook '#javascripts' with { _prefixes: prefixes } %}\n {% endblock %}\n </body>\n </html>\n """ -name: "@SyliusShop/shared/layout/base.html.twig" -path: "/var/www/sylius/vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig" } -phpFile: "/var/www/sylius/vendor/twig/twig/src/Template.php" -phpLine: 610 }
in
vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig
(line 14)
<head>{% block metatags %}{% hook '#metatags' with { _prefixes: prefixes } %}{% endblock %}<title>{% block title %}{{ sylius.channel.name }}{% endblock %}</title>{% block stylesheets %}{% hook '#stylesheets' with { _prefixes: prefixes } %}{% endblock %}
in
vendor/twig/twig/src/Template.php
->
handleException
(line 495)
if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (\Throwable $e) {$template->handleException($e);}} elseif ($parent = $this->getParent($context)) {yield from $parent->unwrap()->yieldBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);} elseif (isset($blocks[$name])) {throw new RuntimeError(\sprintf('Block "%s" should not call parent() in "%s" as the block does not exist in the parent template "%s".', $name, $blocks[$name][0]->getTemplateName(), $this->getTemplateName()), -1, $blocks[$name][0]->getSourceContext());
in
var/cache/dev/twig/21/21f6e8136b5c082fca5ede8eea5ca105.php
->
yieldBlock
(line 87)
yield from $this->unwrap()->yieldBlock('metatags', $context, $blocks);// line 13yield "<title>";// line 14yield from $this->unwrap()->yieldBlock('title', $context, $blocks);yield "</title>";// line 16yield from $this->unwrap()->yieldBlock('stylesheets', $context, $blocks);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 461)
$context += $this->env->getGlobals();$blocks = array_merge($this->blocks, $blocks);try {$this->ensureSecurityChecked();yield from $this->doDisplay($context, $blocks);} catch (\Throwable $e) {$this->handleException($e);}}
in
var/cache/dev/twig/ca/cacbab61e294628297d44e4321257cdd.php
->
yield
(line 60)
$context["homepage_hook"] = "sylius_shop.homepage.index";// line 2$context["prefixes"] = [(isset($context["homepage_hook"]) || array_key_exists("homepage_hook", $context) ? $context["homepage_hook"] : (function () { throw new RuntimeError('Variable "homepage_hook" does not exist.', 2, $this->source); })())];// line 4$this->parent = $this->load("@SyliusShop/shared/layout/base.html.twig", 4);yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 461)
$context += $this->env->getGlobals();$blocks = array_merge($this->blocks, $blocks);try {$this->ensureSecurityChecked();yield from $this->doDisplay($context, $blocks);} catch (\Throwable $e) {$this->handleException($e);}}
in
vendor/twig/twig/src/Template.php
->
yield
(line 416)
return $this->blocks;}public function display(array $context, array $blocks = []): void{foreach ($this->yield($context, $blocks) as $data) {echo $data;}}public function render(array $context): string
in
vendor/twig/twig/src/Template.php
->
display
(line 431)
ob_start();} else {ob_start(static function () { return ''; });}try {$this->display($context);} catch (\Throwable $e) {while (ob_get_level() > $level) {ob_end_clean();}
in
vendor/twig/twig/src/TemplateWrapper.php
->
render
(line 53)
yield from $this->template->yieldBlock($name, $context + $this->env->getGlobals());}public function render(array $context = []): string{return $this->template->render($context);}public function display(array $context = []): void{// using func_get_args() allows to not expose the blocks argument
in
vendor/twig/twig/src/Environment.php
->
render
(line 343)
* @throws SyntaxError When an error occurred during compilation* @throws RuntimeError When an error occurred during rendering*/public function render($name, array $context = []): string{return $this->load($name)->render($context);}/*** Displays a template.*
in
vendor/symfony/framework-bundle/Controller/TemplateController.php
->
render
(line 48)
{if (null === $this->twig) {throw new \LogicException('You cannot use the TemplateController if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');}$response = new Response($this->twig->render($template, $context), $statusCode);if ($maxAge) {$response->setMaxAge($maxAge);}
in
vendor/symfony/http-kernel/HttpKernel.php
->
templateAction
(line 185)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 195)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 34)
) {}public function run(): int{$response = $this->kernel->handle($this->request);$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {fastcgi_finish_request();
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Sylius\Component\Channel\Context\ ChannelNotFoundException
} catch (ChannelNotFoundException) {continue;}}throw new ChannelNotFoundException();}}
in
vendor/sylius/sylius/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php
->
getChannel
(line 44)
throw $this->requestToExceptionMap[$objectIdentifier];}try {if (!isset($this->requestToChannelMap[$objectIdentifier])) {$this->requestToChannelMap[$objectIdentifier] = $this->decoratedChannelContext->getChannel();}return $this->requestToChannelMap[$objectIdentifier];} catch (ChannelNotFoundException $exception) {$this->requestToExceptionMap[$objectIdentifier] = $exception;
in
vendor/sylius/sylius/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php
->
getChannel
(line 32)
public function getAvailableLocalesCodes(): array{try {/** @var ChannelInterface $channel */$channel = $this->channelContext->getChannel();return $channel->getLocales()->map(function (LocaleInterface $locale) {return (string) $locale->getCode();
in
vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/EventListener/NonChannelLocaleListener.php
->
getAvailableLocalesCodes
(line 64)
if (!$this->isFirewallSupported($currentFirewall)) {return;}$requestLocale = $request->getLocale();if (!in_array($requestLocale, $this->channelBasedLocaleProvider->getAvailableLocalesCodes(), true)) {$event->setResponse(new RedirectResponse($this->router->generate('sylius_shop_homepage',['_locale' => $this->channelBasedLocaleProvider->getDefaultLocaleCode()],
in
vendor/symfony/event-dispatcher/Debug/WrappedListener.php
->
restrictRequestLocale
(line 115)
$this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener);$e = $this->stopwatch->start($this->name, 'event_listener');try {($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);} finally {if ($e->isStarted()) {$e->stop();}}
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
__invoke
(line 206)
foreach ($listeners as $listener) {if ($stoppable && $event->isPropagationStopped()) {break;}$listener($event, $eventName, $this);}}/*** Sorts the internal list of listeners for the given event by priority.
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
callListeners
(line 56)
} else {$listeners = $this->getListeners($eventName);}if ($listeners) {$this->callListeners($listeners, $eventName, $event);}return $event;}
in
vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
->
dispatch
(line 129)
try {$this->beforeDispatch($eventName, $event);try {$e = $this->stopwatch->start($eventName, 'section');try {$this->dispatcher->dispatch($event, $eventName);} finally {if ($e->isStarted()) {$e->stop();}}
in
vendor/symfony/http-kernel/HttpKernel.php
->
dispatch
(line 161)
*/private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response{// request$event = new RequestEvent($this, $request, $type);$this->dispatcher->dispatch($event, KernelEvents::REQUEST);if ($event->hasResponse()) {return $this->filterResponse($event->getResponse(), $request, $type);}
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());$this->requestStack->push($request);$response = null;try {return $response = $this->handleRaw($request, $type);} catch (\Throwable $e) {if ($e instanceof \Error && !$this->handleAllThrowables) {throw $e;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 195)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 34)
) {}public function run(): int{$response = $this->kernel->handle($this->request);$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {fastcgi_finish_request();
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 13:47:20 | deprecation |
User Deprecated: The Liip\ImagineBundle\Templating\FilterTrait trait is deprecated since version 2.7 and will be removed in 3.0; use Twig instead. {
"exception": {}
}
|
| INFO 13:47:20 | deprecation |
User Deprecated: The Liip\ImagineBundle\Templating\FilterExtension class is deprecated since version 2.7 and will be removed in 3.0; configure "liip_imagine.twig.mode" to "lazy" instead. {
"exception": {}
}
|
| INFO 13:47:20 | deprecation |
User Deprecated: Support for MySQL < 8 is deprecated and will be removed in DBAL 5 (AbstractMySQLDriver.php:80 called by AbstractDriverMiddleware.php:32, https://github.com/doctrine/dbal/pull/6343, package doctrine/dbal) {
"exception": {}
}
|
| INFO 13:47:20 | deprecation |
User Deprecated: Specifying the "nullable" attribute for join columns in many-to-many associations (here, Sylius\Component\Core\Model\PaymentMethod::$channels) is a no-op.
The ORM will always set it to false.
Doing so is deprecated and will be an error in 4.0. (ManyToManyOwningSideMapping.php:133 called by ClassMetadata.php:1449, https://github.com/doctrine/orm/pull/12126, package doctrine/orm) {
"exception": {}
}
|
| INFO 13:47:20 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "latest"
},
"request_uri": "http://webshop.scherstra.com/_profiler/latest?ip=192.168.1.1&type=request",
"method": "GET"
}
|
| DEBUG 13:47:20 | security |
Checking for authenticator support. {
"firewall_name": "shop",
"authenticators": 3
}
|
| DEBUG 13:47:20 | security |
Checking support on authenticator. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| DEBUG 13:47:20 | security |
Authenticator does not support the request. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| DEBUG 13:47:20 | security |
Checking support on authenticator. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| DEBUG 13:47:20 | security |
Authenticator does not support the request. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| DEBUG 13:47:20 | security |
Checking support on authenticator. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| DEBUG 13:47:20 | security |
Authenticator does not support the request. {
"firewall_name": "shop",
"authenticator": "Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator"
}
|
| INFO 13:47:21 | doctrine |
Connecting with parameters {params} {
"params": {
"driver": "pdo_mysql",
"idle_connection_ttl": 600,
"host": "127.0.0.1",
"port": 3306,
"user": "geoff",
"password": "<redacted>",
"driverOptions": [],
"defaultTableOptions": [],
"dbname": "sylius_demo",
"serverVersion": "8.0",
"charset": "utf8mb4"
}
}
|
| DEBUG 13:47:21 | doctrine | Executing statement: SELECT t0.code AS code_1, t0.name AS name_2, t0.color AS color_3, t0.description AS description_4, t0.enabled AS enabled_5, t0.hostname AS hostname_6, t0.created_at AS created_at_7, t0.updated_at AS updated_at_8, t0.id AS id_9, t0.theme_name AS theme_name_10, t0.tax_calculation_strategy AS tax_calculation_strategy_11, t0.contact_email AS contact_email_12, t0.contact_phone_number AS contact_phone_number_13, t0.skipping_shipping_step_allowed AS skipping_shipping_step_allowed_14, t0.skipping_payment_step_allowed AS skipping_payment_step_allowed_15, t0.account_verification_required AS account_verification_required_16, t0.shipping_address_in_checkout_required AS shipping_address_in_checkout_required_17, t0.default_locale_id AS default_locale_id_18, t19.code AS code_20, t19.created_at AS created_at_21, t19.updated_at AS updated_at_22, t19.id AS id_23, t0.base_currency_id AS base_currency_id_24, t25.code AS code_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t0.default_tax_zone_id AS default_tax_zone_id_30, t0.menu_taxon_id AS menu_taxon_id_31, t0.shop_billing_data_id AS shop_billing_data_id_32, t0.channel_price_history_config_id AS channel_price_history_config_id_33 FROM sylius_channel t0 INNER JOIN sylius_locale t19 ON t0.default_locale_id = t19.id INNER JOIN sylius_currency t25 ON t0.base_currency_id = t25.id WHERE t0.hostname = ? AND t0.enabled = ? ORDER BY t0.id ASC LIMIT 1 (parameters: {params}, types: {types}) |
| DEBUG 13:47:21 | doctrine |
Executing query: SELECT COUNT(*) FROM sylius_channel t0 {
"sql": "SELECT COUNT(*) FROM sylius_channel t0"
}
|
| INFO 13:47:21 | deprecation |
User Deprecated: Since sylius/mollie-plugin 2.2: Not passing an instance of "Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface" is deprecated and will be required in MolliePlugin 4.0 {
"exception": {}
}
|
Stack Traces 2
|
[2/2]
RuntimeError
|
|---|
Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development.") in "@SyliusShop/shared/layout/base.html.twig" at line 14.
at vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/templates/shared/layout/base.html.twig:14
at Twig\Template->handleException()
(vendor/twig/twig/src/Template.php:495)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/21/21f6e8136b5c082fca5ede8eea5ca105.php:87)
at __TwigTemplate_3fe3127f2d809434ce5c5fa352de17e7->doDisplay()
(vendor/twig/twig/src/Template.php:461)
at Twig\Template->yield()
(var/cache/dev/twig/ca/cacbab61e294628297d44e4321257cdd.php:60)
at __TwigTemplate_89881a50c10bd3f123d5fd9acaa36858->doDisplay()
(vendor/twig/twig/src/Template.php:461)
at Twig\Template->yield()
(vendor/twig/twig/src/Template.php:416)
at Twig\Template->display()
(vendor/twig/twig/src/Template.php:431)
at Twig\Template->render()
(vendor/twig/twig/src/TemplateWrapper.php:53)
at Twig\TemplateWrapper->render()
(vendor/twig/twig/src/Environment.php:343)
at Twig\Environment->render()
(vendor/symfony/framework-bundle/Controller/TemplateController.php:48)
at Symfony\Bundle\FrameworkBundle\Controller\TemplateController->templateAction()
(vendor/symfony/http-kernel/HttpKernel.php:185)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:195)
at Symfony\Component\HttpKernel\Kernel->handle()
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/sylius/vendor/autoload_runtime.php')
(public/index.php:5)
|
|
[1/2]
ChannelNotFoundException
|
|---|
Sylius\Component\Channel\Context\ChannelNotFoundException:
Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development.
at vendor/sylius/sylius/src/Sylius/Component/Channel/Context/CompositeChannelContext.php:44
at Sylius\Component\Channel\Context\CompositeChannelContext->getChannel()
(vendor/sylius/sylius/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php:44)
at Sylius\Component\Channel\Context\CachedPerRequestChannelContext->getChannel()
(vendor/sylius/sylius/src/Sylius/Component/Core/Provider/ChannelBasedLocaleProvider.php:32)
at Sylius\Component\Core\Provider\ChannelBasedLocaleProvider->getAvailableLocalesCodes()
(vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/EventListener/NonChannelLocaleListener.php:64)
at Sylius\Bundle\ShopBundle\EventListener\NonChannelLocaleListener->restrictRequestLocale()
(vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(vendor/symfony/event-dispatcher/EventDispatcher.php:206)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:129)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(vendor/symfony/http-kernel/HttpKernel.php:161)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:195)
at Symfony\Component\HttpKernel\Kernel->handle()
(vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/sylius/vendor/autoload_runtime.php')
(public/index.php:5)
|