gpt4 book ai didi

ElasticsearchClientException : Request failed to execute. 调用:状态码 403 来自:POST/index/

转载 作者:行者123 更新时间:2023-12-03 00:46:59 25 4
gpt4 key购买 nike

我在执行在 AWS 上下文中调用公共(public) ES 的 lambda 时遇到问题。此 lambda 由 HTTP API Gateway 事件执行。一切似乎都表明这是 lambda 试图访问 ES 的权限问题,但我的无服务器配置似乎有效:

service: my-service

provider:
name: aws
runtime: dotnetcore2.1
stage: ${opt:stage, "Development"}
region: ${opt:region, "us-east-1"}

iamRoleStatements:
- Effect: "Allow"
Action:
- "lambda:invokeFunction"
Resource: "*"
- Effect: "Allow"
Action:
- es:ESHttpPost
- es:ESHttpPut
- es:ESHTTPGet
Resource: "arn:aws:es:us-east-1:account:domain/domain-name/*"


environment:
ES_ENDPOINT: ${file(appsettings.${self:provider.stage}.json):ES_ENDPOINT}
STAGE: ${self:provider.stage}
REGION: ${self:provider.region}

apiKeys:
- myservice-api-key

package:
individually: true

functions:
myservice_api:
handler: com.myservice::com.myservice.LambdaEntryPoint::FunctionHandlerAsync
package:
artifact: bin/release/netcoreapp2.1/myservice.zip
events:
- http:
path: /{proxy+}
method: ANY
cors: true
private: true

记录我的错误如下:
Invalid NEST response built from a unsuccessful (403) low level call on POST
OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 403 from: POST /index/_search?typed_keys=true

包版本:
巢 7.4.1

最佳答案

我终于解决了这个问题。我发现的内部异常是:“The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.”。我通过将 Elasticsearch.Net.Aws 的版本从 6.0.0 更改为 7.0.4 解决了这个问题。

关于ElasticsearchClientException : Request failed to execute. 调用:状态码 403 来自:POST/index/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59442267/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com