-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
command scheduler not working in production environment #955
Comments
|
I just tested it and it works like a charm on my system. |
|
Hm, I made another clean installation with Contao 4.4.1. Everything in my initial post still holds true. Not sure why it would be different in my installation. |
|
The full dump of the Request object within |
|
Why don't you add |
I tried that, but as expected there is no output, since the FrontendCron is never run. Also the |
|
It works like a charm on my system. The cause of the problem must be somewhere else. |
|
The results are different in the var_dump($request->attributes->get('_route'));in dump($request->attributes->get('_route'));results in Try the following:
|
|
Ah yes, I see the problem now. This only happens, if the Reproduction
The Repeat 5. again with |
|
@leofeyer I have analyzed it a bit more. Replace // Handle the request
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);with // Handle the request
$request = Request::createFromGlobals();
var_dump($request->attributes);
$response = $kernel->handle($request);
$response->send();
var_dump($request->attributes);
$kernel->terminate($request, $response);for example and the look at the output from both the Within the Within the So for some reason, the attributes within the |
|
@fritzmg can you try to require |
|
I can confirm that it does not fix the issue. 😢 Also, I don't think it is the preflight request that is causing the issue. It neither works with the regular |
|
Looks like someone is deleting the attributes? What does it look like in 4.3? |
|
May be it's a general problem and not related to Contao at all. I only found this obscure related issue though: https://stackoverflow.com/questions/15955373/symfony2-why-is-the-request-passed-to-a-kernel-terminate-eventlistener-affected |
|
At least I found out where the problem occurs. In the protected function fetch(Request $request, $catch = false)
{
$subRequest = clone $request;
// send no head requests because we want content
if ('HEAD' === $request->getMethod()) {
$subRequest->setMethod('GET');
}
// avoid that the backend sends no content
$subRequest->headers->remove('if_modified_since');
$subRequest->headers->remove('if_none_match');
$response = $this->forward($subRequest, $catch);
if ($response->isCacheable()) {
$this->store($request, $response);
}
return $response;
}I don't know why it is necessary to work on a cloned object here? @fabpot or @avalanche123 can you shed some light on this please? |
|
@leofeyer you mean the request stored in the cache does not have the attributes? Maybe it does not really make sense to run the |
Exactly.
Probably. However, if all FE pages are cached, the command scheduler would never be triggered. |
|
This happens in the production environment in any case, regardless of whether you are using the page cache or not. |
|
Also see: symfony/symfony#23546 |
|
Well my objection is only that it's not pretty when that error can be visible again at the bottom of the page. Though I think this does not happen anymore anyway due to the changes from 9fe4382, right? |
|
Fixed in b5d2178. |
Description ----------- As suggested in #722 Commits ------- 95f0c022 Ignore bugfix/* and feature/* branches on push (see #960) Description ----------- This will prevent the GitHub action to be run twice for pull requests (one time for the push and one time for the pull request). Commits ------- 7dbdb6c0 Ignore bugfix/* and feature/* branches on push e47dea80 Do not require league/uri anymore (see #722)



It appears in Contao 4.4 the command scheduler is not working.
CommandSchedulerListener::canRunControlleralways returnsfalse, because ofThe
ParameterBagfrom$request->attributesdoes not contain the_route(anymore). Try withwithin
CommandSchedulerListener::canRunController:The text was updated successfully, but these errors were encountered: