Wednesday, February 27, 2019

SQL Server install troubleshooting

A while back I spun up a VM with Fedora installed so I could install the SQL Server 2017 Preview for Linux.  I found it really easy to setup and get going.  I was amazingly simple.  I don't recall the exact order of events but I believe I did an update to the OS and it broke SQL Server.  I attempted to remove SQL Server and install the RTM version.  But I never had much luck. 

Out of frustration I spun up a new VM and installed the RTM version to play around with.  Now that it is a year later I thought I would check out that old VM and see if I can get it working.  I figure it would be a good learning opportunity to learn a few things about Linux and to get familiar with the OS.  Here are my pertinant notes from this endeavor.

To start out I checked the status of the current install. 

systemctl status mssql-server

The result was that the service wasn't running.  So trying to restart the service like so also failed:

systemctl start mssql-server

The status was 127 which indicates that the command wasn't found.  I checked the path for Sql Server and it was present.  I had a hunch that a dependency was missing.  So I tried to do verbose logging for systemd, but don't think I was successful.

systemd-analyze set-log-level notice

I did check the logs with the following command.  Note the parameter "--since 20:00" means only entries since 8:00 PM.  My last attempt to start the service was at approximately 8:10 PM.

journalctl --since 20:00

I noticed a line that said a no such file or directory, however it was wasn't for sqlservr.  Instead it was for libc++.so.1


I wasn't sure why this was missing, so I ran.  So after doing some digging I realized there was a package that was named similar. So I gave installing it a try.

yum install libcxx


After installing this package SQL Server was able to successfully run.


However I was still not able to connect.  I checked the firewall:

firewall-cmd --list-ports

Port 1433/tcp was listed so it wasn't the host firewall.  I still couldn't connect so I checked the journal and found the following


So the system thought the process was running but it wasn't, it failed.  Doing a quick reinstall fixed it.

sudo yum remove mssql-server
sudo yum install mssql-server
sudo /opt/mssql/bin/mssql-conf setup

After that I was able to connect.  Yay!