robinp7720 / Blue-Stats-Minecraft

Ever wanted a stat interface for truly everything?
http://stats.mysunland.org/
Apache License 2.0
33 stars 14 forks source link

Http error 500 on new install #108

Closed lukeeexd closed 5 years ago

lukeeexd commented 5 years ago

Tried everything, The whole /html/ folder has read, write, execute permissions.

I added the nginx config but still get 500 error

access.log 93.107.86.248 - - [18/May/2019:22:48:24 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:48:26 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:48:26 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:48:26 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:48:31 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:49:27 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:49:28 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:49:29 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:49:29 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:49:30 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36" 93.107.86.248 - - [18/May/2019:22:57:22 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"

error.log https://hastebin.com/eliwanusew.bash

https://i.imgur.com/B9pr21K.png

spannerman79 commented 5 years ago

@lukeeexd https://github.com/robinp7720/Blue-Stats-Minecraft/wiki/Configure-URLs#nginx

A sample nginx config

The config is a sample only ie you need to edit/change to suit to your setup. It isn't a copy/paste solution.

How I know? Easy - from your error log server name "*domain*" is invalid in /etc/nginx/sites-enabled/default:46

That line, specifically "*domain*" is from https://github.com/robinp7720/Blue-Stats-Minecraft/blob/master/nginx-sample.conf#L7

Tried everything, The whole /html/ folder has read, write, execute permissions.

Never chmod 777 the root html directory - EVER!

lukeeexd commented 5 years ago

@lukeeexd https://github.com/robinp7720/Blue-Stats-Minecraft/wiki/Configure-URLs#nginx

A sample nginx config

The config is a sample only ie you need to edit/change to suit to your setup. It isn't a copy/paste solution.

How I know? Easy - from your error log server name "*domain*" is invalid in /etc/nginx/sites-enabled/default:46

That line, specifically "*domain*" is from https://github.com/robinp7720/Blue-Stats-Minecraft/blob/master/nginx-sample.conf#L7

Tried everything, The whole /html/ folder has read, write, execute permissions.

Never chmod 777 the root html directory - EVER!

The domain error is old, I changed it to the ip of the box.

What permissions should it have?

robinp7720 commented 5 years ago

BlueStats doesn't require any write permissions short of the cache directory. Hence, I'd recommend making everything readonly expect for the cache directory:

chmod -R 444 ./
chmod -R 644 cache/

Are you still having troubles with the missing base plugin?

lukeeexd commented 5 years ago

BlueStats doesn't require any write permissions short of the cache directory. Hence, I'd recommend making everything readonly expect for the cache directory:

chmod -R 444 ./
chmod -R 644 cache/

Are you still having troubles with the missing base plugin?

When i chmod 444 I cant see any of the files.

Baseplugin issue still happens but I can set base plugin in admincp

lukeeexd commented 5 years ago

Seems like I need read write execute for user and group. I still have 500 error though

edit: If i set homepage to "index" it gives 404 error. If its set to "home" it gives error 500. Seems every page gives a 404. http://195.201.149.152/allPlayers/ clicking anything at the top shows 404

lukeeexd commented 5 years ago

Any ideas? It wouldnt have anything to do with hosting the files on a different server than the actual minecraft server would it? All the databases connected successfully

Edit: Set it up on the same box, now I'm getting a blank page. I have it in a directory "stats" inside my main /html/www/ folder

Edit2: and back to error 500

SEC7111: [Mixed-Content] The origin 'https://tws-mc.com' was loaded in a secure context but tried to load an insecure style resource at 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,700'.

SEC7111: HTTPS security is compromised by http://fonts.googleapis.com/css?family=Open+Sans:400,300,700 install (1,1)

HTML1300: Navigation occurred. stats (1,1)

HTML1527: DOCTYPE expected. Consider adding a valid HTML5 doctype: “!DOCTYPE html>”. stats (1,7)

HTML1300: Navigation occurred. stats (1,1)

HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request. GET - https://tws-mc.com/stats/

robinp7720 commented 5 years ago

Sorry, I've had stuff happening during the last few days. For me to figure out why you're experiencing these errors I'd need your webserver and/or php fpm error log.

lukeeexd commented 5 years ago

Where are they located?

The thing is, adminCP works. https://tws-mc.com/stats/admin/index.php

robinp7720 commented 5 years ago

Error logs are usually located in /var/logs. Your nginx error logs might be located in /var/logs/nginx/error.log

lukeeexd commented 5 years ago

https://hastebin.com/ulofidikej.cpp the latest thing there

robinp7720 commented 5 years ago

These are not errors related it the BlueStats stats interface. Visit the BlueStats homepage then report the error log

lukeeexd commented 5 years ago

They are. Thats where the files are. /stats/

https://tws-mc.com/stats/

lukeeexd commented 5 years ago

Wait, I just tried installing something completely different, went to the address and the stats 404 page opened up, I could see the sections at the side (players, home, highscores) I clicked players and the page loaded but nobody showed up. So something weird is going on, cause it shouldn't have showed the 404 page from stats. But going to https://tws-mc.com/stats/ shows nothing

lukeeexd commented 5 years ago

I dont understand this. I get it on a completely different box too http://195.201.149.152

spannerman79 commented 5 years ago
curl -Is http://195.201.149.152/  | head -1
HTTP/1.1 500 Internal Server Error

You still have not setup LEMP/LAMP correctly - which is outside the scope of this issue tracker.

If you do not know how to setup LAMP/LEMP correctly I suggest https://serverpilot.io/

lukeeexd commented 5 years ago

@spannerman79 Uh I do. I have nginx, PHP and MySQL all setup. I had namelessmc running fine before which uses PHP and MySQL

spannerman79 commented 5 years ago

Then you should know how to verify that your PHP install is in fact working correctly

lukeeexd commented 5 years ago

@spannerman79 I have, it is working correctly. I literally just had NamelessMC installed. https://tws-mc.com/test.php

spannerman79 commented 5 years ago

/etc/php/7.2

@robinp7720 I don't have the time at the moment to test but is Bluestats PHP 7.2 ready? PHP 5.6 & 7.0 reached EOL 4 months ago, and PHP 7.1 will reach EOL in 6 months time ( source )

If not I suggest you look at the changes needed to make it PHP7.2 ready at least or PHP7.3 as 7.3 EOL isn't until 6 Dec 2021


@lukeeexd I know for a fact that Bluestats works with PHP5.6, so until @robinp7720 replies or if you got time to burn I suggest using PHP5.6 just to test. If even PHP5.6 fails then it is in fact an incorrect LEMP setup on your end. Stating that "it works with x" doesn't apply.

lukeeexd commented 5 years ago

@spannerman79 On the spigot page it says "Tested with PHP 5.6.3 and PHP 7" does that include PHP7.2?

I'll try with PHP 5.6.3

robinp7720 commented 5 years ago

@lukeeexd @spannerman79 While I haven't done extensive testing of BlueStats on versions above 7.0, BlueStats does work on all recent versions of php including 7.3.x

Enabling debug mode in index.php should reveal any errors

lukeeexd commented 5 years ago

https://tws-mc.com/stats/ (PHP 7.2.17-0ubuntu0.18.04.1) Debug is on just about to start work so can’t look at any of it.

http://195.201.149.152/ (PHP 7.3.5-1+ubuntu18.04.1+deb.sury.org+1 (cli) )

lukeeexd commented 5 years ago

Just had a look. Seems to me that none of the options during install are updating in the files?

robinp7720 commented 5 years ago

The installer sets default values. If you need to update values, you must use the admin panel. In this case, you simply entered the wrong credentials into the config. Change this the the advanced section on the admin panel

lukeeexd commented 5 years ago

I didn’t enter the wrong credentials. I installed this over 15 times, I don’t even know where it’s picking up “Statz” from cause I don’t even use that plugin. I’ve updated the details in adminCp multiple times

robinp7720 commented 5 years ago

BlueStats is trying to connect to the database without a user name. All the entries in the admin panel must be submitted individually.

lukeeexd commented 5 years ago

https://imgur.com/gallery/6mTKwbN Is everything I can change. Upon installing I entered correct database credentials, it even connected to everything in the next step

lukeeexd commented 5 years ago

https://www.spigotmc.org/resources/stats.3638/ is this the "lolmewn" plugin in the install? Looking through plugin.php its trying to use "statz"

Here is a video of me doing the install. I'm using the stats plugin linked above. https://streamable.com/ua3m8

Edit: Now i'm using Statz, downloaded the files off spigot and my errors have decreased. Still something with MySQL. I'm 100% sure the details are correct. https://tws-mc.com/stats/

spannerman79 commented 5 years ago

Warning: mysqli::__construct(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO)

null user doesn't work when communicating with MySQL/MariaDB

http://bfy.tw/NtxQ

lukeeexd commented 5 years ago

Yes, however when installing I add the name and password, and it accepts then and connects but then it shows that error. The details are correct , I can login to the dB use the dB and view tables. So there’s something with bluestats not saving my MySQL details on install. I can’t change them on adminCp either

robinp7720 commented 5 years ago

Yea ok, this is happening because chrome sends different data for checxboxes then firefox and the installer checks are probably fairly inconsistent. I haven't worked on BlueStats in a long while.

Firefox should fix the problems. If not, I'll see what I can do.

lukeeexd commented 5 years ago

I’ve tried Firefox, chrome and edge. I’ll try again when I’m home and try some other browsers too