Sebbo94BY / teamspeak-dynamic-banner

Show your TeamSpeak clients one or multiple dynamic banner images.
GNU General Public License v3.0
14 stars 2 forks source link

Failed to copy the file `uploads/templates/drawed_grid/IMAGE_NAME.jpg` to the necessary target directory `uploads/templates/drawed_grid_text/3`. #164

Closed melliiii closed 1 year ago

melliiii commented 1 year ago

Environment

Describe the bug Hey there, im running your software in docker because it was the easiest to set up and my install on debian 12 failed before i got to see the beautiful dashboard.

When i add a template to a banner i get an error screen showing me this and basically tells me it cant copy the upload file to where it needs to be.

Highlighted Code on Error Page:

if (! Storage::disk('public')->copy($source_file_path, $this->target_directory.'/'.$this->template->filename)) {
  throw new Exception("Failed to copy the file `$source_file_path` to the necessary target directory `$this->target_directory`.");
} 

if i then reload the site it will give me the template on the banner but it will not show the image i selected. you can imagine going forward with this results it a big red error box on the banner configurator. even copying it by hand via the docker-compose exec -it backend bash console doesnt result in it working.

the system status page shows all green for me. The whole page seems to be really slow for me, loading the next page takes about 10 seconds, but it is the same as my install on a linux VM. This log seems to be repeating every few seconds: https://hastebin.skyra.pw/jibuwacuca.yaml

Screenshots Systemstatus Page Adding Template to Banner Error Page

I firmly believe its not your fault that its running slow and throws errors but its something on my side, which is why i tried installing in a docker container but it didnt solve my issue unfortunatly.

melliiii commented 1 year ago

I just looked at the error and i kinda seems like there should be a slash behind the 3 in the target directory 🤔

EDIT: Found the slash in the code, im really tired sorry

Sebbo94BY commented 1 year ago

Hey @melliiii, Thanks for your interest in this project. :-)

First of all: The here included Docker setup is only for local development and testing purposes. The setup is not optimized for the production use due to a slow network setup (I still don't get the reason for this) and especially as some functionalities are not working as they should in production due to the different Docker containers (known and expected behaviour).

Also see https://github.com/Sebbo94BY/teamspeak-dynamic-banner/blob/main/docs/CONTRIBUTE.md, if you're interested in a contribution. :-)

For the production use, it's recommend to follow the installation instructions: https://github.com/Sebbo94BY/teamspeak-dynamic-banner/blob/main/docs/INSTALLATION.md

Then everything will work as expected and the performance will be also much better. :-)

I can support you via e. g. a screensharing session with the setup, if you're interested. This would also help the project to further improve it in order that everyone is better able to set it up by their own.

The reported issue seems to be a generic issue. I'll try to reproduce this and then I can fix it, if it's a code issue.

melliiii commented 1 year ago

Heii @Sebbo94BY, thank you very much for your reply :)

i will try to set it all up on a fresh debian install and get back to you, probably has to do with the Laravel dependencies or something :v i also used apache instead of nginx on my normal install which may have slowed thing down too

Sebbo94BY commented 1 year ago

Ok, I've now destroyed my local Docker test setup and deleted this repository locally.

Afterwards, I've downloaded the repository again and followed the CONTRIBUTE.md instructions 1:1. At the end I had a fresh installation of this application and the installer with the requirements page was shown. I've clicked through this installer wizard to set up the initial super user.

Then I've added a new instance, uploaded a template (image) and added a new banner. The banner, I've added the recently uploaded template. Everything worked as expected. I didn't faced any issues or saw any errors in the logs.

So from the application side, everything is properly implemented and working as expected. Maybe your laravel/public/ directory had incorrect permissions or your jobs are getting executed with the wrong user and thus wrong permissions.

In best case, the jobs are running under the same user as the web server does - usually this is www-data.


Ok, thanks for your update. Let me know, if I can support you. :-)

Yeah, apache is by default a bit slower as it always checks for e. g. .htaccess files at each web request, what nginx doesn't, but you can improve the apache performance by changing a few settings to avoid these checks for example.

