INFO放弃了:cocorico进入了致命状态,太多的重试开始太快了

时间:2019-02-19 18:41:13

标签: php symfony docker

几个星期来,我都遇到了同样的错误:

INFO gave up: cocorico entered FATAL state, too many start retries too quickly

当我尝试使用docker运行cocorico时,出现以下错误:

usermod: no changes
2019-02-19 17: 21: 32,530 CRIT Supervisor running as root (no user in config file)
2019-02-19 17: 21: 32,530 INFO Included extra file "/etc/supervisord.d/cocorico.conf" during parsing
2019-02-19 17: 21: 32,530 INFO included extra file "/etc/supervisord.d/mongo.conf" during parsing
2019-02-19 17: 21: 32,530 INFO Included extra file "/etc/supervisord.d/mysql.conf" during parsing
2019-02-19 17: 21: 32,644 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2019-02-19 17: 21: 32,667 INFO supervisord started with pid 10
2019-02-19 17: 21: 33,671 INFO spawned: 'cocorico' with pid 13
2019-02-19 17: 21: 33,681 INFO spawned: 'mongo' with pid 14
2019-02-19 17: 21: 33,688 INFO spawned: 'mysql' with pid 15
2019-02-19 17: 21: 35,308 INFO success: cocorico entered RUNNING state, process has stayed up for> than 1 seconds (startsecs)
2019-02-19 17: 21: 35,308 INFO success: mongo entered RUNNING state, process has stayed up for> than 1 seconds (startsecs)
2019-02-19 17: 21: 35,308 INFO success: mysql entered RUNNING state, process has stayed up for> than 1 seconds (startsecs)
2019-02-19 17: 24: 57,891 INFO exited: cocorico (exit status 1; not expected)
2019-02-19 17: 24: 58,946 INFO spawned: 'cocorico' with pid 1013
2019-02-19 17: 24: 59,589 INFO exited: cocorico (exit status 1; not expected)
2019-02-19 17: 25: 00,594 INFO spawned: 'cocorico' with pid 1026
2019-02-19 17:25: 01,224 INFO exited: cocorico (exit status 1; not expected)
2019-02-19 17: 25: 03,229 INFO spawned: 'cocorico' with pid 1039
2019-02-19 17:25: 03,882 INFO exited: cocorico (exit status 1; not expected)
2019-02-19 17: 25: 06,889 INFO spawned: 'cocorico' with pid 1052
2019-02-19 17:25: 07,520 INFO exited: cocorico (exit status 1; not expected)
2019-02-19 17:25: 08,522 INFO gave up: cocorico entered FATAL state, too many start retries too quickly

我找不到错误。我的系统:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION=”Ubuntu 18.04.2 LTS”

我在localhost的前端正常工作

但是管理区域未运行 我在http://localhost/admin/login中收到此错误:

检测到symfony异常/ symfony 4

警告:get_class()期望参数1为对象,给定null 500内部服务器错误-ContextErrorException

