-
Notifications
You must be signed in to change notification settings - Fork 14
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
Error Creating Index Template in AWS OpenSearch Test Environment #287
Comments
I have no AWS OpenSearch Instance to play around. But you could log the exact HTTP request ElasticsearchEvolution is executing and the one you do by postman. I'm quite sure there is a mismatch with the HTTP Headers or something like that. But you should add more information:
|
Hey, @xtermi2, authentication with BasicAuth. Yes OpenSearch on AWS has version 2.7.0. During running tests with connection to the AWS OpenSearch I'm getting the same response as in the TEST env. 400 Bad Request. This is really strange, cuz I can execute those calls with the postman, as I described above. Any other ideas? |
Hey @kadol92: Does each *.http file contain exactly one request or do you have multiple requests per file? |
... and you are sure that your integration of Elasticsearch Evolution into Flyway does not modify or replace the request files at all? Therefor I agree @xtermi2, that you log the effective Elasticsearch queries which are going to the cluster. |
*.http file contains one request per file
I've logged the details of the request, and they appear identical. I can't spot any differences. I conducted a quick test in the MigrationServiceImpl, where I switched the client to a restTemplate client and was able to successfully execute the call, just like in Postman. Here is the change that I made:
|
Btw, here is how I setup and run this migration:
This is a little modified from the initial version that I started. I added custom HttpHost creation and SSLContext, cuz I wasn't sure why it's failing, so I played around a little. |
@kadol92: Doesn't your response contain any response body? For me, the http files look like this:
And in Opensearch Dashboards I need to remove the Content-Type section. But it tells me that I did something wrong in the response body. |
@RiVogel the only response body that I get is:
Nothing more |
When you have a look into your history index - is that one created? Or are there also problems? I ask because I needed to sign every request which is going to AWS OpenSearch, but I do not use basic authentication but other authentication mechanisms. |
Hey @RiVogel, yes, the history index has been created properly; the problem occurs when it tries to create the template for the first index. Currently, I've used the RestTemplate client along with Apache's client5, and this works. The downside of this solution is that I had to modify the library because it doesn't support RestTemplate. Ideally, it would be best to use this library without any modifications, but for now, this is a workaround.
|
Hello,
During the deployment of our application in the AWS OpenSearch test environment, I encountered an issue with creating an index template using our migration script. Local testing using Docker containers (image opensearchproject/opensearch:2.7.0) was successful. However, when attempting the same in the AWS environment, I receive a 400 error when trying to create the template.
Here are the details of the error from the logs:
I can create the same template manually using Postman, which indicates that the issue may not be related to the configuration of our OpenSearch client, as we were able to create the migration index successfully. Could you assist in diagnosing why the migration scripts work locally but not in the AWS environment?
Thank you for your help.
The text was updated successfully, but these errors were encountered: