昨日、プロジェクトを Symfony 3.0 から 3.1.2 に更新しましたが、リダイレクトで奇妙な動作が見られます。
Symfony 経由のリダイレクト (たとえば、return $this->redirectToRoute( ... )) によってページが表示され、コンテンツの下に PDOException が表示されます。
DataCollector.php 行 36 の PDOException: PDO インスタンスをシリアライズまたはアンシリアライズすることはできません
バックトレースは次のとおりです。
in DataCollector.php line 36
at PDO->__sleep()
at serialize(array('method' => 'GET', 'format' => 'html', 'content' => '', 'content_type' => 'text/html; charset=UTF-8', 'status_text' => 'OK', 'status_code' => '200', 'request_query' => array(), 'request_request' => array(), 'request_headers' => array('accept' => array('text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'), 'accept-encoding' => array('gzip, deflate'), 'accept-language' => array('en-US,en;q=0.5'), 'connection' => array('keep-alive'), 'cookie' => array('PHPSESSID=9ccvvokhon6i88bghai090eul3'), 'host' => array('wwui.dev.dpc'), 'referer' => array('http://wwui.dev.dpc/query/lothistory'), 'user-agent' => array('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:47.0) Gecko/20100101 Firefox/47.0'), 'x-php-ob-level' => array('1')), 'request_server' => array('SCRIPT_URL' => '/', 'SCRIPT_URI' => 'http://wwui.dev.dpc/', 'symfonyEnvironment' => 'dev', 'HTTP_HOST' => 'wwui.dev.dpc', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:47.0) Gecko/20100101 Firefox/47.0', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_REFERER' => 'http://wwui.dev.dpc/query/lothistory', 'HTTP_COOKIE' => 'PHPSESSID=9ccvvokhon6i88bghai090eul3', 'HTTP_CONNECTION' => 'keep-alive', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/root/.composer/vendor/bin', 'SERVER_SIGNATURE' => '<address>Apache/2.4.7 (Ubuntu) Server at wwui.dev.dpc Port 80</address> ', 'SERVER_SOFTWARE' => 'Apache/2.4.7 (Ubuntu)', 'SERVER_NAME' => 'wwui.dev.dpc', 'SERVER_ADDR' => '172.24.100.15', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '172.24.91.1', 'DOCUMENT_ROOT' => '/Volumes/Data01/VMShares/BeckComputerSystems/WarehouseWebUserInterface/WWUI/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/Volumes/Data01/VMShares/BeckComputerSystems/WarehouseWebUserInterface/WWUI/web', 'SERVER_ADMIN' => '[no address given]', 'SCRIPT_FILENAME' => '/Volumes/Data01/VMShares/BeckComputerSystems/WarehouseWebUserInterface/WWUI/web/index.php', 'REMOTE_PORT' => '57589', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => '1469740535.875', 'REQUEST_TIME' => '1469740535'), 'request_cookies' => array('PHPSESSID' => '9ccvvokhon6i88bghai090eul3'), 'request_attributes' => array('_controller' => 'SiteBundle\Controller\SiteController::homeAction', '_route' => 'home', '_route_params' => array(), '_redirected' => 'true'), 'response_headers' => array('cache-control' => array('no-cache'), 'content-type' => array('text/html; charset=UTF-8'), 'x-debug-token' => array('96da99')), 'session_metadata' => array('Created' => 'Thu, 28 Jul 16 11:23:35 -0700', 'Last used' => 'Thu, 28 Jul 16 14:15:35 -0700', 'Lifetime' => '0'), 'session_attributes' => array('_csrf/authenticate' => 'WW2UtiwmjvKvT89GZm6uKZQnqqFE5vCV9tnczHYzDE8', 'userId' => '8', '_security_wwui' => 'C:41:"Bcs\BcsVmsUserBundle\Library\VmsUserToken":733:{a:3:{i:0;N;i:1;s:4:"wwui";i:2;s:693:"a:4:{i:0;C:35:"Bcs\BcsVmsUserBundle\Entity\VmsUser":72:{a:4:{i:0;i:8;i:1;s:10:"dpatterson";i:2;s:16:"DF61DA91CA0D01BB";i:3;b:0;}}i:1;b:1;i:2;a:4:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}i:1;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:12:"ROLE_BCS$MGR";}i:2;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:13:"ROLE_WUI$USER";}i:3;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:22:"ROLE_SYMFONY_DEVELOPER";}}i:3;a:0:{}}";}}', '_csrf/customer_lookup_form' => 'A2jcgcM93KEVytEJtKsJcAxzuy2bWaCu2_AhuBMTi08', '_csrf/activity_query_form' => 'eXHaEcHTWcm0YpoyKy1xP-WVoLaE1Ahs9QWZMns9A6Y', '_csrf/product_lookup_form' => 'CX383_4bu1vUJxoHSvXCcFV7RIcgu_FVrMheVgWy2PM', '_csrf/lot_history_query_form' => 'kNCivPd8p92O3DZvWibNSnrgruhW-LUmkI8kiGi-w2s', '_csrf/lot_lookup_form' => 'VnHPXtUL4EarAwGdUuxt1UTCyiY4U1EnaZG-mlyJmdo', 'VmsSequenceNumber' => '30', '_csrf/inventory_status_query_form' => 'hGSVMlviAjfr2QvDja2MYWWnSb693oYK3mq-ub2Vpn4', '_csrf/historical_inventory_query_form' => 'CfblRdIk-imBFDVB7vdodxhxHtursQ7FWV2W8pqIPtk', '_csrf/open_invoice_aging_query_form' => 'w_cjE_LrzKUARvN8Jb09YviThS1HpT0tJDA--s0sHCY', 'sf_redirect' => array('token' => '60047a', 'route' => 'debug', 'method' => 'GET', 'controller' => array('class' => 'SiteBundle\Controller\DebugController', 'method' => 'AdhocAction', 'file' => '/Volumes/Data01/VMShares/BeckComputerSystems/WarehouseWebUserInterface/WWUI/src/SiteBundle/Controller/DebugController.php', 'line' => '84'), 'status_code' => '302', 'status_text' => 'Found')), 'flashes' => array(), 'path_info' => '/', 'controller' => array('class' => 'SiteBundle\Controller\SiteController', 'method' => 'homeAction', 'file' => '/Volumes/Data01/VMShares/BeckComputerSystems/WarehouseWebUserInterface/WWUI/src/SiteBundle/Controller/SiteController.php', 'line' => '101'), 'locale' => 'en', 'redirect' => object(Session))) in DataCollector.php line 36
at DataCollector->serialize()
at serialize(array('token' => '96da99', 'parent' => null, 'children' => array(), 'data' => array('request' => object(RequestDataCollector), 'time' => object(TimeDataCollector), 'memory' => object(MemoryDataCollector), 'ajax' => object(AjaxDataCollector), 'form' => object(FormDataCollector), 'exception' => object(ExceptionDataCollector), 'logger' => object(LoggerDataCollector), 'events' => object(EventDataCollector), 'router' => object(RouterDataCollector), 'security' => object(SecurityDataCollector), 'twig' => object(TwigDataCollector), 'db' => object(DoctrineDataCollector), 'swiftmailer' => object(MessageDataCollector), 'dump' => object(DumpDataCollector), 'connx' => object(ConnxDataCollector), 'config' => object(ConfigDataCollector)), 'ip' => '172.24.91.1', 'method' => 'GET', 'url' => 'http://wwui.dev.dpc/', 'time' => '1469740536', 'status_code' => '200')) in FileProfilerStorage.php line 158
at FileProfilerStorage->write(object(Profile)) in Profiler.php line 120
at Profiler->saveProfile(object(Profile)) in ProfilerListener.php line 120
at ProfilerListener->onKernelTerminate(object(PostResponseEvent), 'kernel.terminate', object(TraceableEventDispatcher))
at call_user_func(array(object(ProfilerListener), 'onKernelTerminate'), object(PostResponseEvent), 'kernel.terminate', object(TraceableEventDispatcher)) in WrappedListener.php line 61
at WrappedListener->__invoke(object(PostResponseEvent), 'kernel.terminate', object(ContainerAwareEventDispatcher))
at call_user_func(object(WrappedListener), object(PostResponseEvent), 'kernel.terminate', object(ContainerAwareEventDispatcher)) in classes.php line 2144
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener)), 'kernel.terminate', object(PostResponseEvent)) in classes.php line 2059
at EventDispatcher->dispatch('kernel.terminate', object(PostResponseEvent)) in TraceableEventDispatcher.php line 136
at TraceableEventDispatcher->dispatch('kernel.terminate', object(PostResponseEvent)) in bootstrap.php.cache line 3011
at HttpKernel->terminate(object(Request), object(Response)) in bootstrap.php.cache line 2317
at Kernel->terminate(object(Request), object(Response)) in index.php line 90
私はこれを追跡するために過去数時間を費やしましたが、役に立ちませんでした。問題の行は、 の serialize() の呼び出しSymfony\Component\HttpKernel\DataCollector\DataCollector::serialize()
です。そこにブレークポイントを設定し、デバッガーでデータを調べましたが、まだ PDO インスタンスを見つけることができませんでした。
他のすべてのページは正常に読み込まれます。
開発環境でのみ発生します。
他の誰かがこれを見たことがありますか?
助言がありますか?
環境:
- Ubuntu 14.04.4 LTS
- PHP 7.0.7-4
- シンフォニー 3.1.2