Open BA88 opened 7 years ago
It's possible that Searchyll isn't (yet) compatible with Elasticsearch 5.x. I would be interested to see a traffic capture between Jekyll and Elasticsearch. You could use socat
for that:
brew install socat
url: http://localhost:9400
in _config.yml
sudo socat -v TCP-LISTEN:9400,fork TCP:localhost:9200 &> data.log
jekyll build
cat data.log
In this case, socat
will bind to port 9400 and it will take whatever traffic is sent to this port and pass it along to localhost:9200, then relay the response. As far as Jekyll knows, it's talking directly to Elasticsearch, but socat is a middleman logging everything that passes through it to data.log
. There may be some interesting information in there that explains what's happening.
I'll give this a try! Thanks for providing clear step-by-step instructions and an explanation.
Soon,
On Mon, Sep 18, 2017 at 5:46 PM, Rob notifications@github.com wrote:
It's possible that Searchyll isn't (yet) compatible with Elasticsearch 5.x. I would be interested to see a traffic capture between Jekyll and Elasticsearch. You could use socat for that:
- brew install socat
- Set url: http://localhost:9400 in _config.yml
- Run sudo socat -v TCP-LISTEN:9400,fork TCP:localhost:9200 &> data.log
- In another terminal window, re-run jekyll build
- Inspect the data.log file: cat data.log
In this case, socat will bind to port 9400 and it will take whatever traffic is sent to this port and pass it along to localhost:9200, then relay the response. As far as Jekyll knows, it's talking directly to Elasticsearch, but socat is a middleman logging everything that passes through it to data.log. There may be some interesting information in there that explains what's happening.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omc/searchyll/issues/25#issuecomment-330377389, or mute the thread https://github.com/notifications/unsubscribe-auth/AL-Mbp8w1MzMG9xEmKnWDypBIBFC4E3Yks5sjvLGgaJpZM4PbmRi .
I am attaching two (2) files here.
File data.txt
is from running the five steps outlined above.
File data2.txt
is from running a successful PUT
. I ran these curl
commands:
curl -XGET localhost:9400/_search?pretty
curl -XGET 'http://localhost:9400/_cat/health?v'
curl -X PUT 'localhost:9400/library/books/1?pretty' -H 'Content-Type: application/json' -d'
{
"title" : "A fly on the wall",
"name" : {
"first": "Drosophila",
"last" : "Melanogaster"
},
"publish_date" : "2015-06-21T23:39:40-0400",
"price" : 19.95
}
'
curl -XGET localhost:9400/_search?pretty
curl -XDELETE localhost:9400/library
curl -XGET localhost:9400/_search?pretty
@BA88 can you paste those .txt files in a Github gist and share a link? Thanks!
data.txt: https://gist.github.com/BA88/d7bd52688328c99c9c81f19089a547b4 data2.txt: https://gist.github.com/BA88/ece564bb9859c75c9761003dcee3303a
I've never created gists before. Please let me know if these links don't work. Or if you need something else.
Thanks!
Hi all. Do you think I should downgrade Elasticsearch 5.x if that is the issue with searchyll? If so, is there a version of Elasticsearch that you recommend?
I've looked around the searchyll code a bit. I don't know enough to determine where the problem is.
I have a professional goal of adding search ability to our GitHub Pages wiki. If there is something I can / should do, I'll do it! I hope to help however I can.
Thank you!
Hey there,
We just pushed a change to authentication settings. Not sure if that's the root cause, but I do see auth exceptions in the logs. Want to pull the latest changes and test again?
I incorporated the changes you made. I worked around a few errors until I got stuck again. I think I'm running different versions of things such that I encounter problems.
Problem 1 + Resolution:
in lib/searchyll/indexer.rb:
removed all [double quotes] from definition of update_aliases.body
:
162,165c162,165
< actions: [
< { remove: { index: old_indices.join(','), alias: configuration.elasticsearch_index_base_name }},
< { add: { index: elasticsearch_index_name, alias: configuration.elasticsearch_index_base_name }}
< ]
---
> "actions": [
> { "remove": { "index": old_indices.join(','), "alias": configuration.elasticsearch_index_base_name }},
> { "add": { "index": elasticsearch_index_name, "alias": configuration.elasticsearch_index_base_name }}
> ]
Problem 2 + Resolution:
undefined method present?
:
Fix -- added to lib/searchyll/indexer.rb
:
require 'active_support/all'
Error:
$ jekyll build --trace
WARN: Unresolved specs during Gem::Specification.reset:
rb-fsevent (>= 0.9.4, ~> 0.9)
rb-inotify (>= 0.9.7, ~> 0.9)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /Users/bfo7328/Documents/hca/project/wiki/_config.yml
1. begin searchyll.rb
Source: /Users/bfo7328/Documents/hca/project/wiki
Destination: /Users/bfo7328/Documents/hca/project/wiki/_site
Incremental build: disabled. Enable with --incremental
Generating...
2. begin Jekyll::Hooks.register :site, :pre_render
/Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll/indexer.rb:104:in `http_request': undefined method `present?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll/indexer.rb:83:in `http_put'
from /Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll/indexer.rb:52:in `prepare_index'
from /Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll/indexer.rb:70:in `start'
from /Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll.rb:17:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/hooks.rb:98:in `call'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/hooks.rb:98:in `block in trigger'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/hooks.rb:97:in `each'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/hooks.rb:97:in `trigger'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/site.rb:188:in `render'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/site.rb:69:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/command.rb:26:in `process_site'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/commands/build.rb:63:in `build'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/commands/build.rb:34:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/lib/jekyll/commands/build.rb:16:in `block (2 levels) in init_with_program'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `call'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /Users/bfo7328/.gem/ruby/2.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.5/exe/jekyll:13:in `<top (required)>'
from /Users/bfo7328/bin/jekyll:23:in `load'
from /Users/bfo7328/bin/jekyll:23:in `<main>'
Problem 3 -- no resolution:
Error:
indexer.rb:138: stack level too deep
NB: I added debug puts
statements to lib/searchyll/indexer.rb
to help me ...
$ jekyll build --trace
WARN: Unresolved specs during Gem::Specification.reset:
rb-fsevent (>= 0.9.4, ~> 0.9)
rb-inotify (>= 0.9.7, ~> 0.9)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /Users/bfo7328/Documents/hca/project/wiki/_config.yml
1. begin searchyll.rb
Source: /Users/bfo7328/Documents/hca/project/wiki
Destination: /Users/bfo7328/Documents/hca/project/wiki/_site
Incremental build: disabled. Enable with --incremental
Generating...
2. begin Jekyll::Hooks.register :site, :pre_render
5. begin Jekyll::Hooks.register :documents, :post_render
indexing document /general/index.html
5a. document.id /general/index
5. begin Jekyll::Hooks.register :documents, :post_render
indexing document /general/setup_elasticsearch.html
5a. document.id /general/setup_elasticsearch
4. begin Jekyll::Hooks.register :pages, :post_render
indexing page /404.html
4a. page.name 404.html
4b. page.url /404.html
4. begin Jekyll::Hooks.register :pages, :post_render
indexing page /atom.xml
4a. page.name atom.xml
4b. page.url /atom.xml
4. begin Jekyll::Hooks.register :pages, :post_render
indexing page /
4a. page.name index.html
4b. page.url /
4. begin Jekyll::Hooks.register :pages, :post_render
indexing page /feed.xml
4a. page.name feed.xml
4b. page.url /feed.xml
3. begin Jekyll::Hooks.register :site, :post_render
/Library/Ruby/Gems/2.0.0/gems/searchyll-0.10.0/lib/searchyll/indexer.rb:138: stack level too deep (SystemStackError)
While the above is running, my elasticsearch
process does not "see" any of these pages.
What additional information can I provide?
I am trying to use
searchyll
to add ElasticSearch (ES) capabilities to my Git-Page website. My Git-Pages site is made up of "pages" not "posts". So I wonder if that's the root of the issue? (Also, I usecollections
in my_config.yml
file.)I've gotten as far as trying to add documents to my ES database via
jekyll build
. I don't see that my pages are added.Below I have included details of what I've done, but an overview is:
Updated my
_config.yml
: a. Addedsearchyll
gem. b. Addedelasticsearch
Updated my `_layouts/page.html' to include
Run
elasticsearch
locally (for now)Run
jekyll build
a. I can see theindexing document
puts
output. b. I added some additionalputs
tosearchyll.rb
just in case. All seems okay.In my
elasticsearch
, I do not see any new messages a. I expected a message as each document is indexed into the ES database but nopeGET _search
returns nothing a. Not surprisingTo test my ES: a. I manually
PUT
b. I saw a message in myelasticsearch
output c. I manuallyGET
My environment:
Details: