WillyXJ / facileManager

A modular suite of web apps built with the sysadmin in mind.
www.facilemanager.com
GNU General Public License v2.0
84 stars 37 forks source link

[BUG] Zone update dont work if the record is in a clone zone where the Domain Name is the same #596

Closed JsdBEnZ7Rt9orgOfa1Ep1e4n closed 4 months ago

JsdBEnZ7Rt9orgOfa1Ep1e4n commented 7 months ago

Replace everything between stars with current version of your facileManager and module installations:
fM Version : v4.5.0 fmDNS Version : v5.3.3

In raising this issue, I confirm the following (please check boxes, eg [X]):


(BUG | ISSUE) Expected Behavior: Update record in the client with the php cron command

/usr/bin/php /usr/local/facileManager/fmDNS/client.php cron 

(BUG | ISSUE) Actual Behavior: Error on the server

PHP Fatal error:  Uncaught Error: Cannot use object of type stdClass as array in /opt/facileManager/server/fm-modules/fmDNS/classes/class_buildconf.php:1094\nStack trace:\n#0 /opt/facileManager/server/fm-modules/shared/pages/buildconf.php(57): fm_module_buildconf->buildCronConfigs()\n#1 /opt/facileManager/server/index.php(57): include('...')\n#2 {main}\n  thrown in /opt/facileManager/server/fm-modules/fmDNS/classes/class_buildconf.php on line 1094

(BUG | ISSUE) Steps to reproduce: Create a forward zone "example.lan" on the view "view1" Create a clone of the zone "example.lan" with same domain name on the view "view2"

Result :

Screenshot 2023-12-11 at 18-14-22 Forward Zones ‹ facileManager

Add a record in the first or the second zone. Sync on the client with the cron et get the error on the server

PHP Fatal error:  Uncaught Error: Cannot use object of type stdClass as array in /opt/facileManager/server/fm-modules/fmDNS/classes/class_buildconf.php:1094\nStack trace:\n#0 /opt/facileManager/server/fm-modules/shared/pages/buildconf.php(57): fm_module_buildconf->buildCronConfigs()\n#1 /opt/facileManager/server/index.php(57): include('...')\n#2 {main}\n  thrown in /opt/facileManager/server/fm-modules/fmDNS/classes/class_buildconf.php on line 1094

In addition, there is no error, if i use the "BUILD CONFIG" in the https://xxxx/dnsManage/config-servers.php page.

The error is only when I use the Process update available in the main page.

We upgraded from facileManager v3.5.4 and made some test with php 7.3 and php 8.2 (same issue)

Thanks for support

JsdBEnZ7Rt9orgOfa1Ep1e4n commented 6 months ago

This commit seem resolve the issue https://github.com/JsdBEnZ7Rt9orgOfa1Ep1e4n/facileManager/commit/ebddc5c21b2df4468742c16eebd8d6e40cf370af

generobruno commented 5 months ago

After modifying the code to match that commit i have another error. If i clone the zone and do not add any more records i get:

PHP Fatal error: Uncaught Error: Attempt to assign property "record_name" on null in /var/www/html/dnsadmin/fm-modules/fmDNS/classes/class_buildconf.php:1247

However, it works fine when i add a test record to the cloned zone.

WillyXJ commented 4 months ago

This is now fixed in fmDNS 6.0.0 and later.

JsdBEnZ7Rt9orgOfa1Ep1e4n commented 4 months ago

Thanks for the fix