{"action":"created","issue":{"url":"https://api.github.com/repos/metabase/metabase/issues/2774","repository_url":"https://api.github.com/repos/metabase/metabase","labels_url":"https://api.github.com/repos/metabase/metabase/issues/2774/labels{/name}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/2774/comments","events_url":"https://api.github.com/repos/metabase/metabase/issues/2774/events","html_url":"https://github.com/metabase/metabase/issues/2774","id":160542269,"number":2774,"title":"Only run H2 in AUTO_SERVER mode for dev instances","user":{"login":"camsaul","id":1455846,"avatar_url":"https://avatars0.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"labels":[{"id":172924552,"url":"https://api.github.com/repos/metabase/metabase/labels/Enhancement","name":"Enhancement","color":"9CED51","default":false},{"id":414662786,"url":"https://api.github.com/repos/metabase/metabase/labels/Running%20Metabase","name":"Running Metabase","color":"ccddaa","default":false},{"id":235367056,"url":"https://api.github.com/repos/metabase/metabase/labels/Security","name":"Security","color":"B11623","default":false}],"state":"open","locked":false,"assignee":{"login":"camsaul","id":1455846,"avatar_url":"https://avatars0.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"assignees":[{"login":"camsaul","id":1455846,"avatar_url":"https://avatars0.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/metabase/metabase/milestones/42","html_url":"https://github.com/metabase/metabase/milestone/42","labels_url":"https://api.github.com/repos/metabase/metabase/milestones/42/labels","id":2477930,"number":42,"title":"0.25","description":"","creator":{"login":"salsakran","id":107439,"avatar_url":"https://avatars3.githubusercontent.com/u/107439?v=3","gravatar_id":"","url":"https://api.github.com/users/salsakran","html_url":"https://github.com/salsakran","followers_url":"https://api.github.com/users/salsakran/followers","following_url":"https://api.github.com/users/salsakran/following{/other_user}","gists_url":"https://api.github.com/users/salsakran/gists{/gist_id}","starred_url":"https://api.github.com/users/salsakran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salsakran/subscriptions","organizations_url":"https://api.github.com/users/salsakran/orgs","repos_url":"https://api.github.com/users/salsakran/repos","events_url":"https://api.github.com/users/salsakran/events{/privacy}","received_events_url":"https://api.github.com/users/salsakran/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":6,"state":"open","created_at":"2017-04-24T18:24:25Z","updated_at":"2017-06-05T18:30:48Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-06-15T22:53:57Z","updated_at":"2017-06-05T18:33:15Z","closed_at":null,"body":"We run the H2 DB in `AUTO_SERVER` mode by default which means the first process to connect to the H2 DB spins up a local server listening on a high-numbered TCP port. Why? H2 explodes in a fit of rage if a second process tries to access the same DB file if `AUTO_SERVER` mode is off.\r\n\r\n[The H2 server process enforces authentication so only processes with access to the secret key, stored in a file in the same dir as the H2 DB file, can connect.](http://h2database.com/html/features.html#auto_mixed_mode) So we're still secure (unless someone has access to your local filesystem, in which case you're already out of luck since they can just grab the DB file itself). \r\n\r\nBut all things equal, less open ports are still better; some unknown security vulnerability in H2 may arise in the future. Since it's not necessary to run H2 in `AUTO_SERVER` mode for production instances, we might as well avoid doing so.\r\n\r\nWe should take care to ensure that this does not unacceptably exacerbate the rare problem where the Mac App fails to launch because it cannot connect to the H2 DB. The first process to access the H2 DB will effectively lock it; duplicate Metabase processes or Java processes that forget to die can end up locking everyone else out of the DB.\r\n\r\n(Adapted from [this Discourse thread](http://discourse.metabase.com/t/metabase-running-on-2nd-high-numbered-random-port-on-0-0-0-0/470/3))\r\n"},"comment":{"url":"https://api.github.com/repos/metabase/metabase/issues/comments/306267454","html_url":"https://github.com/metabase/metabase/issues/2774#issuecomment-306267454","issue_url":"https://api.github.com/repos/metabase/metabase/issues/2774","id":306267454,"user":{"login":"camsaul","id":1455846,"avatar_url":"https://avatars0.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"created_at":"2017-06-05T18:33:15Z","updated_at":"2017-06-05T18:33:15Z","body":"This might fix #5249"}}
{"actor":{"display_login":"camsaul"}}