• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Error 500 internal server error (But I don't have more information)

jaumealcantarago

New Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
Version 18.0.56 Update #3
I have uploaded a Symfony 5 application to my subdomain and when I log in I get this error 500 ->
1698924399864.png

The problem I have is that I cannot receive more information about this error, , this is in the ples logs panel ->

1698924525547.png
I also have PHP
Code:
display_errors
enabled ->
1698924631123.png
I have also reviewed the Nginx and Apache errors, although my server is Nginx but I have reviewed the vast majority of log files, also the logs of my subdomain such as;
-rw-r--r-- 2 root root 0 Oct 26 11:30 access_log
-rw-r--r-- 2 root root 2675 Nov 1 06:26 access_log.processed
-rw-r--r-- 2 root root 0 Nov 1 06:27 access_log.webstat
-rw-r--r-- 2 root root 4451 Nov 2 11:25 access_ssl_log
-rw-r--r-- 2 root root 545244 Nov 1 06:26 access_ssl_log.processed
-rw-r--r-- 2 root root 0 Nov 1 06:27 access_ssl_log.webstat
-rw-r--r-- 2 root root 35880 Nov 2 00:00 error_log
-rw-r--r-- 2 root root 157 Nov 2 09:38 proxy_access_log
-rw-r--r-- 2 root root 0 Oct 28 06:31 proxy_access_ssl_log
-rw-r--r-- 2 root root 0 Oct 26 11:30 proxy_error_log

And symfony is not logging anything in the var/log folder and it has all the writing permissions so that the server user can write.

Please help, I've been dealing with this issue for a few days and I'm running out of time.

Thank you so much
 
Could you please show the content of your .htaccess file?
Yes, this is the .htaccess file created with apache-pack in my /public/ folder:


HTTP:
DirectoryIndex index.php

# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
# Options +FollowSymlinks

# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
# to the front controller "/index.php" but be rewritten to "/index.php/index".
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    # This Option needs to be enabled for RewriteRule, otherwise it will show an error like
    # 'Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden'
    Options +FollowSymlinks

    RewriteEngine On

    # Determine the RewriteBase automatically and set it as environment variable.
    # If you are using Apache aliases to do mass virtual hosting or installed the
    # project in a subdirectory, the base path will be prepended to allow proper
    # resolution of the index.php file and to redirect to the correct URI. It will
    # work in environments without path prefix as well, providing a safe, one-size
    # fits all solution. But as you do not need it in this case, you can comment
    # the following 2 lines to eliminate the overhead.
    RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
    RewriteRule .* - [E=BASE:%1]

    # Sets the HTTP_AUTHORIZATION header removed by Apache
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

    # Redirect to URI without front controller to prevent duplicate content
    # (with and without `/index.php`). Only do this redirect on the initial
    # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
    # endless redirect loop (request -> rewrite to front controller ->
    # redirect -> request -> ...).
    # So in case you get a "too many redirects" error or you always get redirected
    # to the start page because your Apache does not expose the REDIRECT_STATUS
    # environment variable, you have 2 choices:
    # - disable this feature by commenting the following 2 lines or
    # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
    #   following RewriteCond (best solution)
    RewriteCond %{ENV:REDIRECT_STATUS} =""
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    # If the requested filename exists, simply serve it.
    # We only want to let Apache serve files and not directories.
    # Rewrite all other queries to the front controller.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        # When mod_rewrite is not available, we instruct a temporary redirect of
        # the start page to the front controller explicitly so that the website
        # and the generated links can still be used.
        RedirectMatch 307 ^/$ /index.php/
        # RedirectTemp cannot be used instead
    </IfModule>
</IfModule>
 
Try enable debug in your CMS -> The Debug Component (Symfony 3.3 Docs). | Troubleshooting Problems (Symfony 5.4 Docs)

And, why about /var/log/plesk-phpXX-fpm/error.log ?
I have tried the debug but of course being in production many errors appear, and in /var/log/plesk-php74-fpm I do find logs of 500 but with the favicon of my app, here I leave you some example ->
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "{"message":"Uncaught PHP Exception Twig\\Error\\RuntimeError: \"An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").\" at /var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig line 9","context":{"exception":{"class":"Twig\\Error\\RuntimeError","message":"An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig:9","previous":{"class":"InvalidArgumentException","message":"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypo"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "ints.json\" does not exist.","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php:124","previous":{"class":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"No route found for \"GET https://barcolon.w3bcn.es/favicon.ico\" (from \"https://barcolon.w3bcn.es/login\")","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/http-kernel/EventListener/RouterListener.php:135","previous":{"class":"Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException","message":"No routes found for \"/favicon.ico/\".","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php:74"}}}}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2023-11-02T13:21:30.751536+00:00","extra":{}}"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "{"message":"Exception thrown when handling an exception (Twig\\Error\\RuntimeError: An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\"). at /var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig line 9)","context":{"exception":{"class":"Twig\\Error\\RuntimeError","message":"An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig:9","previous":{"class":"InvalidArgumentException","message":"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/p"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "ublic/build/entrypoints.json\" does not exist.","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php:124"}}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2023-11-02T13:21:30.756291+00:00","extra":{}}"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "{"message":"Uncaught Exception: An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").","context":{"exception":{"class":"Twig\\Error\\RuntimeError","message":"An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig:9","previous":{"class":"InvalidArgumentException","message":"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/webpack-"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: "encore-bundle/src/Asset/EntrypointLookup.php:124","previous":{"class":"Twig\\Error\\RuntimeError","message":"An exception has been thrown during the rendering of a template (\"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.\").","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/templates/base.html.twig:9","previous":{"class":"InvalidArgumentException","message":"Could not find the entrypoints file from Webpack: the file \"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/public/build/entrypoints.json\" does not exist.","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php:124","previous":{"class":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"No route found for \"GET https://barcolon.w3bcn.es/favicon.ico\" (from"
[02-Nov-2023 13:21:30] WARNING: [pool barcolon.w3bcn.es] child 621292 said into stderr: " \"https://barcolon.w3bcn.es/login\")","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/http-kernel/EventListener/RouterListener.php:135","previous":{"class":"Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException","message":"No routes found for \"/favicon.ico/\".","code":0,"file":"/var/www/vhosts/w3bcn.es/barcolon.w3bcn.es/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php:74"}}}}}}},"level":500,"level_name":"CRITICAL","channel":"php","datetime":"2023-11-02T13:21:30.756647+00:00","extra":{}}"
 
Please replace
Code:
Options +FollowSymlinks
in your .htaccess file with
Code:
Options +SymLinksIfOwnerMatch
It will probably fix the error 500. The root cause is probably that with the symlink protection in the Apache & Nginx settings "on", FollowSymlinks is a prohibited directive. The newer and safer SymLinksIfOwnerMatch can replace it.
 
Please replace
Code:
Options +FollowSymlinks
in your .htaccess file with
Code:
Options +SymLinksIfOwnerMatch
It will probably fix the error 500. The root cause is probably that with the symlink protection in the Apache & Nginx settings "on", FollowSymlinks is a prohibited directive. The newer and safer SymLinksIfOwnerMatch can replace it.
Ya resolví el problema, era el flat de dos archivos base de mi proyecto
 
Back
Top