Comments (10)
Tanks for reporting this issue.
Yes, the path should be prefixed with /
.
Can you please tell what you client looks like? Are you using AWS Signing or something like that, as I can not reproduce it with our integration tests and I want to adjust them so it does not happen again.
from opensearch-go.
Tanks for reporting this issue. Yes, the path should be prefixed with
/
.Can you please tell what you client looks like? Are you using AWS Signing or something like that, as I can not reproduce it with our integration tests and I want to adjust them so it does not happen again.
Thanks for the fast response. I tried it out in a local test setup:
local Kubernetes clusters with kind using basic auth
return v3api.NewClient(
v3api.Config{
Client: osV3.Config{
Username: config.OS_USER,
Password: config.OS_PASSWORD,
Addresses: []string{config.OS_URL},
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
},
})
from opensearch-go.
Hm, weird. I can't seem to reproduce the issue with the integration test. I did the same requests and tried to modify the client address but it does not affect it. If I understand the URL lib correctly it should not matter if the leading slash is missing. I tried looking into this for a few hours but I don't want to dig through the net/http lib to much.
It there any chance you can find where this issue is exactly coming from so we can test it as I am not able to reproduce it.
from opensearch-go.
The error happens on the server side. are you testing against a real endpoint? When the "/" is missing the server responds with statuscode 400.
from opensearch-go.
The error happens on the server side. are you testing against a real endpoint? When the "/" is missing the server responds with statuscode 400.
I am testing against a real opensearch container. Running make cluster.build cluster.start
and make test-integ
.
It looks like you have a nginx in between your setup. Can you see how the requests looks like when it reaches the nginx by looking at the nginx logs?
I am still not getting where exactly the missing /
is causing the 400 as it is present in the URL when sending the requests. If it was missing the request would not work at all as your-opensearch.com_search
is not a valid domain.
from opensearch-go.
You are probably right with the nginx, but I have no access to it to see the logs. Will ask for access and come back to you soon.
from opensearch-go.
Maybe you can get the requests using the Logger functionality in the client?
from opensearch-go.
Thanks for the hint with the logger within the client. I tried it out and this is my result.
Result without my fix (path = "_search"):
2024-03-12T09:55:37Z POST https://myurl/_search [status:400 request:183ms]
< <html>
< <head><title>400 Bad Request</title></head>
< <body>
< <center><h1>400 Bad Request</h1></center>
< <hr><center>nginx</center>
< </body>
< </html>
Result with my fix (path = "/_search"):
2024-03-12T09:50:32Z POST https://myurl/_search [status:200 request:1.082s]
< {"took":45,"timed_out":false,"_shards":{"total":659,"successful":659,"skipped":658,"failed":0},"hits":{"total":{"value":0,"relation":"eq"},"max_score":null,"hits":[]}}
The strange thing is, that the POST call printed out by the logger looks equal!
from opensearch-go.
Hi again,
today a checked with a colleague who has more rights than me ;)
We figured out , that a direct access to the opensearch service with port 9200 works fine in both ways. In the case with a NGINX Ingress between it is only working with path = "/_search". I found also in other opensearch api function that there is a leading "/". Would be great if you could fix that :)
from opensearch-go.
@dom192 want to try to make a fix yourself? start by writing a unit test that shows the problem?
from opensearch-go.
Related Issues (20)
- [v2.12.0] Ensure CI/documentation reflect changes to default admin credentials HOT 1
- [FEATURE] BulkIndexer - ensure that subsequent requests on the same documentID are consistently sent to the same worker HOT 1
- [BUG] Invalid Sigv4 on requests without a body using AWS SDK v1 HOT 9
- [BUG] Releases require a manual navigation to the released package URL
- [FEATURE] Add an Explanation field containing the document explain details to the SearchHit struct
- [BUG] Add missing global io usage field for nodes stats
- [FEATURE] Use pooled gzip writer for request body gzip compression
- [BUG] 429 error does not follow standard error format HOT 5
- [BUG] not reporting when failed index HOT 5
- [FEATURE] ML client for pipeline setup and neural search HOT 2
- [BUG] Request context cancellation is ignored when `retryBackoff` is configured
- [BUG] Error http: ContentLength=401 with Body length 0 HOT 9
- [FEATURE] Exploring similar functionality in Go as Python classes {Object, Nested, Text, Keyword}. HOT 3
- Cleanup unused branches HOT 1
- [BUG]Unable to install because of checksum error HOT 3
- ISM Plugin `Conditions` struct is invalid
- [BUG] MappingFieldResp struct is not parsed correctly. HOT 2
- [BUG] Tests are flaky HOT 1
- Add MatchedQueries field to opensearchapi.SearchHit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opensearch-go.