Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing, password changes may fail on new installations #5813

Closed
martixy opened this issue Aug 31, 2024 · 4 comments
Closed

When installing, password changes may fail on new installations #5813

martixy opened this issue Aug 31, 2024 · 4 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Milestone

Comments

@martixy
Copy link

martixy commented Aug 31, 2024

Describe the bug

Can't change password when first installing

To Reproduce

Steps to reproduce the behavior:

  1. Try to setup cacti.
  2. Reach until first login, where you're forced to change pw.
  3. Fail

Bug

cacti v1.2.27
php v8.3.11

"PHP message: PHP Warning:  dns_get_record(): A temporary server error occurred. in /mnt/http_mount/cacti/auth_changepassword.php on line 345; PHP message: PHP Fatal error:  Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, false given in /mnt/http_mount/cacti/auth_changepassword.php:352
Stack trace:
#0 {main}
  thrown in /mnt/http_mount/cacti/auth_changepassword.php on line 352" while reading response header from upstream, client: 192.168.0.1, server: martixy.dmn-design.com, request: "GET /cacti/auth_changepassword.php?ref=https://martixy.dmn-design.com/cacti/install/install.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "martixy.dmn-design.com", referrer: "https://martixy.dmn-design.com/cacti/install/install.php"

aka
sizeof() throws, because dns_get_record() can return false, for whatever reason ¯\_(ツ)_/¯.
Frankly, not sure what the purpose of that sizeof call is...

After bypassing that we end up here:
cacti_log('WARNING: User attempted to access Cacti from unkonwn URL', false, 'AUTH');
and the browser throws a "too many redirects" error.
And with that, my will to debug this problem ran out.

P.S. Does the root folder have to be named cacti? It'd be cool if it didn't matter.

@martixy martixy added bug Undesired behaviour unverified Some days we don't have a clue labels Aug 31, 2024
@TheWitness TheWitness added confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Sep 12, 2024
@TheWitness TheWitness added this to the 1.2.28 milestone Sep 12, 2024
@TheWitness
Copy link
Member

Wow, interesting. Fixing now.

TheWitness added a commit that referenced this issue Sep 12, 2024
* Can't change password when first installing due to dns issues
@TheWitness
Copy link
Member

Should be fixed. Update auth_changepassword.php from the 1.2.x branch.

@TheWitness TheWitness added the resolved A fixed issue label Sep 12, 2024
TheWitness added a commit that referenced this issue Sep 12, 2024
* Can't change password when first installing due to dns issues
@netniV netniV changed the title Can't change password when first installing When installing, password changes may fail on new installations Sep 29, 2024
@SasSam
Copy link

SasSam commented Nov 20, 2024

Same here. Fresh install. After the 1st login with admin/admin I've got too many redirects and 500.

Log:

2024-11-20 20:25:24 - AUTH LOGIN: User 'admin' authenticated
2024-11-20 20:25:54 - ERROR PHP DEPRECATED: gethostbyname(): Passing null to parameter #1 ($hostname) of type string is deprecated in file: /usr/share/cacti/site/auth_changepassword.php  on line: 312

Installed with apt on debian 12:

cacti/stable,stable,now 1.2.24+ds1-1+deb12u4 all [installed]

@TheWitness
Copy link
Member

Upgrade to 1.2.28 or better yet to 1.2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants
@SasSam @TheWitness @martixy and others