I initially asked this on StackOverflow, but it is not application development issue in my opinion. Basically, I have a C++ application which connects to SQL Server using msodbcsql17 package. It is running on RedHat 7 linux server. When deploying this app to a new environment, the local administrators installed the latest available msodbcsql17 package with yum, which is 17.6.1.1-1. Our application hangs when connecting to the DB, systemctl is not able to stop it, only by killing it after some time. I checked in our lab, app works fine with msodbcsql17 version 17.4.2.1.1-1. So I tested versions by taking one of our lab servers, cloning it, and verifying app is working fine on both. I upgraded one of the servers to 17.6 version of msodbcsql17, app broke "as expected". So I downgraded it to 17.4 version, and app is still broken.
As far as I can tell, the installed binaries (everything in /opt/microsoft folder) is the same on the two servers. Other than this I can only see a single symlink from /usr/lib64 which points to an SO file in /opt/microsoft. According to yum, no other dependencies were installed or removed, I checked this by exporting 'yum list installed' to a file and comparing them by diff.
So what I tried is to use rsync to copy files from original working server to new server. I first just did dry-runs, but didn't find any difference. So I copied over entire /usr folder, still not working. Then I copied over entire /etc folder with rsync, I changed back hostname and IP configuration (obviously these files were overwritten also), and the app started working again. So I broke it again by installing the latest version of msodbcsql17, removing it and installing previous version, and did another rsync dry-run. On the usr folder, no differences, rsync only logs that it is skipping symlinks (skipping non-regular file "tmp"). However on the etc folder there were a few differences, and for the life of me, I can't see what is the problematic file here:
sudo rsync -r --dry-run --out-format="[%t]:%o:%f:Last Modified %M" root@X.X.X.X:/etc/ /etc/ | less
[2020/12/16 00:59:54]:recv:hostname:Last Modified 2019/11/07-17:10:40
[2020/12/16 00:59:54]:recv:ld.so.cache:Last Modified 2020/12/16-00:40:20
[2020/12/16 00:59:54]:recv:odbcinst.ini:Last Modified 2019/11/27-17:03:27
[2020/12/16 00:59:54]:recv:sysconfig/network-scripts/ifcfg-ens160:Last Modified 2019/11/07-17:09:02
[2020/12/16 00:59:54]:recv:tuned/active_profile:Last Modified 2020/09/15-09:51:08
[2020/12/16 00:59:54]:recv:tuned/profile_mode:Last Modified 2020/09/15-09:51:08
/etc/hostname and /etc/sysconfig/network-scripts/ifcfg-ens160 are obviously different. /etc/odbcinst.ini was regenerated during msodbcsql17 installation, but contents are the same according to diff. As for the rest, again, contents are same according to diff Well, except for ld.so.cache which is binary, but size is different, I copied this file over manually and it didn't solve.
So I'm not sure what exactly is fixing the problem here. Most interesting part: if I rsync the /etc folder with the latest msodbcsql17 installed, the app starts working again. So almost like something breaks in the /etc folder?