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

Missing configuration defaults prevent installations/upgrades without showing reason #2555

Closed
stefanbrudny opened this issue Mar 21, 2019 · 4 comments
Labels
bug Undesired behaviour enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@stefanbrudny
Copy link

Describe the bug
Unable to finish any installer when using Nginx. For Remote poller, it says:
Sorry, we could not process your last action.
Error:
200 OK
Reason:
The response to the last action was unexpected.

User cannot continue installation (inactive Next button). Main site installer won't finish on nginx as well, but differently: it fails on DB. Both Central and Remote have been tested on: gentoo, pretty stable, and Ubuntu 18.04 Server.

To Reproduce
Try using Nginx.

Expected behavior
Nginx as http server should work correctly.

@netniV
Copy link
Member

netniV commented Mar 22, 2019

This isn't actually an Nginx error but a PHP one. You are likely getting a NOTICE or WARNING appearing which is messing up the JSON response. Can you take a a look at your apache error logs or use the developer tools to see what the response back from the server is.

@stefanbrudny
Copy link
Author

stefanbrudny commented Mar 23, 2019

Right, here is the notice:

2019/03/23 03:00:58 [error] 20217#0: *82 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: rdatabase_retries in /var/www/cacti-dm10/install/functions.php on line 94" while reading response header from upstream, client: 192.168.10.1, server: localhost, request: "POST /install/step_json.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "dm10", referrer: "http://dm10/install/install.php?data={%22Step%22:%223%22,%22Eula%22:true}"

If the variable is removed, same message appears and one cannot continue.

@netniV
Copy link
Member

netniV commented Mar 23, 2019

Yes, I totally agree that should be handled better.

The problem here is that the code predefines all the $database_xxx fields, but does not define any of the $rdatabase_xxx fields so that if you are not using the $rdatabase_xxx fields to connect back to a main poller that can be detected using isset($rdatabase_name) or $config['poller_id'] being greater than zero.

I will add a check if the remote poller name is set, but one of the fields is not to throw an error (with the exception of retries that will just get set to 0). I will also update the config.php.dist which is missing this config variable so if others are copying that, they know of it's presence.

What should happen is that we should be predefining the $rdatabase_xxx fields and then checking to see if the values mean we should connect to the main poller. That is something we will correct in 1.3 since it will need some testing.

@netniV netniV changed the title Cacti 1.2.2: installer won't finish when using Nginx Missing $config defaults prevent installations/upgrades without showing reason Mar 23, 2019
@netniV netniV changed the title Missing $config defaults prevent installations/upgrades without showing reason Missing configuration defaults prevent installations/upgrades without showing reason Mar 23, 2019
@netniV netniV closed this as completed in 6c7b2ab Mar 23, 2019
@netniV
Copy link
Member

netniV commented Mar 23, 2019

Actually, I decided to implement defaults anyway once I started looking into it, so it will now generate message (only in english since no translation code is loaded yet).

config.php is missing rdatabase_default, rdatabase_username, rdatabase_password

These are the defaults that are now set if the field is missing for $database_xxx and $rdatabase_xxx:

field default or error field default or error
type 'mysql' retries 5
default error ssl false
hostname error ssl_key blank
username error ssl_cert blank
password error ssl_ca blank
port 3306

@netniV netniV added bug Undesired behaviour enhancement General tag for an enhancement labels Mar 23, 2019
@netniV netniV added this to the v1.2.3 milestone Mar 23, 2019
@cigamit cigamit added the resolved A fixed issue label Jun 24, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants