Prestashop: Error 500

Created on 14 Dec 2018  路  52Comments  路  Source: PrestaShop/PrestaShop

PS 1.7.4.4 upgraded to 1.7.5.0 RC without any problem. But I am unable to access performance or products section in the BO. Error log indicates the following critial error:

[2018-12-14 15:54:28] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/XXX/public_html/var/cache/prod/ContainerFm9avr7/getPrestashop_Core_Admin_SearchParametersService.php on line 8" at /home/XXX/public_html/src/Core/Search/SearchParameters.php line 50 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/XXX/public_html/var/cache/prod/ContainerFm9avr7/getPrestashop_Core_Admin_SearchParametersService.php on line 8 at /home/XXX/public_html/src/Core/Search/SearchParameters.php:50)"} []

1.7.5.0 Autoupgrade No change required Performance Product settings

Most helpful comment

Hi @krasnycz
Using a rc version on a production site is kind of a bad ideea, as you will not be able to upgrade your shop from a rc version to a final release.
@khouloudbelguith attached a video recording to show you that your issue cannot be reproduced on a clean 1.7.4.4 to 1.7.5.0-rc1 upgrade, meaning that the issue may not be caused by Prestashop but by some server configuration or something else on your side.

All 52 comments

Hi @krasnycz,

What is the exact version of the module 1-click upgrade did you use?
Thanks!

v4.5.1

Hi @krasnycz,

I did not manage to reproduce the issue with the 1-click upgrade v4.5.1.
I attached a video record.
https://drive.google.com/file/d/1jBK5PkrR0ZIrEKkd7bBOf1m0Z2ezHzZV/view
As always, you can use the 1-click update to upgrade between minor versions without much trouble. In order to avoid problems, remember not to change core files, check the compatibility of your modules and theme beforehand, and test the upgrade on a separate machine from your production.

Could you please try to clear cache manually by deleting all the folder into var/cache (prod & dev).
Thanks to check and feedback.

Can you tell me correct MD5 checksum for

https://download.prestashop.com/download/releases/prestashop_1.7.5.0-rc.1.zip

I was unable to find it anywhere.

@khouloudbelguith Sorry but I do not understand what is the point of attaching video and these general statements on using staging. I think people here needs to fix issues not to watch how it works for you.

Unfortunately error log/reporting is so poor in the PS that it seems almost impossible to troubleshoot such issues without trying this and that :(

Hi @krasnycz
Using a rc version on a production site is kind of a bad ideea, as you will not be able to upgrade your shop from a rc version to a final release.
@khouloudbelguith attached a video recording to show you that your issue cannot be reproduced on a clean 1.7.4.4 to 1.7.5.0-rc1 upgrade, meaning that the issue may not be caused by Prestashop but by some server configuration or something else on your side.

Hi @rdy4ever, thanks for your feedback.

@krasnycz, Can you please provide us the log of your upgrade? It can be found in the log.txt file, available in /autoupgrade/tmp/log.txt
Also, it could be that something went wrong with your update and don't have some of the database columns that were added for 1.7.5.
You can find the full schema for 1.7.5.0rc1 here:
https://github.com/PrestaShop/PrestaShop/blob/1.7.5.0-rc.1/install-dev/data/db_structure.sql
You can find the schema changes from 1.7.4.4/1.7.5 by looking at the this file:
https://github.com/PrestaShop/PrestaShop/blob/develop/install-dev/upgrade/sql/1.7.5.0.sql
Thanks!

Well I face issue on different install and server. Same result. Maybe some of pluging I am using is incompatible. The main problem is poor error reporting system in the PS. Upgrade and db structure are fine. This is kida all the time repeating problem. I will rather choose to defer this issue at the moment.

Hi @krasnycz,

Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.
I'll close this ticket. Feel free to open another one if you can give specific details.
Thanks!

I had the same problem and I this is my workaround:

  • Move the shop to a different domain and change a row in shop_url table
  • Run Prestashop update on that new domain
  • Move the shop to an original domain and change a row in shop_url to the original one. I also had to change domain in .htaccess file because it was not updated.

I am sure this error (at least in my case) is not related to folder permissions or cache. I tried clearing cache just before the update but it didn't help. I believe there is a different "cache" which is cleared only when the shop is moved to a different domain.

Hi @MindaugasVarkalys,

This issue is currently closed, can you open a new one with more information about your configuration & your issue.
Thanks!

Hi @krasnycz,

We need more details to understand how we can reproduce your issue:

  • host
  • server setup and configuration(PHP, Apache, ...)
  • PrestaShop version (source), what is the exact link did you downloaded
  • debug mode report
  • PHP error logs
  • apache error log
  • javascript console log
  • Browser version
  • screenshots

Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/

Thanks!

  • host

Cloudways - checked on DO and also on Vultr server

  • server setup and configuration(PHP, Apache, ...)

Debian 8.11, PHP 7.0, MariaDB10,
System | Linux 231954.cloudwaysapps.com 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Apache/2.4.10 (Debian)

  • PrestaShop version (source), what is the exact link did you downloaded

https://github.com/PrestaShop/PrestaShop/releases/download/1.7.4.4/prestashop_1.7.4.4.zip

  • debug mode report
    No error at all.

  • with debug mode off report

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/123.cloudwaysapps.com/ABC/public_html/var/cache/prod/ContainerEipuslj/getPrestashop_Core_Admin_SearchParametersService.php on line 8" at /home/123.cloudwaysapps.com/ABC/public_html/src/Core/Search/SearchParameters.php line 50 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/123.cloudwaysapps.com/ABC/public_html/var/cache/prod/ContainerEipuslj/getPrestashop_Core_Admin_SearchParametersService.php on line 8 at /home/123.cloudwaysapps.com/ABC/public_html/src/Core/Search/SearchParameters.php:50)"} []

  • PHP error logs
    No errors
  • apache error log
    No errors
  • javascript console log
    No errors
  • Browser version
    Multiple browsers generate error 500 on the Performance and Catalog in the BO if debug mode is off.

