A bug in the PostgreSQL driver 42.1.x prevents from connecting to database if SOCKS proxy is enabled: see https://github.com/pgjdbc/pgjdbc/issues/975.
The solution is to upgrade driver to 42.2 when it's released. A workaround is to downgrade the driver stored in lib/jdbc/postgresql to version 9.4.1212 (download). Note that a single JAR file must be present in this directory.
Message on public group: https://groups.google.com/forum/#!topic/sonarqube/REnHa7rK0xI