Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
pessoal2004

Elasticsearch: product page “404 Not Found” and category error

Question

We are a stuck with elasticsearch, because we have two errors:

1) The search page work fine but after that if we select on product to open there product page we get “404 Not Found”. 

2) With elastsearch when we click at any category we get the error:
Warning: file_put_contents(/usr/share/nginx/html/log/20190219_exception.log): failed to open stream: Permission denied in /usr/share/nginx/html/classes/log/FileLogger.php on line 93

Any ideas to solve this will be appreciate. 

 

OUR CONFIGURATION:
- Centos 7.6
- Nginx 1.12.2 (also happen with httpd)
- PHP 7.1 (also happen with PHP 7.2)
- Elasticsearch 5.4.0 (also happen with elasticsearch 5.6.14 and 6.6)
- Download the module at https://store.thirtybees.com/shop-modules/front-office/elastic-search-module

 

- Made the changes descrite at https://github.com/thirtybees/elasticsearch/compare/1.0.0...master in the followins files:
          - elasticsearch.php 
          - views/templates/hook/vue/main-search.html.tpl
          - views/templates/hook/vue/results.html.tpl
          - views/templates/themes/panda/hook/vue/main-search.html.tpl
          - views/templates/themes/transformer/hook/vue/main-search.html.tpl
          - views/templates/themes/warehouse/hook/vue/main-search.html.tpl
          - views/templates/themes/warehouse/hook/vue/results.html.tpl

 

Any ideas how solve this 2 issues will be appreciated.

Edited by pessoal2004

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
5 hours ago, pessoal2004 said:

2) With elastsearch when we click at any category we get the error:
Warning: file_put_contents(/usr/share/nginx/html/log/20190219_exception.log): failed to open stream: Permission denied in /usr/share/nginx/html/classes/log/FileLogger.php on line 93

When some error occurs, thirtybees tries to log it into file. But in your case, because of incorrect directory permission, it's not able to create file in /usr/share/nginx/html/log/ directory, thus failing with this warning. And we don't know the root cause of this problem, because the original error is lost.

So, first of all, fix the directory permissions so it's writable. Then test again, and let us know what error message appears in the error log.

Share this post


Link to post
Share on other sites
  • 0

Thank you datakick, you are right, my first issue was a permission question, now it’s solved.
My second issue still is not solved, the search page work fine but after that if we select on product to open there product page we get that page http://192.168.1.1/coffee-and-tea/Coffee/coffee-beans with  “500 Internal Server Error”.
Any help will be appreciate  


My last configuration:

***
ELASTICSEARCH INSTALLATION (WHERE IS THE BUG???)
***

I - TB SERVER
- Centos 7.6
- Nginx 1.12.2 (also happen with httpd)
- PHP 7.2 (also happen with PHP 7.1)
- Download the module at https://store.thirtybees.com/shop-modules/front-office/elastic-search-module

***
- Made the changes describe at https://github.com/thirtybees/elasticsearch/compare/1.0.0...master in the followings files:
          - elasticsearch.php 
          - views/templates/hook/vue/main-search.html.tpl
          - views/templates/hook/vue/results.html.tpl
          - views/templates/themes/panda/hook/vue/main-search.html.tpl
          - views/templates/themes/transformer/hook/vue/main-search.html.tpl
          - views/templates/themes/warehouse/hook/vue/main-search.html.tpl
          - views/templates/themes/warehouse/hook/vue/results.html.tpl

***
-Made the change at modules/elasticsearch/elasticsearch.php to solve PHP 7.2 compatibility:
1191 # $xscheme = '([a-zA-Z][a-zA-Z\d+-.]*)';
            $xscheme = '([a-zA-Z][a-zA-Z\d+\-.]*)';
1199 # $xhostName = '([a-zA-Z\d-.%]+)';
            $xhostName = '([a-zA-Z\d\-.%]+)';

 

***
PHP – ELASTICSEARCH - (I'M NOT SURE IF IT’S ALRIGHT)
$ vim /usr/share/nginx/html/composer.json
Add: "elasticsearch/elasticsearch": "~5.6.10"
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install

***

II – ELASTICSEARCH SERVER
Java
$ sudo yum install java-1.8.0-openjdk -y
(Next I will try put here the nginx)

***
Elasticsearch
$ cd /tmp
$ curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.10.rpm
$ sudo rpm -i elasticsearch-5.6.10.rpm
$ sudo systemctl daemon-reload
$ sudo systemctl enable elasticsearch.service
$ sudo systemctl start elasticsearch.service
$ sudo systemctl status elasticsearch.service
$ curl localhost:9200

*** 
III – TB BO
BO/Modules and Services/Block Layered Navigation/Configure/Disable
BO/Modules and Services/Block Search/Configure/Disable
BO / Preferences / Search => Ajax Search: No / Instant Search: No / Search within word: No / Search exact end match: No / Minimum word length (in characters): 3 /Blacklisted words:

*** 

And now the search work fine but when we click in a product, we have the information “500 Internal Server Error”.
Any ideas how solve the issue? 
 

Edited by pessoal2004

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×