@krasnycz, thanks for your feedback.
What is the exact language / country did you use during the installation?
Thanks!

@khouloudbelguith Czech

@krasnycz, I tried with those details to install a PrestaShop from the link provided => but it is OK.
Could you please follow this link: https://github.com/PierreRambaud/phppsinfo
phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

  1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.
  2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name.
  3. Now you can view all of the information about PHP for your server for that particular directory.
    image

Thanks to check and feedback.

Seems the issue is related to post_max_size. Why you do not provide this tool direcly in the PS documentation and falsely advise to adjust this to 20M only. It' related to both my issues.

This could save us and cloudways team few days of work :(

On Monday I will make fresh clone of production site and try it from scratch. Will update here.

@krasnycz, thanks!
Waiting for your feedback & I hope that the increase post_max_size solves your issues.

@khouloudbelguith Well it did not resolve the issue. I did multiple tests on different servers. The server configurations set to match requirements from Pierre script. I also removed all 3rd party modules. Same results. Bellow is overview of the sympthomps.

  • autoupgrade seems to be completed fine, however part with upgrading modules is completely omitted. Chrome inspector log shows the ajax request ended up with status code 302 at /admin/ajax.php?rand=1548170738629 request URI.

  • in the server log the following error is generated into the server error log:

[2019-01-22 16:20:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening required '/home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/ContainerVsehxnx/getCache_AnnotationsService.php' (include_path='/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/pear_exception:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/console_getopt:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/pear-core-minimal/src:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/archive_tar:.:/usr/share/php')" at /home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/ContainerVsehxnx/appProdProjectContainer.php line 882 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile Error: require(): Failed opening required '/home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/ContainerVsehxnx/getCache_AnnotationsService.php' (include_path='/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/pear_exception:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/console_getopt:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/pear-core-minimal/src:/home/123.cloudwaysapps.com/appid/public_html/vendor/pear/archive_tar:.:/usr/share/php') at /home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/ContainerVsehxnx/appProdProjectContainer.php:882)"} []

  • after the upgrade performance page and catalog page generated error 500. The following error is saved in the server error log.

[2019-01-22 16:32:39] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/Container4kza4uv/getPrestashop_Core_Admin_SearchParametersService.php on line 8" at /home/123.cloudwaysapps.com/appid/public_html/src/Core/Search/SearchParameters.php line 50 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given, called in /home/123.cloudwaysapps.com/appid/public_html/var/cache/prod/Container4kza4uv/getPrestashop_Core_Admin_SearchParametersService.php on line 8 at /home/123.cloudwaysapps.com/appid/public_html/src/Core/Search/SearchParameters.php:50)"} []

