Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 500 #11784

Closed
krasnycz opened this issue Dec 14, 2018 · 52 comments
Closed

Error 500 #11784

krasnycz opened this issue Dec 14, 2018 · 52 comments
Labels
1.7.5.0 Affects versions Autoupgrade Module: autoupgrade No change required Resolution: issue closed because expected as is Performance Label: Which BO under menu is concerned Product settings Label: Which BO under menu is concerned

Comments

@krasnycz
Copy link

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)"} []

@khouloudbelguith
Copy link
Contributor

Hi @krasnycz,

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

@khouloudbelguith khouloudbelguith added NMI Status: issue needs more information Product settings Label: Which BO under menu is concerned Performance Label: Which BO under menu is concerned Autoupgrade Module: autoupgrade 1.7.5.0 Affects versions labels Dec 14, 2018
@krasnycz
Copy link
Author

v4.5.1

@khouloudbelguith
Copy link
Contributor

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.

@krasnycz
Copy link
Author

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.

@krasnycz
Copy link
Author

@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 :(

@rdy4ever
Copy link
Contributor

rdy4ever commented Dec 15, 2018

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.

@khouloudbelguith
Copy link
Contributor

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!

@krasnycz
Copy link
Author

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.

@khouloudbelguith
Copy link
Contributor

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!

@khouloudbelguith khouloudbelguith added Can't reproduce Resolution: issue closed because cannot be reproduced and removed NMI Status: issue needs more information labels Dec 17, 2018
@MindaugasVarkalys
Copy link

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.

@khouloudbelguith
Copy link
Contributor

Hi @MindaugasVarkalys,

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

@khouloudbelguith
Copy link
Contributor

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!

@khouloudbelguith khouloudbelguith added NMI Status: issue needs more information and removed Can't reproduce Resolution: issue closed because cannot be reproduced labels Jan 10, 2019
@krasnycz
Copy link
Author

  • 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.

@khouloudbelguith
Copy link
Contributor

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

@krasnycz
Copy link
Author

@khouloudbelguith Czech

@khouloudbelguith
Copy link
Contributor

@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.

@krasnycz
Copy link
Author

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.

@khouloudbelguith
Copy link
Contributor

khouloudbelguith commented Jan 11, 2019

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

@krasnycz
Copy link
Author

@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.

@krasnycz
Copy link
Author

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.

@krasnycz
Copy link
Author

@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 :(

@khouloudbelguith
Copy link
Contributor

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!

@Quetzacoalt91
Copy link
Member

Quetzacoalt91 commented Jan 31, 2019

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.

@krasnycz
Copy link
Author

@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.

@fabrice-dresscodes
Copy link

fabrice-dresscodes commented Feb 5, 2019

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

@fabrice-dresscodes
Copy link

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

@khouloudbelguith
Copy link
Contributor

@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.

@fabrice-dresscodes
Copy link

No I've runned the command and remove the folder it doesn't work. I'm actually checking #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;

@khouloudbelguith
Copy link
Contributor

@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!

@fabrice-dresscodes
Copy link

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

@krasnycz
Copy link
Author

krasnycz commented Feb 5, 2019

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

@fabrice-dresscodes
Copy link

@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"} []

@krasnycz
Copy link
Author

krasnycz commented Feb 5, 2019

@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.

@krasnycz
Copy link
Author

krasnycz commented Feb 5, 2019

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

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

@fabrice-dresscodes
Copy link

@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 ?

@krasnycz
Copy link
Author

krasnycz commented Feb 5, 2019

@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.

@fabrice-dresscodes
Copy link

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

@fabrice-dresscodes
Copy link

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

@fabrice-dresscodes
Copy link

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...

@khouloudbelguith
Copy link
Contributor

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

@krasnycz
Copy link
Author

krasnycz commented Feb 8, 2019

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

@fabrice-dresscodes
Copy link

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

@Pitt1823
Copy link

Pitt1823 commented Apr 2, 2019

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.

@netpalantir
Copy link

* 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.

@krasnycz
Copy link
Author

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.

@khouloudbelguith khouloudbelguith added No change required Resolution: issue closed because expected as is and removed TBR Status: issue to be reproduced labels Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.5.0 Affects versions Autoupgrade Module: autoupgrade No change required Resolution: issue closed because expected as is Performance Label: Which BO under menu is concerned Product settings Label: Which BO under menu is concerned
Projects
None yet
Development

No branches or pull requests

8 participants