ftbastler / BoNeMEAL

The web app for the Ban-Management Bukkit plugin by confuser. Work in progress // Currently maintained by @oranges13
https://ftbastler.github.com/BoNeMEAL
Other
12 stars 8 forks source link

White page after uploading files #102

Closed Jerlag01 closed 5 years ago

Jerlag01 commented 5 years ago

Hi, So i decided after running the web application on IIS for the past 3 years to move everything to a linux environment. Now my base webserver is Nginx, as i find it more userfriendly to configure it. but I'm getting a white page after uploading the files to my webserver. All dependencies are installed, the webserver configuration is correct as any other application works perfectly fine. Just BoNeMEAL doesn't want to work.

If i try to run php artisan it says something about a pdo exception, that a driver isn't found, but when i check php it's configuration. it says installed and running. so idk why it's returning the message. I tried with php 5.6 and php 7.2, both results the same.

I hope you can help me in a way. Log output after running php artisan: [2019-05-15 17:27:56] production.ERROR: PDOException: could not find driver in /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47 Stack trace:

0 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('sqlite:/usr/sha...', NULL, NULL, Array)

1 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php(37): Illuminate\Database\Connectors\Connector->createConnection('sqlite:/usr/sha...', Array, Array)

2 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(58): Illuminate\Database\Connectors\SQLiteConnector->connect(Array)

3 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(47): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)

4 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(177): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'local')

5 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(65): Illuminate\Database\DatabaseManager->makeConnection('local')

6 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Support/Facades/Schema.php(16): Illuminate\Database\DatabaseManager->connection('local')

7 /usr/share/nginx/html/BoNeMEAL/application/app/Providers/AppServiceProvider.php(25): Illuminate\Support\Facades\Schema::connection('local')

8 [internal function]: App\Providers\AppServiceProvider->boot()

9 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Container/Container.php(526): call_user_func_array(Array, Array)

10 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(703): Illuminate\Container\Container->call(Array)

11 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(685): Illuminate\Foundation\Application->bootProvider(Object(App\Providers\AppServiceProvider))

12 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation{closure}(Object(App\Providers\AppServiceProvider), 14)

13 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(686): array_walk(Array, Object(Closure))

14 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(15): Illuminate\Foundation\Application->boot()

15 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(183): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))

16 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(195): Illuminate\Foundation\Application->bootstrapWith(Array)

17 /usr/share/nginx/html/BoNeMEAL/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(92): Illuminate\Foundation\Console\Kernel->bootstrap()

18 /usr/share/nginx/html/BoNeMEAL/application/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

19 {main}

url to the site: https://punishments.flanderscraft.be/BoNeMEAL

oranges13 commented 5 years ago

Hey Jerlag - you may need to ensure that your composer dependencies are up to date. It looks like it is missing the SQLite drivers. Also ensure that those are enabled for your PHP installation.

Try running composer update in your upload directory.

Jerlag01 commented 5 years ago

@oranges13 I noticed that that error was only given when running the php artisan command on php 7.2

After trying it with php5.6 it doesn't return that error. my logs don't say anything about missing dependencies when running php5.6

oranges13 commented 5 years ago

Drivers are loaded in the php.ini / config directories per php version. Also, the newer versions of PHP (7+) aren't necessarily supported yet so you may need to stick with PHP 5.6 until an updated version is developed (which I'm working on!)

Does it work for you on 5.6 or does it still whitescreen?

Jerlag01 commented 5 years ago

Everything is running php5.6 again but still getting a white screen

oranges13 commented 5 years ago

Without error logs, that's very little to go on. Check in your install directory /storage/logs for any files -- also check your webserver error logs.

Jerlag01 commented 5 years ago

webserver logs are still there, i'll see i can give you the output from it

oranges13 commented 5 years ago

Please use pastebin or https://paste.ubuntu.com/

Jerlag01 commented 5 years ago

webserver error log: https://paste.flanderscraft.eu/uwovogukob.m

oranges13 commented 5 years ago

I am not an nginx expert but it looks like your config is not correct. For one, it cannot gain access to your PHP socket: https://stackoverflow.com/questions/35989291/connect-to-unix-tmp-php-fpm-sock-failed-2-no-such-file-or-directory

Second, attempting to navigate to your installation directory from the webserver is being forbidden. This is not (currently) a BoneMeal issue.

Jerlag01 commented 5 years ago

that was because those request were done by an autorefresh from my browser while uploading the files again. and most of the application files weren't uploaded yet on the server at that time.

direct navigation is indeed forbidden by the default nginx config provided on BoNeMEALS wiki page

