freescout-helpdesk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.65k stars 452 forks source link

Imagen Uploading Issue #3987

Closed tuton012 closed 14 hours ago

tuton012 commented 2 weeks ago

Hello, I am facing this issue. Images are not uploading when trying to send an email. I try to upload an image or paste it and just do nothing.  I am suing the Digital Ocean droplet. I currently have two websites: a WordPress website, and on the subdomain FreeScout, I didn't have any issues. I have been running it for so long, and it was working prior. After I did some updates on FreeScout, it started to do it. not sure if a setting changes or what could be affecting it.  The server is Nginx with the HestiaCp panel. all permission shows ok

image

error log show just two thing and they are from 4/15

![image]Annotation 2024-04-20 011851](https://github.com/freescout-helpdesk/freescout/assets/108067270/a32d734b-420b-4e24-b560-5192ae95662d)

-->

PHP version: 8.2 FreeScout version: 1.8.136 Database: Maria Are you using CloudFlare: Yes

tuton012 commented 2 weeks ago

I notice that I get this 404 not found on the browser console

not found

raramuridesign commented 2 weeks ago

@wptaskly As a temporary solution, try disable cloudflare and see if it works. M

tuton012 commented 2 weeks ago

@wptaskly As a temporary solution, try disable cloudflare and see if it works.

M

That didn't work 🫤

raramuridesign commented 2 weeks ago

Hi @wptaskly If that did not work, perhaps check the permissions on the folder (manually) and also check that the owner is set correctly on all folders/files. Perhaps also check the space on the server, if you have enough. We have a workflow rule to clear out the tickets after x months, to ensure that the server / vps does not get too full. Perhaps this is also an issue. Hope this helps. M.

freescout-helpdesk commented 1 week ago

Most likely https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#-permissions-issue

diogogpinto commented 1 week ago

Try:

php artisan storage:link

Also:

sudo chown -R www-data:www-data /var/www/html

where /var/www/html is the path to your freescout folder.

Also:

php artisan freescout:after-app-update

tuton012 commented 1 week ago

Most likely https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#-permissions-issue

Try:

php artisan storage:link

Also:

sudo chown -R www-data:www-data /var/www/html

where /var/www/html is the path to your freescout folder.

Also:

php artisan freescout:after-app-update

I try it still don't work I clear cache and browser cache also.

this it the command I am running and the output.

root@mysite:~# sudo chown -R www-data:www-data /var/www/html root@mysite:~# ln -s /var/www/html/storage/app/public public/storage ln: failed to create symbolic link 'public/storage': No such file or directory root@mysite:~# php artisan storage:link Could not open input file: artisan root@mysite:~# cd /var/www/html root@mysite:/var/www/html# php artisan storage:link Could not open input file: artisan root@mysite:/var/www/html# ln -s /var/www/html/storage/app/public public/storage ln: failed to create symbolic link 'public/storage': No such file or directory root@mysite:/var/www/html# sudo chown -R www-data:www-data /var/www/html root@mysite:/var/www/html# php artisan storage:link Could not open input file: artisan root@mysite:/var/www/html# php artisan freescout:after-app-update Could not open input file: artisan root@mysite:/var/www/html#

diogogpinto commented 1 week ago

It seems like you are not on the root folder of your Freescout project. You should run these command on the project root path, where .env file is.

tuton012 commented 1 week ago

follow the command on the root folder and still images upload don't work.

root@mysite:/home/mysite/web/support.mysite.com/public_html# php artisan freescout:clear-cache The compiled services & packages files have been removed. Cache cleared successfully. Compiled views cleared! Configuration cache cleared! Configuration cached successfully! Created: storage/app/public/js/vars.js root@mysite:/home/mysite/web/support.mysite.com/public_html# sudo chown -R www-data:www-data /var/www/html root@mysite:/home/mysite/web/support.mysite.com/public_html# php artisan freescout:clear-cache The compiled services & packages files have been removed. Cache cleared successfully. Compiled views cleared! Configuration cache cleared! Configuration cached successfully! Created: storage/app/public/js/vars.js root@mysite:/home/mysite/web/support.mysite.com/public_html#

tuton012 commented 1 week ago

Log says this

file_put_contents(/home/mysite/web/support.mysite.com/public_html/storage/framework/cache/data/71/e7/71e745d13645beba997b5011324db8ee58db0e30): Failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): file_put_contents(/home/allywebsite/web/support.mysite.com/public_html/storage/framework/cache/data/71/e7/71e745d13645beba997b5011324db8ee58db0e30): Failed to open stream: Permission denied at /home/mysite/web/support.mysite.com/public_html/overrides/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122)

diogogpinto commented 1 week ago

This is a permission issue.

