0

between yesterday and today something happened that prevents processes running under Apache accessing an MSSQL server that is essential for functioning of the site.

This is what I find in the Apache error logs for PHP scripts:

PHP Warning:  mssql_connect(): Unable to connect to server

Flask/SQLAlchemy applications are a bit more informative:

OperationalError: (OperationalError) (20009, 'DB-Lib error message 20009,
severity 9:\\nUnable to connect: Adaptive Server is unavailable or does
not exist (####:1234)\\nNet-Lib error during Permission
denied(13)\\n') None None

When I start the same WSGI app in test mode from the console on the same machine that Apache is running on, everything works. To summarize:

  • Both WSGI and PHP fail to connect to an MSSQL server literally overnight if run under Apache

  • When run w/o Apache, the WSGI scripts work fine (can't tell about PHP because that's not my domain)

  • Nothing was changed on the server that runs the web applications (can't say about the MSSQL server)

I need a clue quick. This stuff is running in a company intranet and people are getting impatient. I have control only over the RHEL server running Apache, not the MSSQL server.

The troubleshooting tips using tsql on the freetds page all work fine.

My /etc/freetds.conf is just out of the box and essentially empty (everything commented out).

musbur
  • 567
  • 4
  • 16

1 Answers1

1

Turns out it had nothing to do with Apache et al. This was an SELinux permission issue which started after the VM was rebooted during the night, probably initiated by a sysop in India. Apparently there was an updated security policy for apache. Found the issue in /var/log/messages, which thankfully even included instructions on how to fix it.

musbur
  • 567
  • 4
  • 16