oranges13 commented 5 years ago

Are there application specific logs in your application/storage/logs directory? If that directory doesn't exist that may also be the issue.

The application is designed out of the box for Apache (with .htaccess) -- where is the nginx config to which you are referring?

Jerlag01 commented 5 years ago

the directory is there, but no logs are in that directory for the moment nginx config: https://github.com/ftbastler/BoNeMEAL/wiki/Webserver-setup#nginx

oranges13 commented 5 years ago

Do you have php5-fpm configured and with the correct permissions for Nginx to access it? Your prior error stated that file did not exist, though it was looking for php-fpm.sock not php5-fpm.sock

Look into your PHP configs and ensure everything is set up correctly.

Jerlag01 commented 5 years ago

everything is checked and running fine for all other websites that are using php5. The error that stated that it didn't excist was pointing that the application it's files weren't all there yet as they were still uploading at the time that my webbrowser was doing an automatic refresh of the page

oranges13 commented 5 years ago

Try the steps in #92 and see if that resolves your issue. If not, change the APP_ENV to local which will print out any errors to the browser.

Without logs or error messages, there's not much else we can offer.

Jerlag01 commented 5 years ago

Try the steps in #92 and see if that resolves your issue. If not, change the APP_ENV to local which will print out any errors to the browser.

Without logs or error messages, there's not much else we can offer.

Same result, still giving a white screen without any output of errors

Jerlag01 commented 5 years ago

Alright, so i decided to run the application through apache2 and then a reverse proxy with nginx to apache so that it is accessable through port 80. The moment i set nginx up so that it forces https, the app breaks and some files don't get loaded bc of the request of styling files being requested over http, instead of over https

Bottom line, i have the app running, but i'd hoped that i could have atleast it over https instead of http

Jerlag01 commented 5 years ago

Now I'm getting this message every time i try to click on show all bans or show all mutes: [2019-06-14 21:57:18] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected '?'' in /usr/share/nginx/html/banmanager/application/storage/framework/views/f88e0af7709c9e8d4e488dd4e1655639:28 Stack trace:

0 {main}

oranges13 commented 5 years ago

Now I'm getting this message every time i try to click on show all bans or show all mutes: [2019-06-14 21:57:18] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected '?'' in /usr/share/nginx/html/banmanager/application/storage/framework/views/f88e0af7709c9e8d4e488dd4e1655639:28 Stack trace:

0 {main}

Can you try running php artisan config:clear cache:clear to regenerate your views? The UUID is unique there's no way to know which file is causing that error, but a refresh should fix it.

If that does not work, can you open that file and try to determine which view it is and provide some context?

Jerlag01 commented 5 years ago

Now I'm getting this message every time i try to click on show all bans or show all mutes: [2019-06-14 21:57:18] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected '?'' in /usr/share/nginx/html/banmanager/application/storage/framework/views/f88e0af7709c9e8d4e488dd4e1655639:28 Stack trace:

0 {main}

Can you try running php artisan config:clear cache:clear to regenerate your views? The UUID is unique there's no way to know which file is causing that error, but a refresh should fix it.

If that does not work, can you open that file and try to determine which view it is and provide some context?

still having the same issue. I copied the file that is in the message, here is what was in it: https://paste.flanderscraft.eu/gofolaxivu.xml

oranges13 commented 5 years ago

Hey @Jerlag01 -- so this is an issue with PHP5 and the coalesce operator, I actually fixed this bug in 1dd662e09378b51bed0f063bbc8266b1e03f8930

You can pull the updated repo with the fix included or upgrade to PHP7. The choice is up to you. I hope this fixes your issue.

Jerlag01 commented 5 years ago

Hey @Jerlag01 -- so this is an issue with PHP5 and the coalesce operator, I actually fixed this bug in 1dd662e

You can pull the updated repo with the fix included or upgrade to PHP7. The choice is up to you. I hope this fixes your issue.

Alright so, it semi works. but send this error back when viewing the pages that weren't working before: image Any ideas?

Jerlag01 commented 5 years ago

the application itself also returns 2 exceptions for the warnings list image image

oranges13 commented 5 years ago

The bm_player_warnings table is part of your ban manager installation and not part of BoneMeal. Are you sure you have the correct version? Also at this point, this issue spans about 5 different issues. I'm going to close this and open a new one with this specific error since your initial complaint was resolved.

oranges13 commented 5 years ago

Initial issue was PHP 7 incompatability which was fixed in https://github.com/ftbastler/BoNeMEAL/commit/1dd662e09378b51bed0f063bbc8266b1e03f8930