-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 15.0.13
-
Fix Version/s: None
-
Component/s: Firewall
-
Labels:None
-
ToDo:
-
Distro:FreePBX Distro
Trying to diagnose some truly baffling firewall behaviour, finally noticed this in the logs every 5 seconds:
```
Jul 18 06:31:20 pbx php: Unable to see safemode in services.. Sleeping 5 seconds and retrying
Jul 18 06:31:26 pbx php: Unparseable output from getservices - ["Whoops\\Exception\\ErrorException: dns_get_record(): A temporary server error occurred. in file \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php on line 349","Stack trace:"," 1. Whoops\\Exception\\ErrorException->() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:349"," 2. dns_get_record() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:349"," 3. FreePBX\\modules\\Firewall\\Smart->getKnown() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:87"," 4. FreePBX\\modules\\Firewall\\Smart->getAllPorts() \/var\/www\/html\/admin\/modules\/firewall\/Firewall.class.php:1992"," 5. FreePBX\\modules\\Firewall->getSmartPorts() \/var\/www\/html\/admin\/modules\/firewall\/bin\/getservices:22"] - returned 1
```
It seems that Smart.class.php line 349 was added with the following commit:
```php
$srvdns = dns_get_record('_sip._udp.'.$d, \DNS_SRV);
```
At the point of the error, $d contains ntt-east.ne.jp. I don't know why "a temporary server error occurred" when trying to query it – it queries just fine using dig – but it prevents the firewall from starting and this seems dangerous.
I changed it as follows, just to avoid having it crash:
```php
$srvdns = @dns_get_record('_sip._udp.'.$d, \DNS_SRV);
```
The firewall now starts up correctly. I don't know if this is a sufficient fix; it probably needs some error checking or something. I don't really know enough about PHP to know for sure.
- duplicates
-
FREEPBX-22666 Firewall will not start if DNS is not working
-
- Closed
-