操作
Bug(バグ) #4508
完了メンバー画面にて「フレンドを招待する」より招待を行うとサーバエラーが発生する
開始日:
2021-07-09
期日:
進捗率:
100%
予定工数:
(合計: 0:00時間)
3.6 で発生するか:
Unknown (未調査)
3.8 で発生するか:
Yes (はい)
説明
Overview (現象)¶
http://sns.openpne.jp/communityTopic/712 より
友人を招待すると
「現在、サーバが混み合っているか、メンテナンス中です。
ご迷惑をおかけいたしますが、しばらく時間を空けて再度アクセスしてください。」
の画面になります。
招待メールは正常に送信されています。
インストール直後、何のプラグインも追加していない状態で再現します。
・OpenPNEのバージョン
OpenPNE 3.8.39
OpenPNE 3.10.4
どちらでも全く同じです。
・運用環境
[さくら VPS(CentOS 6.9)]
・使用ソフトのバージョン
[PHP 5.6.40 MySQL 5.7.34]
・OpenPNE上に表示されている URL
[ https://xxxxxxx/invite ]
デモサイト https://demo.openpne.jp/ ででも発生しました。
・エラーメッセージコピペ
ssl_error_log
You must specify the value to findOneBy, referer: https://xxxxxxxxxxx/invite
pc_frontend_dev.php より
500 | Internal Server Error | Doctrine_Table_Exception You must specify the value to findOneBy stack trace at () in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/lib/Doctrine/Table.php line 2934 ... if (isset($by)) { if ( ! isset($arguments[0])) { throw new Doctrine_Table_Exception('You must specify the value to ' . $method); } $fieldName = $this->_resolveFindByFieldName($by); at Doctrine_Table->__call('findOneByMemberIdAndName', array(null, 'notification_center')) in SF_ROOT_DIR/lib/util/opNotificationCenter.class.php line 104 ... at MemberConfigTable->findOneByMemberIdAndName(null, 'notification_center') in SF_ROOT_DIR/lib/util/opNotificationCenter.class.php line 104 ... at opNotificationCenter::getNotifications(object('Member')) in SF_ROOT_DIR/lib/model/doctrine/MemberRelationship.class.php line 32 ... at MemberRelationship->postSave(object('Doctrine_Event')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/lib/Doctrine/Record.php line 354 ... at Doctrine_Record->invokeSaveHooks('post', 'save', object('Doctrine_Event')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/lib/Doctrine/Connection/UnitOfWork.php line 116 ... at Doctrine_Connection_UnitOfWork->saveGraph(object('MemberRelationship')) in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/lib/Doctrine/Record.php line 1718 ... at Doctrine_Record->save(object('opDoctrineConnectionMysql')) in SF_ROOT_DIR/lib/util/opDoctrineRecord.class.php line 66 ... at opDoctrineRecord->save() in SF_ROOT_DIR/lib/model/doctrine/MemberRelationship.class.php line 103 ... at MemberRelationship->removeFriendPre() in SF_ROOT_DIR/lib/model/doctrine/MemberRelationship.class.php line 82 ... at MemberRelationship->setFriend() in SF_ROOT_DIR/lib/form/doctrine/InviteForm.class.php line 163 ... at InviteForm->save() in SF_ROOT_DIR/lib/action/opMemberAction.class.php line 381 ... at opMemberAction->executeInvite(object('opWebRequest')) in SF_ROOT_DIR/apps/pc_frontend/modules/member/actions/actions.class.php line 355 ... at memberActions->executeInvite(object('opWebRequest')) in SF_ROOT_DIR/lib/vendor/symfony/lib/action/sfActions.class.php line 60 ... at sfActions->execute(object('opWebRequest')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 92 ... at sfExecutionFilter->executeAction(object('memberActions')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 78 ... at sfExecutionFilter->handleAction(object('sfFilterChain'), object('memberActions')) in SF_ROOT_DIR/lib/filter/opExecutionFilter.class.php line 162 ... at opExecutionFilter->handleAction(object('sfFilterChain'), object('memberActions')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php line 42 ... at sfExecutionFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opEmojiFilter.class.php line 29 ... at opEmojiFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfBasicSecurityFilter.class.php line 72 ... at sfBasicSecurityFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opAppendXRDSHeaderFilter.class.php line 26 ... at opAppendXRDSHeaderFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opCheckEnabledApplicationFilter.class.php line 39 ... at opCheckEnabledApplicationFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/filter/opCacheControlFilter.class.php line 27 ... at opCacheControlFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfRenderingFilter.class.php line 33 ... at sfRenderingFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/lib/vendor/symfony/lib/filter/sfFilterChain.class.php line 53 ... at sfFilterChain->execute() in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfController.class.php line 238 ... at sfController->forward('member', 'invite') in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfFrontWebController.class.php line 48 ... at sfFrontWebController->dispatch() in SF_ROOT_DIR/lib/vendor/symfony/lib/util/sfContext.class.php line 173 ... at sfContext->dispatch() in SF_ROOT_DIR/web/pc_frontend_dev.php line 14 ...
Causes (原因)¶
https://github.com/openpne/OpenPNE3/blob/master/lib/model/doctrine/MemberRelationship.class.php#L32
$notifications = opNotificationCenter::getNotifications($this->Member);
にて、通知を行おうとするが、招待相手の Member オブジェクトはまだデータベースに未登録な状態であるため ID は null である。
そのため、
https://github.com/openpne/OpenPNE3/blob/master/lib/util/opNotificationCenter.class.php#L103-L104
$notificationObject = Doctrine::getTable('MemberConfig')
->findOneByMemberIdAndName($member->getId(), 'notification_center');
にて、
You must specify the value to findOneBy
のエラーが発生する。
Way to fix (修正内容)¶
kaoru n さんが3年以上前に更新
- ステータス を Accepted(着手) から Pending Review(レビュー待ち) に変更
- 進捗率 を 0 から 50 に変更
https://github.com/openpne/OpenPNE3/pull/640
にてプルリクエストしました。
Rimpei Ogawa さんが約3年前に更新
- ステータス を Pending Review(レビュー待ち) から Pending Testing(テスト待ち) に変更
- 進捗率 を 50 から 70 に変更
レビューOKです。
操作