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] some php 8* errors: Uncaught TypeError #620

Closed internethering closed 3 months ago

internethering commented 3 months ago

fM Version : 4.6.1 fmDNS Version : 6.0.2


(BUG | ISSUE) Expected Behavior:

I updated to php 8.(1|2) and get several errors:

on site "Dashboard":

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/functions.php:1148 Stack trace: #0 /srv/www/v10005/docroot/httpdocs/fm-modules/shared/pages/index.php(39): buildDashboard() #1 /srv/www/v10005/docroot/httpdocs/index.php(57): include('...') #2 {main} thrown in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/functions.php on line 1148

on site "Modules":

Fatal error: Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, string given in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php:64 Stack trace: #0 /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php(64): extract() #1 /srv/www/v10005/docroot/httpdocs/index.php(57): include('...') #2 {main} thrown in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php on line 64

ValeriiVozniuk commented 3 months ago

Check mDNS 6.0.4 released yesterday, some of them if not all should be fixed there :)

WillyXJ commented 3 months ago

These errors come from the code that checks for updated package versions. I'm currently unable to reproduce it with PHP 8.2.10. Do the errors clear if you force an update check from Settings -> General?

internethering commented 3 months ago

These errors come from the code that checks for updated package versions. I'm currently unable to reproduce it with PHP 8.2.10. Do the errors clear if you force an update check from Settings -> General?

nope, It redirects to admin-modules.php – then I get a:

Fatal error: Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, string given in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php:64 Stack trace: #0 /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php(64): extract() #1 /srv/www/v10005/docroot/httpdocs/index.php(57): include('...') #2 {main} thrown in /srv/www/v10005/docroot/httpdocs/fm-modules/facileManager/pages/admin-modules.php on line 64

I downgraded for testing to php 7.4. Then I get this: Screenshot_20240319_141530 After click on update core I get this: Screenshot_20240319_141538

WillyXJ commented 3 months ago

What an interesting state your installation is in. Would you please provide the output of this SQL statement (assuming your database name is facileManager)?

select module_name,option_value from facileManager.fm_options where option_name='version_check';

internethering commented 3 months ago
MariaDB [(none)]> select module_name,option_value from sys_facile.fm_options where option_name='version_check';
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| module_name   | option_value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| fmDNS         | a:2:{s:9:"timestamp";i:1710853987;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| fmFirewall    | a:2:{s:9:"timestamp";i:1710853987;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| fmSQLPass     | a:2:{s:9:"timestamp";i:1710853988;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| facileManager | a:2:{s:9:"timestamp";i:1710853986;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| fmDHCP        | a:2:{s:9:"timestamp";i:1710853986;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| fmModule      | a:2:{s:9:"timestamp";i:1710853987;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
| fmWifi        | a:2:{s:9:"timestamp";i:1710853988;s:4:"data";s:795:"<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title> 301 Moved Permanently
</title><style>@media (prefers-color-scheme:dark){body{background-color:#000!important}}</style></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; ">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>
";} |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 rows in set (0,000 sec)

MariaDB [(none)]>
WillyXJ commented 3 months ago

This was due to #594 and enforcing https; however, fM currently does not follow 301 which resulted in your experience. The update check will still support http and the next fM version will follow 301. Please perform a manual update check again.

internethering commented 3 months ago

thanks, pages/admin-modules.php looks now fine:


Easily manage one or more ISC BIND servers through a web interface. No more editing configuration and zone files manually.

Version 6.0.2
fmDNS 6.0.4 (released 2024-03-15) is now available. [View the changes](https://www.facilemanager.com/version-history/fmDNS).

I switched back to php 8.2, the error on this page & dashboard is gone.