{"action":"created","issue":{"url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1398","labels_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1398/labels{/name}","comments_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1398/comments","events_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1398/events","html_url":"https://github.com/project-hatohol/hatohol/issues/1398","id":93680342,"number":1398,"title":"[15.06] HAPI2の設定を更新するとServerがHAP2と通信できなくなってしまう","user":{"login":"cosmo0920","id":700876,"avatar_url":"https://avatars.githubusercontent.com/u/700876?v=3","gravatar_id":"","url":"https://api.github.com/users/cosmo0920","html_url":"https://github.com/cosmo0920","followers_url":"https://api.github.com/users/cosmo0920/followers","following_url":"https://api.github.com/users/cosmo0920/following{/other_user}","gists_url":"https://api.github.com/users/cosmo0920/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmo0920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmo0920/subscriptions","organizations_url":"https://api.github.com/users/cosmo0920/orgs","repos_url":"https://api.github.com/users/cosmo0920/repos","events_url":"https://api.github.com/users/cosmo0920/events{/privacy}","received_events_url":"https://api.github.com/users/cosmo0920/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-07-08T03:13:53Z","updated_at":"2015-07-08T10:16:48Z","closed_at":null,"body":"HAPI2の設定を更新すると、\r\n\r\n## HAP2側\r\n\r\n```log\r\nERROR:root:Unexpected error: <type 'exceptions.AttributeError'>, 'bool' object has no attribute 'message_id', ['  File \"/home/hhatake/Github/hatohol/server/hap2/hatohol/haplib.py\", line 968, in __poll_in_try_block\\n    self.put_arm_info(arm_info)\\n', '  File \"/home/hhatake/Github/hatohol/server/hap2/hatohol/haplib.py\", line 467, in put_arm_info\\n    self.__wait_response(request_id)\\n', '  File \"/home/hhatake/Github/hatohol/server/hap2/hatohol/haplib.py\", line 608, in __wait_response\\n    if pm.message_id != request_id:\\n']\r\n```\r\n\r\n上記のログが出力され続ける。\r\n\r\n## Server側\r\n\r\n```log\r\n[DBG] <HatoholArmPluginInterfaceHAPI2.cc:219> message: <>/<{\"params\": {\"numFailure\": 0, \"lastStatus\": \"OK\", \"lastFailureTime\": \"\", \"lastSuccessTime\": \"20150708031317.913789\", \"numSuccess\": 3, \"failureReason\": \"\"}, \"jsonrpc\": \"2.0\", \"method\": \"putArmInfo\", \"id\": 536964687}>\r\n[INFO] <ArmBase.cc:320> ArmFake [4:Zabbix HAPI2 test]: requested to exit.\r\n[INFO] <ArmBase.cc:248> ArmFake [4:Zabbix HAPI2 test]: destruction: completed.\r\n```\r\n\r\n## WebUI\r\n\r\n![screenshot from 2015-07-08 12 19 22](https://cloud.githubusercontent.com/assets/700876/8562296/b6246426-256b-11e5-9227-19f3aea626a1.png)\r\n\r\n初期状態のまま変化しなくなってしまいます。"},"comment":{"url":"https://api.github.com/repos/project-hatohol/hatohol/issues/comments/119532522","html_url":"https://github.com/project-hatohol/hatohol/issues/1398#issuecomment-119532522","issue_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/1398","id":119532522,"user":{"login":"cosmo0920","id":700876,"avatar_url":"https://avatars.githubusercontent.com/u/700876?v=3","gravatar_id":"","url":"https://api.github.com/users/cosmo0920","html_url":"https://github.com/cosmo0920","followers_url":"https://api.github.com/users/cosmo0920/followers","following_url":"https://api.github.com/users/cosmo0920/following{/other_user}","gists_url":"https://api.github.com/users/cosmo0920/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmo0920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmo0920/subscriptions","organizations_url":"https://api.github.com/users/cosmo0920/orgs","repos_url":"https://api.github.com/users/cosmo0920/repos","events_url":"https://api.github.com/users/cosmo0920/events{/privacy}","received_events_url":"https://api.github.com/users/cosmo0920/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T10:16:48Z","updated_at":"2015-07-08T10:16:48Z","body":"そのようです。 `armInfo.running` にfalseが入っていたため、設定を変更してGateHAPI2が新たに作成される時に https://github.com/project-hatohol/hatohol/blob/master/server/src/HatoholArmPluginGateHAPI2.cc#L495 の `autoStart` にfalseが渡ってきてしまい、InterfaceHAPI2が作成されないような動作をしていました。\r\n\r\n結論： 初期化忘れコワイ。"}}