Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.6k stars 398 forks source link

Uncaught TypeError: sizeof() in auth_changepassword.php:329 #5684

Closed tosiara closed 3 months ago

tosiara commented 4 months ago

Describe the bug

Fatal error occurs when loading a fresh new install 1.2.26 in a docker image:

ERROR PHP ERROR: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type 
Countable|array, bool given in /apache/cacti/auth_changepassword.php:329 Stack trace: 
#0 {main} thrown in file: /apache/cacti/auth_changepassword.php on line: 329

To Reproduce

Steps to reproduce the behavior:

  1. Install cacti inside docker Ubuntu 22

  2. Open landing page, it loads

  3. Enter admin/admin

  4. A blank page is shown

Expected behavior

A password change screen is expected

Desktop (please complete the following information)

Additional context

2024-02-28 16:36:07 - AUTH LOGIN: User 'admin' authenticated
2024-02-28 16:36:17 - ERROR PHP WARNING: dns_get_record(): A temporary server error occurred. in file: /apache/cacti/auth_changepassword.php  on line: 322
2024-02-28 16:36:17 - CMDPHP PHP ERROR WARNING Backtrace:  (/auth_changepassword.php[322]:dns_get_record(), CactiErrorHandler())
2024-02-28 16:36:17 - ERROR PHP ERROR: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /apache/cacti/auth_changepassword.php:329 Stack trace: #0 {main} thrown in file: /apache/cacti/auth_changepassword.php on line: 329
2024-02-28 16:36:17 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2024-02-28 16:36:37 - ERROR PHP WARNING: dns_get_record(): A temporary server error occurred. in file: /apache/cacti/auth_changepassword.php  on line: 322
2024-02-28 16:36:37 - CMDPHP PHP ERROR WARNING Backtrace:  (/auth_changepassword.php[322]:dns_get_record(), CactiErrorHandler())
2024-02-28 16:36:37 - ERROR PHP ERROR: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /apache/cacti/auth_changepassword.php:329 Stack trace: #0 {main} thrown in file: /apache/cacti/auth_changepassword.php on line: 329
2024-02-28 16:36:37 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2024-02-28 16:37:03 - ERROR PHP WARNING: dns_get_record(): A temporary server error occurred. in file: /apache/cacti/auth_changepassword.php  on line: 322
2024-02-28 16:37:03 - CMDPHP PHP ERROR WARNING Backtrace:  (/auth_changepassword.php[322]:dns_get_record(), CactiErrorHandler())
2024-02-28 16:37:03 - ERROR PHP ERROR: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /apache/cacti/auth_changepassword.php:329 Stack trace: #0 {main} thrown in file: /apache/cacti/auth_changepassword.php on line: 329
2024-02-28 16:37:03 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
tosiara commented 4 months ago

The issue seems to be in the hostname used to access docker, it only exists in hypervisor's hosts file. After changing it to docker's IP address I can pass further and cacti seems to work.

TheWitness commented 3 months ago

Make sure you are at Cacti 1.2.26. Post back if that does not fix it.