@krasnycz, Can you please provide us the log of your upgrade? It can be found in the log.txt file, available in /autoupgrade/tmp/log.txt again.

@khouloudbelguith
log.txt

Hi @krasnycz,

In your log file, you have an error with your PrestaAdapter module.
[INTERNAL] /home/123.cloudwaysapps.com/ABC/public_html/modules/PrestaAdapter/PrestaAdapter.php line 966 - Trying to get property of non-object
Thanks to check & feedback.

@khouloudbelguith The log includes history of upgrades. You are reffering to old issue from old upgrade. Check the log from 2019-01-22 only as other records are not related to the 1.7.5.0 upgrade!

@krasnycz, thanks for this clarifications.
ping @Quetzacoalt91 what do you think of this issue?
Thanks!

From my point of view, the notice regarding the module PrestaAdapter is not related to the original issue.

I would rather say sere is a misunderstanding between the class signature and the provided parameters. Can you please try to empty your cache by deleting the folders app/cache/dev & /app/cache/prod?

@Quetzacoalt91 It is not about PrestaAdapter. As I stated before @khouloudbelguith is reffering to wrong old part of the update log. Previously I cleared the cache folders and it did not resolve the issue.

The problem is - modules are not upgraded during the autoupgrade procedure. Upgrade part is completely skipped and no record in the log. Previous updates were working fine and we tried uninstall all 3rd party modules, clear cache, adjust server parameters, clone instance to different server. No resolution. Always get autoupgrade completed without updating modules and php exception of the symphony in the server error log.

Configuration, permissions and extensions are set to recommended based on the PierreRambaud script. Also cloudways technical support provided lot of help with troubleshooting this issue. The application permissions are set correctly and apper to be not causing any issue with the application or cache. They do state that it appears as application level issue.

As I stated before - in the comments on the PS blog there are other users facing same issue.

@khouloudbelguith See #11904 that user got same issue as I have. Also on multiple forums so many people report the problem. I have 2 more instances of PS 1.7.4.2 upgraded to 1.7.5.0 including modules with 1click udpate without problems. But when trying to clean cache the error mentioned in #11904 occurs.

Seems major issue is the error after update to 1.7.5.0 using 1click. And not updating modules during install is not related to it.

However I can see there are no longer updates on this issue as it's complicated to troubleshoot due to lack of serious error reporting implemented in the PS. So this issue will be closed without resolution or keep open infinite as most others :(

Hi @krasnycz,

Since I can not reproduce the issue, I pinged our developer @Quetzacoalt91 to find what's wrong, if this problem is related to PrestaShop & the autoupgrade module, or it is a server configuration or customization problem.
Thanks!

That's really frustrating because I can't help without reproducing the issue, nor telling you if this is coming from PrestaShop, the upgrade module, or the server configuration.

I tried two upgrades on my side, 1.7.4.2 & 1.7.4.4 --> 1.7.5.0. None of them allowed me to get the same errors.

@krasnycz you were talking about the forum, would you mind linking here the topics talking about this issue? We might find more details in them.

@khouloudbelguith @Quetzacoalt91 I already tried to remove all 3rd party modules, theme including files from fs and db manually. Moreover all overrides were removed. It's 1742 generating the same error. I also tried move the PS to a2hosting VPS and localhost setup. It's same result. The problem is that this site was already upgraded using autoupgrade few times before so very dificult to simulate this from scratch in test env. I do not keep record of previous updates. Well there some similar issue in the github and one more mentiones on build blog in comments. I will have a look later this week.

I've the same problem. Also upgrade with OneClickUpgrade

Type error: Argument 1 passed to PrestaShop\PrestaShop\Core\Search\SearchParameters::__construct() must be an instance of PrestaShopBundle\Entity\Repository\AdminFilterRepository, instance of Doctrine\ORM\EntityRepository given

1.7.5.0
PS_DISABLE_NON_NATIVE_MODULE 1

Is it not related to nginx conf ? Because in some pages, it works fine, but on others it crash

I've enabled
define('_PS_MODE_DEV_', true);

in defines.inc.php and my page /index.php/configure/advanced/performance/ is now working...

But it doesn't when I disabled it

@fabrice-dresscodes,

Have you tried to clear cache manually by deleting all the folder into var/cache (prod & dev)?
You can also use these command lines to clear cache:

