{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/osquery/issues/1629","labels_url":"https://api.github.com/repos/facebook/osquery/issues/1629/labels{/name}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/1629/comments","events_url":"https://api.github.com/repos/facebook/osquery/issues/1629/events","html_url":"https://github.com/facebook/osquery/issues/1629","id":114906708,"number":1629,"title":"RocksDB initialize failed: RW, RO, and no database access errors and logs","user":{"login":"theopolis","id":981645,"avatar_url":"https://avatars.githubusercontent.com/u/981645?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolis","html_url":"https://github.com/theopolis","followers_url":"https://api.github.com/users/theopolis/followers","following_url":"https://api.github.com/users/theopolis/following{/other_user}","gists_url":"https://api.github.com/users/theopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolis/subscriptions","organizations_url":"https://api.github.com/users/theopolis/orgs","repos_url":"https://api.github.com/users/theopolis/repos","events_url":"https://api.github.com/users/theopolis/events{/privacy}","received_events_url":"https://api.github.com/users/theopolis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/osquery/labels/reference","name":"reference","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-03T20:49:00Z","updated_at":"2015-11-03T20:49:04Z","closed_at":"2015-11-03T20:49:04Z","body":"RocksDB is the default (only) backing store for osquery. It does not support multiple processes opening handles to the on-disk database location. \r\n\r\nWhen an `osqueryi` process starts, it tries to open a RW handle to `~/.osquery/shell.db`, if another shell is running this will fail. The new (second) shell will continue without RocksDB support and thus disable publishers and persistent storage. This makes sense as in most cases, usually non-debug, publishers are not needed within the shell. Eventually they may be disabled completely on default.\r\n\r\nWhen an `osqueryd` process starts it checks a process mutex, called `--pidfile` and if no file exists or the pid is \"stale\" it will run and attempt to open a RW handle to `--database_path`. If this RW handle fails, the daemon will stop. The daemon MUST have a RW handle.\r\n\r\nYou will see the following line in your error log:\r\n```\r\nosqueryd initialize failed: Could not open RocksDB\r\n```\r\n\r\nPossible reasons for a failed handle:\r\n- There is another daemon running with the same `--database_path`.\r\n- The `--database_path` (is a folder) was previously created and has restrictive ownership/mode such that the new process cannot create or write files.\r\n- An intermediate directory does not exist."}}