title: gerrit not starting with postgres
body: <p>Following these instructions:
      <a href="https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.4/install.html" rel="nofollow">https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.4/install.html</a></p>
  
  <p>Installed postgres 9.3:</p>
  
  <pre><code>sudo -i -u postgres
  postgres@ubuntu:~$ psql
  psql (9.3.10)
  Type "help" for help.
  
  postgres=# 
  </code></pre>
  
  <p>The gerrit2 user cannot access psql, even though I created the user and database</p>
  
  <pre><code>postgres@ubuntu:~$ createuser --username=postgres -RDIElPS gerrit2
  postgres@ubuntu:~$ createdb --username=postgres -E UTF-8 -O gerrit2 reviewdb
  
  ^d
  gerrit2@ubuntu:~$ psql
  psql: FATAL:  database "gerrit2" does not exist
  </code></pre>
  
  <p>Installed gerrit 2.11.4:</p>
  
  <pre><code>gerrit2@ubuntu:~$ java -jar gerrit-2.11.4.war init -d .
  </code></pre>
  
  <p>See gerrit.conf result of install:</p>
  
  <pre><code>[gerrit]
          basePath = .
          canonicalWebUrl = http://ubuntu:8080/
  [database]
          type = postgresql
          hostname = localhost
          database = reviewdb
          username = gerrit2
  [index]
          type = LUCENE
  [auth]
          type = OPENID
  [sendemail]
          smtpServer = localhost
          smtpUser = lmougen5
  [container]
          user = gerrit2
          javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
  [sshd]
          listenAddress = *:22
  [httpd]
          listenUrl = http://*:8080/
  [cache]
          directory = cache
  </code></pre>
  
  <p>gerrit init didn't bring up the browser as per the instructions, so I attempted a reindex.  Note errors in output:</p>
  
  <pre><code>gerrit2@ubuntu:~$ java -jar gerrit-2.11.4.war reindex
  [2015-11-19 16:42:24,861] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 119m
  [2015-11-19 16:42:25,542] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/gerrit2/cache
  Reindexing changes: done    
  Reindexed 0 changes in 0.0s (0.0/s)
  [2015-11-19 16:42:26,525] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/home/gerrit2/cache/diff_intraline: Error opening database: "Sleep interrupted" [8000-174]
  [2015-11-19 16:42:26,526] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 4 disk cache updates
  </code></pre>
  
  <p>Then a restart, probably need to address errors first.  Along with gerrit2 user's access to psql reviewdb:</p>
  
  <pre><code>gerrit2@ubuntu:~$ ~/bin/gerrit.sh restart
  </code></pre>
  
  <p>Restart failed, here's ~/logs/error_log:</p>
  
  <pre><code>[2015-11-20 08:12:30,627] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/gerrit2/cache
  [2015-11-20 08:12:31,970] INFO  com.google.gerrit.server.config.ScheduleConfig : gc schedule parameter "gc.interval" is not configured
  [2015-11-20 08:12:33,640] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
  [2015-11-20 08:12:34,415] INFO  org.eclipse.jetty.util.log : Logging initialized @8505ms
  [2015-11-20 08:12:35,115] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 119m
  [2015-11-20 08:12:35,204] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/gerrit2/plugins
  [2015-11-20 08:12:35,363] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin commit-message-length-validator, version v2.11.4
  [2015-11-20 08:12:35,479] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin download-commands, version v2.11.4
  [2015-11-20 08:12:35,603] WARN  com.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig : Config file /home/gerrit2/etc/replication.configdoes not exist; not replicating
  [2015-11-20 08:12:35,617] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin replication, version v2.11.4
  [2015-11-20 08:12:35,726] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin reviewnotes, version v2.11.4
  [2015-11-20 08:12:35,787] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v2.11.4
  [2015-11-20 08:12:36,290] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
  java.lang.IllegalStateException: Cannot bind to *
          at com.google.gerrit.sshd.SshDaemon.start(SshDaemon.java:319)
          at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
          at com.google.gerrit.pgm.Daemon.start(Daemon.java:293)
          at com.google.gerrit.pgm.Daemon.run(Daemon.java:205)
          at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
          at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
          at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
          at Main.main(Main.java:25)
  Caused by: java.io.IOException: Error while binding on 0.0.0.0/0.0.0.0:22
  original message : Permission denied
          at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:238)
          at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:51)
          at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:582)
          at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$400(AbstractPollingIoAcceptor.java:70)
          at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:456)
          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>