- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
06:56 PM
08-13-2018
06:56 PM
HTTP 500 error in frontend page
If I open frontend page or catalog menu in backend admin page, HTTP 500 error is occurred.
/var/log/nginx/error.log :
[error] 9326#9326: *4135 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function isSwatchAttribute() on null in /home/(...)/vendor/magento/module-swatches/Helper/Data.php
[error] 9326#9326: *4220 access forbidden by rule
How can I fix this?
Labels:
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
09:41 PM
08-13-2018
09:41 PM
Re: HTTP 500 error in frontend page
Hi @NDelt,
Can you please mentioned on which line no error display and your Magento 2.x version?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
10:01 PM
08-13-2018
10:01 PM
Re: HTTP 500 error in frontend page
I hope you have set permission for your site like below,
sudo find var pub/static pub/media -type f -exec chmod g+w {} \; sudo find var pub/static pub/media -type d -exec chmod g+ws {} \; sudo find ./pub/media -type d -exec chmod 777 {} \; sudo find ./pub/static -type d -exec chmod 777 {} \;
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial
Magento 2 Blogs/Tutorial
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
10:10 PM
08-13-2018
10:10 PM
Re: HTTP 500 error in frontend page
I'm using Magento 2.2.5. And this error has occurred after installing templates.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
11:45 PM
08-13-2018
11:45 PM
Re: HTTP 500 error in frontend page
Hello,
please check below file for same
vendor/magento/module-swatches/Helper/Data.php
Fixed it with a core hack.
Above: $swatchAttributes = $this->swatchAttributesProvider->provide($product); Put this: if (!isset($this->swatchAttributesProvider)) { $this->swatchAttributesProvider = ObjectManager::getInstance()->get(SwatchAttributesProvider::class); }
More info :
https://github.com/magento/magento2/issues/10388
Hope it will help you.
If works then mark as solution.
Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer