howardjones / network-weathermap

Network Weathermap draws diagrams from data
http://www.network-weathermap.com/
MIT License
426 stars 94 forks source link

Error message: 500 Internal Server Error when activating networkweather plugin #140

Closed akbarabdullah1989 closed 6 years ago

akbarabdullah1989 commented 6 years ago

When the networkweather plugin is enabled the message appears :

Action failed Sorry, we could not process your last action. Error: 500 Internal Server Error Reason: The response to the last action was unexpected.

Installed on cacti 1.1.37

netniV commented 6 years ago

If you have this error, there should be a record of why the 500 occurred within your error.log for apache and/or cacti's own log (depending on just where the 500 occurred). If you can post the output showing the problem that will help diagnose why it occurred.

gebster commented 6 years ago

You'll get this message if bower is not installed.

On Tue, Apr 3, 2018 at 11:20 PM, Mark Brugnoli-Vinten < notifications@github.com> wrote:

If you have this error, there should be a record of why the 500 occurred within your error.log for apache and/or cacti's own log (depending on just where the 500 occurred). If you can post the output showing the problem that will help diagnose why it occurred.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/howardjones/network-weathermap/issues/140#issuecomment-378492791, or mute the thread https://github.com/notifications/unsubscribe-auth/AZkBIE5FK4DunsvqQBw2mvfNlhb5ciQzks5tlGYSgaJpZM4TGAi_ .

howardjones commented 6 years ago

Would you? I don't see why missing javascript would cause a server-side error...

Logs will shed some light either way, though.

akbarabdullah1989 commented 6 years ago

how to install bower, I've been looking for reference install bower on weathermap plugin but still error

akbarabdullah1989 commented 6 years ago

I use php72

howardjones commented 6 years ago

1) Please read the README - that explains how to install bower. 2) Please look in your httpd error.log. An http 500 error should produce some log entries in there.

akbarabdullah1989 commented 6 years ago

like this error on the apache log : " [Thu Apr 05 04:24:06.372399 2018] [php7:error] [pid 1399] [client 192.168.1.1:37936] PHP Fatal error: Uncaught Exception: No autoloader present. Did you read README.md for dev-specific instructions? in /var/www/html/cacti/plugins/weathermap/lib/all.php:15\nStack trace: \n#0/var/www/html/cacti/plugins/weathermap/setup10.php(19): require_once() \n#1 /var/www/html/cacti/plugins/weathermap/setup.php(11): require_once('/var/www/html/c...') \n#2 /var/www/html/cacti/lib/plugins.php(479): include_once('/var/www/html/c...') \n#3 /var/www/html/cacti/plugins.php(74): api_plugin_install('weathermap')\n#4 {main}\n thrown in /var/www/html/cacti/plugins/weathermap/lib/all.php on line 15, referer: http://192.168.1.2/cacti/plugins.php "

from the description seen that php fatal error

howardjones commented 6 years ago

OK, so actually it's the composer part of the README that causes the error. Same resolution though: read the README! :-)

netniV commented 6 years ago

You could probably put some error handling around that and then display a message that says "READ THE README!!!"

howardjones commented 6 years ago

You mean this? lol image

and this?

image

Unless there's a way for an exception to show up a message in the Cacti UI, I don't think I can do more.

netniV commented 6 years ago

Yeah 😸 but I more meant, prevent the 500 in the first place with an even larger version such as:


Error 500 - You didn't did you?


How many times did I tell you to read the README....

Here:

And Here:

howardjones commented 6 years ago

Is there a way for that message to actually appear on screen in Cacti? As far as I know it will just silently disable the plugin, and we are back to the same situation, only even quieter.

howardjones commented 6 years ago

I did consider having it actually disabled out of the box, with a specific instruction to enable it in the README, but that seems a bit obnoxious. I did that with the 'recalculate now' button in the end, because so many people who didn't understand the file permissions would use it. You had to set a variable to true in the code: $i_have_read_the_manual_and_understand_the_permissions_issues=TRUE :-)

netniV commented 6 years ago

Cacti now only disables on unhandled/unexpected errors. If you use the @ symbol in front of the autoloader, this should allow you to try and create the object. If it's null, you know that it does not exist. Alternatively, if you have installed your own error handler, you can then catch the error, handle it and display your own message.