Skip to content

can't access elasticsearch over squid #357

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

Closed
pigletfly opened this issue Feb 16, 2016 · 4 comments
Closed

can't access elasticsearch over squid #357

pigletfly opened this issue Feb 16, 2016 · 4 comments

Comments

@pigletfly
Copy link

I am using elasticsearch-py to access elasticsearch over squid,and got a error message as below

Some possible problems are:
Missing or unknown request method.
Missing URL.
Missing HTTP Identifier (HTTP/1.0).
Request is too large.
Content-Length missing for POST or PUT requests.
Illegal character in hostname; underscores are not allowed.
HTTP/1.1 Expect: feature is being asked from an HTTP/1.0 software.

but I can access the same elasticsearch cluster via curl or browser.
Some info may help.
squid/3.5.6
elasticsearch-py 2.1.0

@pigletfly pigletfly changed the title access elasticsearch over squid can'taccess elasticsearch over squid Feb 16, 2016
@pigletfly pigletfly changed the title can'taccess elasticsearch over squid can't access elasticsearch over squid Feb 16, 2016
@honzakral
Copy link
Contributor

This means that squid is not configured properly and is not supporting all the features that we need, or you are using it in an unsupported way. Can you share what you are trying to do and why? Thanks

@pigletfly
Copy link
Author

If squid is not configured properly, I shouldn't access es via browser.We use squid to control access to IDC from office,and I add a rule to allow access to es via specific host and port,it works for browser,and I tried to use requests to query data from es, it works too.But not for elasticsearch-py.

@honzakral
Copy link
Contributor

You can use requests in elasticsearch-py, but it just looks like the squid instance is configured to be too strict. To use requests, just install it and then do:

from elasticsearch import Elasticsearch, RequestsHttpConnection
es = Elasticsearch(connection_class=RequestsHtpConnection)

Either way this is an issue with squid - if you want to use it as proxy you need to make sure it has the same requirements and behavior as elasticsearch. Closing this issue since it's not really elasticsearch related.

@dizzydis
Copy link

I know this is already closed, however is there anymore information that I could get on this? I'm having similar issues, however for me Logstash is what's failing with the same squid error message, therefore I don't have any way to change the request (that I'm aware of).

What info do I need to be able to get appropriate squid settings changed? Assuming that I can even get them changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants