The root cause is an issue with your server's environment configuration, not a bug in the application logic itself. The code is doing its job by catching this problem and reporting it clearly