0

I have a RHEL 7 machine that I am trying to setup with Gerrit. I downloaded gerrit-2.14.6.war into /home/gerrit2. I logged into MariaDB and created a gerrit2 user (with password) and created a 'reviewdb' database.

I then logged in as the gerrit2 user and executed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit. I answered the questions and it installs successfully. I then executed bin/gerrit.sh start and it started successfully.

So, my shop is really weird. We have Windows machine that is our machine at our desk but all of our development is on Linux and the servers are off in another building. I typically access these machines using something like MobaXterm (or PuTTY, basically SSH). My shop does not have a DNS server and they have administratively locked down my hosts file so I cannot add a IP address and hostname to the hosts file on my Windows machine. So, when I opened my web browser, I typed in the IP address of the machine to access it. I was able to successfully do this and then I clicked on Sign In. I entered my username but it barfed an error at me saying that the account did not exist or something like that. I clicked "Back" in the web browser and it barfed another error stating it could not find the webpage. That is when I noticed that my web browser was trying to find the webpage based off the hostname of the machine rather than the IP address.

I looked in /home/gerrit2/gerrit/etc/gerrit.config and found the canonicalURL property is set to http://hostname.of.the.server:8080. I changed that to http://123.123.123.123:8080 and restarted the Gerrit service and now the service will not start. This leads me to believe that there are other hooks in Gerrit that need to be changed as well.

Instead of trying to figure out where all of the hooks are, I decided to just blow alway the whole installation and rebuild again from scratch. I did a rm -rf /home/gerrit2/gerrit and then performed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit again. But, now, it goes all the way to the end and then barfs this error:

fatal: Driver class org.mariadb.jdbc.Driver not available fatal: Cannot connect to SQL database

This makes no sense to me since I did not touch the Java stuff at all. Why is it all of the sudden complaining about this now even though it worked earlier? I have tried finding this by doing find /usr/lib/jvm -type f -print | xargs grep -i maria but there were no matches.

Any ideas what I did to break this and how to fix it?

T Lytle
  • 177
  • 2
  • 13
  • Nevermind. I'm just stupid. I did not hit Y when it asked me to install the MariaDB Connector/J. – T Lytle Jan 26 '18 at 22:18
  • If you can try adding an option that lets you see the full error stack trace: ~~~ java -jar gerrit.war init -d review_site --show-stack-trace ~~~ - But I suspect the problem is your MySQL server isn't listening on a local TCP/IP socket, and is only listening on a UNIX domain socket. - Double check your MySQL server configuration and ensure its actually listening on 127.0.0.1 on the standard MySQL port (3306) - This could be happening due to firewalls, switches on the network or the actual back-end server. – Anup Dey Jan 29 '18 at 09:35
  • - Make sure that an instance of MySQL server is running on the host and accepting TCP/IP connections at the port. - Make sure that TCP connections to the port are not blocked by a firewall. - You might like to check with your DBA to check what actually went wrong during that time stamp. – Anup Dey Jan 29 '18 at 09:36

1 Answers1

0

It helps if you hit Y when it asks you if you want to install the MariaDB Connector/J.

T Lytle
  • 177
  • 2
  • 13