Please try the following:

sudo chown -R www-data:www-data /home/mysite/web/support.mysite.com/public_html
find /home/mysite/web/support.mysite.com/public_html -type f -exec chmod 664 {} \;    
find /home/mysite/web/support.mysite.com/public_html -type d -exec chmod 775 {} \;

Then try to clear the cache and see if the logs still fail. Also, make sure you have the simlink created, you can run:

php /home/mysite/web/support.mysite.com/public_html/artisan storage:link
tuton012 commented 1 week ago

This is a permission issue.

Please try the following:

sudo chown -R www-data:www-data /home/mysite/web/support.mysite.com/public_html
find /home/mysite/web/support.mysite.com/public_html -type f -exec chmod 664 {} \;    
find /home/mysite/web/support.mysite.com/public_html -type d -exec chmod 775 {} \;

Then try to clear the cache and see if the logs still fail. Also, make sure you have the simlink created, you can run:

php /home/mysite/web/support.mysite.com/public_html/artisan storage:link

I follow the command and now the site don't work now getting http error and its fully not working I ran the command and clear cache.

not working

`#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()

1 /home/mysite/web/support.mysite.com/public_html/overrides/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents()

2 /home/mysite/web/support.mysite.com/public_html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(121): Illuminate\Filesystem\Filesystem->put()

3 /home/mysite/web/support.mysite.com/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler->compile()

4 /home/mysite...; PHP message: PHP Fatal error: Uncaught ErrorException: file_put_contents(/home/mysite/web/support.mysite.com/public_html/storage/framework/views/a50b4f793eebc7ac3486ae3790602155b768a4ff.php): Failed to open stream: Permission denied in /home/mysite/web/support.mysite.com/public_html/overrides/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122

Stack trace:`

diogogpinto commented 1 week ago

@wptaskly Are you running on Nginx or Apache?

When I access your website I'm redirected to https://support.****.com/hc/1340367131 (removed domain for privacy reasons). The above code shouldn't mess up your code unless there is some problem with the webserver config.

Check also your webserver log.

tuton012 commented 1 week ago

@wptaskly Are you running on Nginx or Apache?

When I access your website I'm redirected to https://support.****.com/hc/1340367131 (removed domain for privacy reasons). The above code shouldn't mess up your code unless there is some problem with the webserver config.

Check also your webserver log.

I am running Nginx and the site redirect to that page because I am using the custom home page module. Regarding to the site if I restore backup the site will work fine but the imagen wont upload at all and its annoying to have to send link to customer of a picture hosted elsewhere. When I did the following command, you mention the site don't work now as you can see its fully http error. not sure what else to do. the site was working way back fine, but I updated to the latest version of Freescout and the upload stops working.

diogogpinto commented 1 week ago

You have a permissions issue as seen in your logs:

Failed to open stream: Permission denied

I can't debug without having access to the server, but if you follow the wiki, check your webserver logs and the laravel logs, you will get there.

tuton012 commented 1 week ago

You have a permissions issue as seen in your logs:

Failed to open stream: Permission denied

I can't debug without having access to the server, but if you follow the wiki, check your webserver logs and the laravel logs, you will get there.

I restore the backup and the site works fine everything except the imagen upload. I keep traying to see what's causing this. Thanks for your help I really appreciated.

tuton012 commented 1 week ago

I have tried so many things and still can't get it to work. I follow all the commands, but the site is throwing an error. There's not a log in the storage/log, but the server throws this. 

`#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()

1 /home/allywebsite/web/support.allywebsite.com/public_html/overrides/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents()

2 /home/allywebsite/web/support.allywebsite.com/public_html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(121): Illuminate\Filesystem\Filesystem->put()

3 /home/allywebsite/web/support.allywebsite.com/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler->compile()

4 /home/allyweb...; PHP message: PHP Fatal error: Uncaught ErrorException: file_put_contents(/home/allywebsite/web/support.allywebsite.com/public_html/storage/framework/views/a50b4f793eebc7ac3486ae3790602155b768a4ff.php): Failed to open stream: Permission denied in /home/allywebsite/web/support.allywebsite.com/public_html/overrides/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122

Stack trace:`

diogogpinto commented 6 days ago

@tuton012 as I've said before, there seems to be a permission issue on your website.

Running this code should fix it.

First: sudo chown -R www-data:www-data /home/allywebsite/web/support.allywebsite.com/public_html Then: find /home/allywebsite/web/support.allywebsite.com/public_html -type f -exec chmod 664 {} \; Finally: find /home/allywebsite/web/support.allywebsite.com/public_html -type d -exec chmod 775 {} \;

Run it one at a time and see if any errors occur. Also, the cron job should be run as www-data.