php -d memory_limit=-1 ./bin/console cache:clear
php -d memory_limit=-1 ./bin/console cache:clear --env=prod

Thanks to check and feedback.

No I've runned the command and remove the folder it doesn't work. I'm actually checking https://github.com/PrestaShop/PrestaShop/issues/11909

I may have differents issues at the same time because I can't access invoices with error : Expected argument of type "object, array or empty", "string" given
but for performances pages, it's not the same issue;

@fabrice-dresscodes, about the invoices page issue, you need to check in the ps_configuration table the id_configuration where name = "PS_INVOICE_LEGAL_FREE_TEXT" and you should insert it in the table ps_configuration_lang as described here: #11909 (comment)
or you can replace ps_configuration table & ps_configuration_lang tables with those of the new PS1.7.5.0 installation.
Thanks!

Yes I'm doing it...I was trying to re-init but I'll loose my settings ?

This is related to ngix configuration and new backoffice controllers in the 1.7.5.0.

@krasnycz Yes I've checked this way...but what do you suggest because it seems to work :

[2019-02-05 09:44:21] request.INFO: Matched route "admin_performance". {"route":"admin_performance","route_parameters":{"_controller":"PrestaShopBundle\Controller\Admin\Configure\AdvancedParameters\PerformanceController::indexAction","_legacy_controller":"AdminPerformance","_legacy_link":"AdminPerformance","_route":"admin_performance"},"request_uri":"...../index.php/configure/advanced/performance/?_token=9tcpsYDhOTasf7prP5LoEib0HNnheMROpe-RxEOXOP0","method":"GET"} []

@Quetzacoalt91 Here is one more https://stackoverflow.com/questions/54172371/prestashop-1-7-error-500-when-accessing-general-preference-or-administration and also there was report under blog post about 1.7.5.0 release.

This is multiple issues going on. If you upgrade autoupgrade modules from some previous versions the autoupgrade will fail. You have to remove the autoupgrade and make clean install. If using ngix with settings for 1.7.4.2 it will fails as new BO controllers added in 1750 hence the above error occurs.

I think the core team should clearly state settings for the server configuration. It would same lot of time and all these issues without resolution. The problem is same settings are used on most hosts nowdays.

@fabrice-dresscodes Use settings from this thread - read the last comment!

https://www.prestashop.com/forums/topic/566897-prestashop-17-nginx/

@krasnycz I did it but it doesn't change anything....

If my nginx.conf is not correct, it should crash in DEV mode and in PROD mode isn't it ?

@fabrice-dresscodes I doesn't work that way. I am waiting cloudways support on this issue. I will update you once they get back to me.

@krasnycz My server manager tried it and it didn't work :) and he's system's admin

All right, invoice access sovled with PS_INVOICE_FREE_TEXT default value inserted in ps_configuration_lang

All right...it's working back now...I don't know exactly why.

On test server, I enabled DEV Mode, save params in Preferences and when I get back to PROD Mode it works...

@fabrice-dresscodes, it could be a cache issue.
Thanks!

@fabrice-dresscodes You are using PS in multistore mode or not?

It was enabled once but now english language is disabled so only french is active.

I had the exact same problem and I had the same error in the log as @krasnycz.
In my case I was upgrading from 1.7.4.4. to 1.7.5.1 and I am using Cloudways as well.
Simply clearing the folders in var/cache/ did not work. Inspired by this post https://stackoverflow.com/questions/54172371/prestashop-1-7-error-500-when-accessing-general-preference-or-administration/55473250#55473250 I finally found the solution for my case:

  • I cleared all the files in the var/cache/ folder
  • I restarted Apache
  • I restarted Memcached
  • I restarted Nginix
  • I restarted MySQL
  • Finally I restarted the whole server as well
    This did the trick and I don't get anymore the 500 error on Catalog>Product and AdvancedParameters>Performance pages in the backend.
    Hope this helps.
* I cleared all the files in the var/cache/ folder
* I restarted Apache
* I restarted Memcached
* I restarted Nginix

You need to restart php7.x-fpm :-) That did the trick for me.

Well I faced this issue on multiple installations. Cleaning cache and restarting the server did not help. The only working solution for me was to uninstall and delete 1-click installer files. Install the module again and only then do the autoupgrade.

Was this page helpful?
0 / 5 - 0 ratings