{"action":"created","issue":{"url":"https://api.github.com/repos/project-hatohol/hatohol/issues/2363","repository_url":"https://api.github.com/repos/project-hatohol/hatohol","labels_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/2363/labels{/name}","comments_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/2363/comments","events_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/2363/events","html_url":"https://github.com/project-hatohol/hatohol/issues/2363","id":165247046,"number":2363,"title":"[ERR] <OperationPrivilege.cc:135> Failed to getUserInfo(): userId: 23が出る","user":{"login":"Mnakagawa","id":7106792,"avatar_url":"https://avatars.githubusercontent.com/u/7106792?v=3","gravatar_id":"","url":"https://api.github.com/users/Mnakagawa","html_url":"https://github.com/Mnakagawa","followers_url":"https://api.github.com/users/Mnakagawa/followers","following_url":"https://api.github.com/users/Mnakagawa/following{/other_user}","gists_url":"https://api.github.com/users/Mnakagawa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mnakagawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mnakagawa/subscriptions","organizations_url":"https://api.github.com/users/Mnakagawa/orgs","repos_url":"https://api.github.com/users/Mnakagawa/repos","events_url":"https://api.github.com/users/Mnakagawa/events{/privacy}","received_events_url":"https://api.github.com/users/Mnakagawa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-13T06:30:38Z","updated_at":"2016-07-13T06:42:10Z","closed_at":null,"body":"動作に問題は無いが，気になったので追ってみた。\r\nL135はsetUserIdという関数で，その引数としてUserIdが与えられている。\r\nこのUserIｄがHatoholDBのUserテーブルに無いからこのエラーが出ている。\r\n\r\nこのsetUserIdがいつ使われるのかというと，OperationPrivilegeをインスタンス化する時に，\r\n初期値として与えられたUserIdをセットしようとしている。\r\n```\r\nOperationPrivilege::OperationPrivilege(const UserIdType &userId)\r\n: m_impl(new Impl())\r\n{\r\n    setUserId(userId);\r\n}\r\n```\r\n\r\nこのOperationPrivilegeをインスタンス化しているところを眺めていたら，\r\nhttps://github.com/project-hatohol/hatohol/blob/master/server/src/DBTablesAction.cc#L736\r\nこういうのを見つけた。\r\n要するにOPPRVLG_DELETE_ALL_ACTIONをユーザー扱いしてセットしようとしているから\r\nこのようなエラーが出る。\r\nsetUserIdの引数であるUserIdTypeはintなので，enumとして定義されている\r\nhttps://github.com/project-hatohol/hatohol/blob/master/server/src/OperationPrivilege.h#L27-L78\r\nこの辺りをsetしようとすると毎回エラーログが出るはず。"},"comment":{"url":"https://api.github.com/repos/project-hatohol/hatohol/issues/comments/232269937","html_url":"https://github.com/project-hatohol/hatohol/issues/2363#issuecomment-232269937","issue_url":"https://api.github.com/repos/project-hatohol/hatohol/issues/2363","id":232269937,"user":{"login":"Mnakagawa","id":7106792,"avatar_url":"https://avatars.githubusercontent.com/u/7106792?v=3","gravatar_id":"","url":"https://api.github.com/users/Mnakagawa","html_url":"https://github.com/Mnakagawa","followers_url":"https://api.github.com/users/Mnakagawa/followers","following_url":"https://api.github.com/users/Mnakagawa/following{/other_user}","gists_url":"https://api.github.com/users/Mnakagawa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mnakagawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mnakagawa/subscriptions","organizations_url":"https://api.github.com/users/Mnakagawa/orgs","repos_url":"https://api.github.com/users/Mnakagawa/repos","events_url":"https://api.github.com/users/Mnakagawa/events{/privacy}","received_events_url":"https://api.github.com/users/Mnakagawa/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T06:42:10Z","updated_at":"2016-07-13T06:42:10Z","body":"DBのユーザーテーブルにはデフォルトのadminとguestしか入ってない状態です。"}}
{"actor":{"display_login":"Mnakagawa"}}