Also PHP FPM can improve the performance compared to apache (PHP) MPM. But that's totally up to you, if you want to use apache or nginx and MPM or FPM. This project should be fast on both setups. :)

melliiii commented 1 year ago

EDIT: Hold on i might be dumb

melliiii commented 1 year ago

okay i got the problem i had sorted out, turns out you gotta also start your services :)

now another problem arised, as i dont have any idea how to configure nginx with laravel apps :/

i got the public folder in /var/www/teamspeak-dynamic-banner/laravel/public/ and i dont think im well enough informed about how nginx works to get this working without problems

Sebbo94BY commented 1 year ago

You can find an example nginx vHost configuration here: https://github.com/Sebbo94BY/teamspeak-dynamic-banner/blob/main/docker/nginx/localhost.conf

root must be set to /var/www/teamspeak-dynamic-banner/laravel/public in your case.

The fastcgi_pass defines where nginx should forward your PHP requests at - in this case to PHP FPM. This can be a TCP connection like 127.0.0.1:9000 or a socket like unix:/var/run/php-fpm.sock. This depends on what you have configured in your PHP FPM listen configuration (https://www.php.net/manual/en/install.fpm.configuration.php).

PS: When you change your .env, you always need to run php artisan optimize or at least php artisan config:cache to reload the configuration.

melliiii commented 1 year ago

okay i added a this config file:

/etc/nginx/sites-available

server {
         listen 80;
         listen [::]:80 ipv6only=on;

         # Log files for Debugging
         access_log /var/log/nginx/laravel-access.log;
         error_log /var/log/nginx/laravel-error.log;

         # Webroot Directory for Laravel project
         root /var/www/teamspeak-dynamic-banner/laravel/public;
         index index.php index.html index.htm;

         # Your Domain Name
         server_name localhost;

         location / {
                 try_files $uri $uri/ /index.php?$query_string;
         }

         # PHP-FPM Configuration Nginx
         location ~ \.php$ {
                 try_files $uri =404;
                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
                 fastcgi_pass unix:/run/php/php7.2-fpm.sock;
                 fastcgi_index index.php;
                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                 include fastcgi_params;
         }
 }

and linked it with ln -s /etc/nginx/sites-available/teamspeak-dynamic-banner /etc/nginx/sites-enabled/ ran nginx -t, got ok and restarted the service, still cant reach the site :/

Sebbo94BY commented 1 year ago

First of all: This application requires PHP 8.1 or 8.2. Your here configured socket seems to be a PHP 7.2 - this won't work at all at the end. :-)

Please ensure, that your server_name is correct and matches your domain and also ensure, that you use a PHP 8.1 or 8.2 PHP in fastcgi_pass.

Also ensure, that your FPM is running: systemctl status php8.1-fpm.service

melliiii commented 1 year ago

thank you, i changed the following: server_name _; and changed the typo from 7.2 to 8.2 and now i dont get 502 Bad Gateway anymore ;3

systemctl status php8.2-fpm.service gives me a green light and i got the setup screen which showed me 2 warnings (ssh2 and upload file size, which i both fixed). now i tried adding an instance, and get the 500 Server Error screen after pressing save. the inputs i gave should be correct

EDIT: which i now get on any link, even on the dashboard, so i guess it died after adding the instance, restarting didnt help. and i dont know how to find any logs :/ EDIT2: But its frigging fast now :o also before it kept giving me error 500

Sebbo94BY commented 1 year ago

If you got a HTTP 500 error, you should see an error message in either the application, its logs (laravel/storage/logs/) or in the nginx / PHP logs.

But it sounds like as the permissions aren't correct. Please ensure, that your web server has enough permissions to read and write the application files. All files (in the laravel/ directory) should be owned by the web server user - usually www-data.

Yeah, that's what I said. The Docker setup is buggy. I've debugged the performance issues in Docker, but I didn't figured out yet what's the root cause. :sweat_smile:

melliiii commented 1 year ago

permissions seem fine:

melli@ts3banner:~$ ls -la /var/www/teamspeak-dynamic-banner/laravel/
total 232
drwxr-xr-x 16 www-data www-data     32 Sep 26 15:07 .
drwxr-xr-x  8 www-data www-data     12 Sep 26 14:34 ..
drwxr-xr-x  3 www-data www-data      3 Sep 26 14:34 .config
-rw-r--r--  1 www-data www-data    258 Sep 26 14:34 .editorconfig
-rw-r--r--  1 www-data www-data    748 Sep 26 14:55 .env
-rw-r--r--  1 www-data www-data    682 Sep 26 14:34 .env.example
-rw-r--r--  1 www-data www-data    270 Sep 26 14:34 .env.testing
-rw-r--r--  1 www-data www-data    181 Sep 26 14:34 .gitattributes
-rw-r--r--  1 www-data www-data    311 Sep 26 14:34 .gitignore
drwxr-xr-x  3 www-data www-data      3 Sep 26 14:34 .local
-rw-r--r--  1 www-data www-data   5493 Sep 26 14:34 .php-cs-fixer.php
-rw-r--r--  1 www-data www-data   4158 Sep 26 14:34 README.md
drwxr-xr-x  8 www-data www-data      8 Sep 26 14:34 app
-rw-r--r--  1 www-data www-data   1686 Sep 26 14:34 artisan
drwxr-xr-x  3 www-data www-data      4 Sep 26 14:34 bootstrap
-rw-r--r--  1 www-data www-data   2265 Sep 26 14:34 composer.json
-rw-r--r--  1 www-data www-data 355721 Sep 26 14:34 composer.lock
drwxr-xr-x  2 www-data www-data     19 Sep 26 14:34 config
drwxr-xr-x  5 www-data www-data      6 Sep 26 14:34 database
-rw-r--r--  1 www-data www-data     88 Sep 26 15:07 dump.rdb
drwxr-xr-x  3 www-data www-data      3 Sep 26 14:34 lang
drwxr-xr-x 45 www-data www-data     46 Sep 26 14:35 node_modules
-rw-r--r--  1 www-data www-data  34635 Sep 26 14:35 package-lock.json
-rw-r--r--  1 www-data www-data    498 Sep 26 14:34 package.json
-rw-r--r--  1 www-data www-data    837 Sep 26 14:34 phpunit.xml
drwxr-xr-x  5 www-data www-data      9 Sep 26 15:08 public
drwxr-xr-x  6 www-data www-data      6 Sep 26 14:34 resources
drwxr-xr-x  2 www-data www-data      6 Sep 26 14:34 routes
drwxr-xr-x  5 www-data www-data      5 Sep 26 14:34 storage
drwxr-xr-x  4 www-data www-data      6 Sep 26 14:34 tests
drwxr-xr-x 35 www-data www-data     36 Sep 26 14:35 vendor
-rw-r--r--  1 www-data www-data    388 Sep 26 14:34 vite.config.js

i dont have any new logs apart from those from the installation in /var/www/teamspeak-dynamic-banner/laravel/storage/logs/laravel.log

/var/log/nginx/laravel-error.log and /var/log/nginx/error.log dont have any new entries 🤔

EDIT: i tried using chrome instead of firefox (to see if its cache related or something), got the login page and was excited it only let me proceed when given the right credentials but then it gave me error 500 before i could see the dashboard, also dont get any more information about the error in the browser console, if thats even possible

melliiii commented 1 year ago

Thanks for not giving up on me xd i know im really not good with all this stuff yet :/

Docker is just a blackbox for me O.o good thing i stopped going to uni to study IT and am now beginning in EMS xd

Sebbo94BY commented 1 year ago

Are the permissions are also correct inside the storage/ directory? Laravel automatically creates there subdirectories to manage the caches. Your issue sounds like as there is a folder with incorrect permissions, which causes the application to fail writing files and thus you get a HTTP 500 error.

melliiii commented 1 year ago

i executed sudo chown -R www-data:www-data /var/www/ and restarted nginx and it doesnt change anything 🤔

Also checked the storage folder, all files are owned by www-data

melliiii commented 1 year ago

is laravel/storage/app/public/ supposed to be empty? i didnt create anything yet so i guess so but thats the only thing i found odd 🤔 i cant find any new error logs, neither nginx, php or laravel related. i also looked inside the mysql database and the instances table is empty, so i guess it crashed before even creating the instance

melliiii commented 1 year ago

i found a problem, my redis-server crashed again, which is why i couldnt access the dashboard... still doesnt change anything about being unable to create a instance and i still get error 500 when i try to

also it doesnt autostart after a reboot which ive done in some hope it would work again after. that shouldnt happen again

melliiii commented 1 year ago

Cant tell you how but now it works O.o things ive done is setting the max file upload size in the correct php.ini (etc/php/8.2/fpm/php.ini) and installing the apt package php8.2-ssh2. also restarting the fpm service sudo systemctl restart php8.2-fpm after doing anything.

EDIT: Except until when it didnt anymore and it all gave error 500 again when trying to edit the banner. i could add the template, banner and everything and now we are back to where we were at the beginning of my issue when i couldnt edit anything. i will search for any logs, but i can tell you its not a permission problem with the image file, already gone over there and chmod -R www-data:www-data /var/www/'d

Clicking on this green button is the last thing im able to do until it errors

Pressing back and refreshing gives me this which is not how its supposed to look.

Edit Screen

Pressing Save after putting in some data

Also a dump of my .env:

root@ts3banner:~# cat /var/www/teamspeak-dynamic-banner/laravel/.env
APP_NAME="Dynamic Banner"
APP_ENV=production
APP_KEY=*REDACTED*
APP_DEBUG=false
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=info

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=ts3banner
DB_PASSWORD=*REDACTED*

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
FILESYSTEM_DISK=public
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

MATOMO_ENABLED=false
MATOMO_BASE_URL=
MATOMO_SITE_ID=

it also doesnt really seem to like ts servers not being reachable, bc after turning off my test ts server it keeps erroring again (domain.examle/instances times out with error 504 Timeout)

i found out, wrong credentials to an instance give you Error 500 and the server being offline makes the app time out with error 504

melliiii commented 1 year ago

i will stop trying for today, ive been on this for 7 hours straight now and im kinda getting tired, but thank you for your help so far, im optimistic we can get it running :)