堆栈跟踪 在src / Cocorico / ReviewBundle / Security / Voter / ReviewVoter.php中的第50行


    public function vote(TokenInterface $token, $booking, array $attributes)
    {
        // check if class of this object is supported by this voter
        if (!$this->supportsClass(get_class($booking))) {
            return VoterInterface::ACCESS_ABSTAIN;
        }
    ```
    RESUMED ALL:

    Stack Trace
    in

    ```
     1 - src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php at line 50   + 

    2 - at ErrorHandler ->handleError ('2', 'get_class() expects parameter 1 to be object, null given', '/cocorico/src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php', '50', array('token' => object(AnonymousToken), 'booking' => null, 'attributes' => array('ROLE_ADMIN'))) 

    3 - at get_class (null) 
    in src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php at line 50 +
        public function vote(TokenInterface $token, $booking, array $attributes)
        {
            // check if class of this object is supported by this voter
            if (!$this->supportsClass(get_class($booking))) {
                return VoterInterface::ACCESS_ABSTAIN;
            }

    4 - at ReviewVoter ->vote (object(AnonymousToken), null, array('ROLE_ADMIN')) 
    in app/cache/dev/classes.php at line 2870 +
    $grant = 0;
    foreach ($attributes as $attribute) {
    foreach ($this->voters as $voter) {
    $result = $voter->vote($token, $object, array($attribute));
    switch ($result) {
    case VoterInterface::ACCESS_GRANTED:
    ++$grant;

    5 - at AccessDecisionManager ->decideUnanimous (object(AnonymousToken), array('ROLE_ADMIN'), null) 
    in app/cache/dev/classes.php at line 2797 +
    }
    public function decide(TokenInterface $token, array $attributes, $object = null)
    {
    return $this->{$this->strategy}($token, $attributes, $object);
    }
    public function supportsAttribute($attribute)
    {

    6 - at AccessDecisionManager ->decide (object(AnonymousToken), array('ROLE_ADMIN'), null) 
    in app/cache/dev/classes.php at line 2925   + 
    if (!is_array($attributes)) {
    $attributes = array($attributes);
    }
    return $this->accessDecisionManager->decide($token, $attributes, $object);
    }
    }
    }

    7 - at AuthorizationChecker ->isGranted (array('ROLE_ADMIN'), null) 
    in vendor/symfony/symfony/src/Symfony/Component/Security/Core/SecurityContext.php at line 102   +

    8 - at SecurityContext ->isGranted ('ROLE_ADMIN') 
    in vendor/sonata-project/user-bundle/Controller/AdminSecurityController.php at line 61   + 
         ? $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate')
                : null;
            if ($this->container->get('security.context')->isGranted('ROLE_ADMIN')) {
                $refererUri = $request->server->get('HTTP_REFERER');
                return new RedirectResponse($refererUri && $refererUri != $request->getUri() ? $refererUri : $this->container->get('router')->generate('sonata_admin_dashboard'));

    9 - at AdminSecurityController ->loginAction () 

    10 - at call_user_func_array (array(object(AdminSecurityController), 'loginAction'), array()) 
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 139   + 
            $arguments = $this->resolver->getArguments($request, $controller);
            // call controller
            $response = call_user_func_array($controller, $arguments);
            // view
            if (!$response instanceof Response) {

    11 - at HttpKernel ->handleRaw (object(Request), '1') 
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 62   + 
            $request->headers->set('X-Php-Ob-Level', ob_get_level());
            try {
                return $this->handleRaw($request, $type);
            } catch (\Exception $e) {
                if (false === $catch) {
                    $this->finishRequest($request, $type);

    12 - at HttpKernel ->handle (object(Request), '1', true) 
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php at line 69   + 
          $this->container->set('request', $request, 'request');
            try {
                $response = parent::handle($request, $type, $catch);
            } catch (\Exception $e) {
                $this->container->set('request', null, 'request');
                $this->container->leaveScope('request');

    13 - at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php at line 185   + 
                $this->boot();
            }
            return $this->getHttpKernel()->handle($request, $type, $catch);
        }
        /**

    14 - at Kernel ->handle (object(Request)) 
    in web/app_dev.php at line 30   + 
    $kernel = new AppKernel('dev', true);
    $kernel->loadClassCache();
    $request = Request::createFromGlobals();
    $response = $kernel->handle($request);
    $response->send();
    $kernel->terminate($request, $response);


日志-1个错误


    INFO - The Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead. 
    INFO - The Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead. 
    INFO - Matched route "sonata_user_admin_security_login". 
    INFO - Populated the TokenStorage with an anonymous Token. 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Lexik\Bundle\CurrencyBundle\EventListener\LocaleListener::setCurrencyFormatterLocale". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Cocorico\CoreBundle\Listener\UserTypeCookieListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Knp\Bundle\MenuBundle\EventListener\VoterInitializerListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "SimpleThings\EntityAudit\Request\CurrentUserListener::handle". 
    INFO - The Sonata\UserBundle\Controller\AdminSecurityController class extends Symfony\Component\DependencyInjection\ContainerAware that is deprecated since version 2.8, to be removed in 3.0. Use the ContainerAwareTrait instead. 
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". 
    INFO - The "security.context" service is deprecated since Symfony 2.6 and will be removed in 3.0. 
    INFO - The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead. 
    INFO - The "form.csrf_provider" service is deprecated since Symfony 2.4 and will be removed in 3.0. Use the "security.csrf.token_manager" service instead. 
    INFO - The Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter::generateCsrfToken method is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead. 
    CRITICAL - Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Warning: get_class() expects parameter 1 to be object, null given" at /cocorico/src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php line 50 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Lexik\Bundle\CurrencyBundle\EventListener\LocaleListener::setCurrencyFormatterLocale". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Cocorico\CoreBundle\Listener\UserTypeCookieListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "Knp\Bundle\MenuBundle\EventListener\VoterInitializerListener::onKernelRequest". 
    DEBUG - Notified event "kernel.request" to listener "SimpleThings\EntityAudit\Request\CurrentUserListener::handle". 
    INFO - The possibility to register the same extension twice ("Text") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead. 
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController". 
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".


堆栈跟踪(纯文本)-


    [1] Symfony\Component\Debug\Exception\ContextErrorException: Warning: get_class() expects parameter 1 to be object, null given
        at n/a
            in /cocorico/src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php line 50

        at Symfony\Component\Debug\ErrorHandler->handleError('2', 'get_class() expects parameter 1 to be object, null given', '/cocorico/src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php', '50', array('token' => object(AnonymousToken), 'booking' => null, 'attributes' => array('ROLE_ADMIN')))
            in  line 

        at get_class(null)
            in /cocorico/src/Cocorico/ReviewBundle/Security/Voter/ReviewVoter.php line 50

        at Cocorico\ReviewBundle\Security\Voter\ReviewVoter->vote(object(AnonymousToken), null, array('ROLE_ADMIN'))
            in /cocorico/app/cache/dev/classes.php line 2870

        at Symfony\Component\Security\Core\Authorization\AccessDecisionManager->decideUnanimous(object(AnonymousToken), array('ROLE_ADMIN'), null)
            in /cocorico/app/cache/dev/classes.php line 2797

        at Symfony\Component\Security\Core\Authorization\AccessDecisionManager->decide(object(AnonymousToken), array('ROLE_ADMIN'), null)
            in /cocorico/app/cache/dev/classes.php line 2925

        at Symfony\Component\Security\Core\Authorization\AuthorizationChecker->isGranted(array('ROLE_ADMIN'), null)
            in /cocorico/vendor/symfony/symfony/src/Symfony/Component/Security/Core/SecurityContext.php line 102

        at Symfony\Component\Security\Core\SecurityContext->isGranted('ROLE_ADMIN')
            in /cocorico/vendor/sonata-project/user-bundle/Controller/AdminSecurityController.php line 61

        at Sonata\UserBundle\Controller\AdminSecurityController->loginAction()
            in  line 

        at call_user_func_array(array(object(AdminSecurityController), 'loginAction'), array())
            in /cocorico/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 139

        at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
            in /cocorico/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 62

        at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
            in /cocorico/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 69

        at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
            in /cocorico/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 185

        at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
            in /cocorico/web/app_dev.php line 30

我在系统上使用的是symfony 4

但不确定是否会导致此问题

1 个答案:

答案 0 :(得分:0)

此问题已修复: 此错误已修复。 谢谢!

https://github.com/Cocolabs-SAS/cocorico/commit/813dd0fdcecb133162a27e15efc2c2808607919a