Git Product home page Git Product logo

Comments (7)

jeskew avatar jeskew commented on July 27, 2024

Do you get the same error if you send calls other than index to the client?

from amazon-es-php.

toddcoulson avatar toddcoulson commented on July 27, 2024

Do you have an example. I found this code on elasticsearch-php and inserted it and it seemed to work:

$params = array();
$params = [
    'index' => 'test',
    'type' => 'test',
    'id' => 1,
    'client' => [
        'future' => 'lazy'
    ]
];
$future = $client->get($params);

Also, why would index not work, could it possibly be an issue with elasticsearch? Sorry in advance for any newb questions, this is my first foray into elasticsearch and aws. I am also in the process of setting up my domain again. The above code seemed to work without a domain set up on aws (which is weird). I would expect your part of it to fail whenever credentials do not work. Anyway, that domain should be set up soon, so I can test again then.
EDIT: ok, I got a domain now. Tested both index and search calls off $client and both give a 500 error. I went back to that future = lazy code and it worked. I am still not sure what code from elasticsearch-php relies on the credentials and why I keep getting 500 error. It's also hard to get any results back telling me what part of my code may be wrong.

from amazon-es-php.

toddcoulson avatar toddcoulson commented on July 27, 2024

I just ran the following calls in the terminal to make sure I can read and write to my aws account and it works:
Last login: Mon Sep 11 11:15:16 on ttys004

$ curl -XPUT https://search-arc-bis-XXX.us-west-2.es.amazonaws.com/movies/movie/1 -d '{"director": "Burton, Tim", "genre": ["Comedy","Sci-Fi"], "year": 1996, "actor": ["Jack Nicholson","Pierce Brosnan","Sarah Jessica Parker"], "title": "Mars Attacks!"}'
{"_index":"movies","_type":"movie","_id":"1","_version":1,"result":"created","_shTTTodToToddsToTodTodToToToToTTTTTTTTTT
$ curl -XGET 'search-arc-bis-XXX.us-west-2.es.amazonaws.com/ms/_search?q=mars'
{"took":19,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0}

from amazon-es-php.

jeskew avatar jeskew commented on July 27, 2024

If sending an unsigned request with curl succeeds, are you able to send a request successfully after removing the signing handler altogether? If so, then the error is likely in this library; if not, then the error could be in elasticsearch-php or in the Elasticsearch cluster.

Also, do you have any more debugging information about the 500 error encountered? Is the service returning any kind of message?

from amazon-es-php.

toddcoulson avatar toddcoulson commented on July 27, 2024

I attached what is coming back in the header for the 500 error. I need more clarification of "removing the signing handler altogether"? Does that mean taking out the .aws file? Because that is how I am getting authentication at the moment.

screen shot 2017-09-12 at 9 02 34 am
EDIT: is the curl just an api for CRUD? Doesn't seem like it has to do with credentials at all. I just ran a delete call and it worked, after I moved the .aws credentials. My .aws is similar to this:

[default]
aws_access_key_id = AKIAXXXXXXXUQ
aws_secret_access_key = I8EqGJ7dDu6fXXXXXX/kB
[bis]
aws_access_key_id = AKIAXXXXXXXUQ
aws_secret_access_key = I8EqGJ7dDu6fXXXXXX/kB

both are the same account. Do you have a recommended way of getting credentials with your tool?

from amazon-es-php.

jeskew avatar jeskew commented on July 27, 2024

Ah, didn't realize the 500 was coming from your application and not from your elasricsearch service endpoint. Could you take a look at your server logs to find more informations on the error response you're receiving from the elasticsearch endpoint? The original HTTP status code and error message would go a long way to solving the issue.

By "removing the signing handler altogether, I meant to comment out the call to setHandler on the ClientBuilder instance. curl is a library for sending HTTP requests that (as far as I know) does not perform any AWS SigV4 signing. The fact that you can successfully curl on the elasticsearch endpoint indicates that it is not using IAM authentication, so it would be helpful to see if you encounter any issues when using elasticsearch-php's default HTTP handler.

from amazon-es-php.

toddcoulson avatar toddcoulson commented on July 27, 2024

I cannot get any logs from nginx. I am also running this inside a docker container. I looked in a few places where the logs might be, but keeps telling me

tail: unrecognized file system type 0x794c7630... please report this to [email protected]. reverting to polling

Also commenting out setHandler does not give a 500 error, it just hangs not fully loading the page - Gateway Timeout. TIA for all your help.

from amazon-es-php.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.