Sebbo94BY commented 1 year ago

I've edited your .env to remove the secret APP_KEY. However, since you published it here, you should also change it in your production application as it's a sensitive secret. It's used for de- and encrypting things in the application, so if your database gets stolen, this key is required to decrypt a few things like the ServerQuery passwords.

But please be aware, that you need to reset your users password afterwards (e. g. via forgot password) and that you need to re-save your ServerQuery password(s), if you have already saved any.


Ok, so the permissions should be fine, good.

is laravel/storage/app/public/ supposed to be empty?

Yes, this project is currently not really using this storage - it's only used for app caching, but the public folder is not used.

i cant find any new error logs, neither nginx, php or laravel related.

This is strange, because a HTTP 500 error should be always logged somewhere.

Have you executed all commands from the INSTALLATION guide? And did they all succeed or did any of them report an error? If you're unsure, you can simply re-run all of these commands (EXCEPT OF php artisan key:generate - this will generate a new application key, which is used for the encryption) - this will not break anything.

If the Redis server is not available, the entire application should still work. It will only not show any available variables and on the banner, it can respectively not replace the variables with the actual values. But it should not cause any unreachable pages or HTTP 500 errors.

sudo systemctl enable redis-server.service should enable the auto-start. :-)

Since the file does not exist after you've tried to upload it, it seems like as the file upload failed.

It could be also, that PHP FPM terminates and restarts due to whatever reason. Have you checked the PHP FPM logs for any restarts / kills?

Sebbo94BY commented 1 year ago

I've just released a new version: https://github.com/Sebbo94BY/teamspeak-dynamic-banner/releases/tag/0.6.1

Especially the checkbox for the ServerQuery encryption might be useful for you. Before, the code automatically tried to establish first a SSH connection for the ServerQuery connection - if this failed, it tried the old RAW method. You can now force this behaviour by dis-/enabling this new checkbox.

melliiii commented 1 year ago

i just updated to your new version, really like it 👍🏻 yeah i think security wasnt really someting i had in the back of my mind when i set this machine up xd good thing its just a VM and will be put down when i get it running completely and i will then reinstall everything the right way ^^ but until we get it running this thing will do. Didnt know that the key was for encryption :v

As part of the Update i reran all the commands, i followed your update guide to the letter, the commands all finished without warnings or errors ^^

the thing about the failed upload is, that the banners exist in the templates view and they show with a preview image like so, and i can see the uploaded banners in the uploads folder.

i made my way to the /etc/php/8.2/fpm/php-fpm.conf file and added the error log to /var/log/php8.2-fpm.log, created the file with touch /var/log/php8.2-fpm.log and ran chmod 666 /var/log/php8.2-fpm.log (all with root privileges of course) and look at that, i get an error log that goes back to when i installed it. The file did not exist until i created it and i got this log output:

[27-Sep-2023 05:40:46] NOTICE: Terminating ...
[27-Sep-2023 05:40:46] NOTICE: exiting, bye-bye!
[27-Sep-2023 05:40:46] NOTICE: fpm is running, pid 9937
[27-Sep-2023 05:40:46] NOTICE: ready to handle connections
[27-Sep-2023 05:40:46] NOTICE: systemd monitor interval set to 10000ms

(ignore the wrong timestamps, already reset my timezone)

i thought i had a reason as to why it is so i set the log level to debug, let the log spam my console with tail -f /var/log/php8.2-fpm.log but i seem to not really get any usefull output at all. Weird

Also i checked my nginx log configuration with find /etc/nginx -name '*.conf' | xargs grep -i log and it gave me my 2 log files in /var/log/nginx/ so the Error 500 is not handled by nginx but by your code which could be why its not being shown in my log file, at least thats what i understand from this stackoverflow post

the /laravel/storage/logs/laravel.log also isnt really helpful either :/ but it shows the bot trying to connect to the server which is nice, and also this is repeating:

[2023-09-27 06:39:07] production.ERROR: Maximum execution time of 30 seconds exceeded {"userId":1,"exception":"[objewww/teamspeak-dynamic-banner/laravel/vendor/planetteamspeak/ts3-php-framework/src/Helper/StringHelper.php:855)
[stacktrace]
#0 {main}
"}
[2023-09-27 06:40:08] production.ERROR: Maximum execution time of 30 seconds exceeded {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 30 seconds exceeded at /var/www/teamspeak-dynamic-banner/laravel/vendor/planetteamspeak/ts3-php-framework/src/Helper/StringHelper.php:87)
[stacktrace]
#0 {main}
"}

and this is in the same log but when i try to create the banner template:

[2023-09-27 06:41:12] production.ERROR: Failed to copy the file `uploads/templates/drawed_grid/1695750416_awd.jpg` to the necessary target directory `uploads/templates/drawed_grid_text/12`. {"userId":1,"exception":"[object] (Exception(code: 0): Failed to copy the file `uploads/templates/drawed_grid/1695750416_awd.jpg` to the necessary target directory `uploads/templates/drawed_grid_text/12`. at /var/www/teamspeak-dynamic-banner/laravel/app/Jobs/CloneOriginalTemplate.php:90)
[stacktrace]
#0 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\CloneOriginalTemplate->handle()
#1 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#2 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#3 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#4 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#5 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#6 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#7 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#8 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#9 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Bus\\Dispatcher->dispatchNow()
#10 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#11 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#13 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#14 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#15 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(43): Illuminate\\Queue\\Jobs\\Job->fire()
#16 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(253): Illuminate\\Queue\\SyncQueue->push()
#17 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(229): Illuminate\\Bus\\Dispatcher->pushCommandToQueue()
#18 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(95): Illuminate\\Bus\\Dispatcher->dispatchToQueue()
#19 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(76): Illuminate\\Bus\\Dispatcher->dispatchSync()
#20 /var/www/teamspeak-dynamic-banner/laravel/app/Http/Controllers/BannerTemplateController.php(69): App\\Jobs\\CloneOriginalTemplate::dispatchSync()
#21 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\BannerTemplateController->add()
#22 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#23 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#24 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#25 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Routing\\Route->run()
#26 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#27 /var/www/teamspeak-dynamic-banner/laravel/vendor/spatie/laravel-permission/src/Middlewares/PermissionMiddleware.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Spatie\\Permission\\Middlewares\\PermissionMiddleware->handle()
#29 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\EnsureEmailIsVerified->handle()
#31 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#33 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#35 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#37 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#39 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#41 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#42 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#44 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#46 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Pipeline\\Pipeline->then()
#48 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack()
#49 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(741): Illuminate\\Routing\\Router->runRoute()
#50 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute()
#51 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#52 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#53 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#55 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#56 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#58 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#59 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#61 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#63 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#65 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#67 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#69 /var/www/teamspeak-dynamic-banner/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#70 /var/www/teamspeak-dynamic-banner/laravel/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#71 {main}
"}
melliiii commented 1 year ago

Well looks like i really need to pay more attention, setting up the supervisor correctly seems to be very important and redoing it solved my issue, i can now edit banners :D

THANK YOU SO MUCH for all your help <3

Sebbo94BY commented 1 year ago

Thanks for your feedback! Let me know, if I can support you with setting it up in a (view/read-only) remote session together, so that I can instruct you. :-)

Those terminating messages from FPM are normal. FPM is regulary restarting itself to e. g. clean up unused memory. You can configure in FPM how often this should happen. But this is in general normal and no issue. :-)

Mhmm... Maximum execution time of 30 seconds exceeded sounds like as you need to increase your PHP FPM max_execution_time, but the default (30 seconds) should be sufficient. I also haven't changed this in this local Docker and any of my production setups. Keeping it lower is usually also better as it reduces the risk of Denial of Service attacks and reduces the waiting time for end-users, who are clicking in the application.

Yes, Supervisor is executing some jobs in the background, so that the user does not have to wait seconds or even minutes for finishing specific jobs, which can simply run in the background. Uploading a template for example happens immediately without the Supervisor, but the Supervisor would process a job to copy this image in order to draw a Grid system on it. And when you add a template to a banner, it also gets copied by Supervisor in the background, so that you have an individual template per banner as each can have different texts on it. :-)

There is currently no systemstatus check for the Supervisor (Processing Laravel Queue Jobs) as it's kinda hard to test this, but I'm sure, that I'll find a proper solution for this in the future. :-)

Great, so the application is now working for you as expected after properly setting up the permissions, nginx, PHP (FPM) and the Supervisor, correct?

You're welcome. No problem. Everyone should be able to set it up, so every feedback and critic is welcome to further improve this project.

PS: When you add a template to a banner, its by default disabled so that banners, which are already in production use don't show new, unconfigured templates. You need to enable it explicitly - this can be currently done on the banner template overview page, so there where you also add new templates to the banner (the toggle switch).

melliiii commented 1 year ago

Thanks for your feedback! Let me know, if I can support you with setting it up in a (view/read-only) remote session together, so that I can instruct you. :-)

Yes thank you, maybe i will get back to you on that :3 For now im experimenting with my install and design a few banners ^^

Those terminating messages from FPM are normal. FPM is regulary restarting itself to e. g. clean up unused memory. You can configure in FPM how often this should happen. But this is in general normal and no issue. :-)

Ahhh okay, that makes a lot of sense ^^

Mhmm... Maximum execution time of 30 seconds exceeded sounds like as you need to increase your PHP FPM max_execution_time, but the default (30 seconds) should be sufficient.

I will keep it at 30 seconds then ^^ i mean i dont have any degraded functionality so it should be fine

There is currently no systemstatus check for the Supervisor (Processing Laravel Queue Jobs) as it's kinda hard to test this, but I'm sure, that I'll find a proper solution for this in the future. :-)

yeah i royaly fckd up my install not configuration it correctly and it took so much effort to find out what went wrong but well :D i suspect its not easy to code those checks and now we know there is a part of the software that isnt monitored so if there are problems maybe its worth a look if its configured correctly (even if it seems impossible to get that wrong) :D

Great, so the application is now working for you as expected after properly setting up the permissions, nginx, PHP (FPM) and the Supervisor, correct?

YES it is :3 <3

Here is some first testing banners i designed (yes i know the top one is disabled atm ^^ ): https://prnt.sc/iqsj7C2YSFTa

Sebbo94BY commented 1 year ago

Great. I'm happy, that it's working for you now.

Cool. Looks awesome!