简体   繁体   English

当 MLFlow 尝试访问存储在 S3 上的人工制品时,获取“(InvalidToken)调用 ListObjectsV2 操作时”

[英]Getting "(InvalidToken) when calling the ListObjectsV2 operation" when MLFlow is trying to access the artefacts stored on S3

I am trying to start the MLFlow server on my local machine inside a python virtual environment using the following command:我正在尝试使用以下命令在 python 虚拟环境中的本地计算机上启动 MLFlow 服务器:

mlflow server --backend-store-uri postgresql://mlflow_user:mlflow@localhost/mlflow  --artifacts-destination S3://<S3 bucket name>/mlflow/ --serve-artifacts  -h 0.0.0.0 -p 8000

I have exported the following environment variables inside the activated python venv :我在激活的 python venv中导出了以下环境变量:

export AWS_ACCESS_KEY_ID=<access key>
export AWS_SECRET_ACCESS_KEY=<secret key>
export DEFAULT_REGION_NAME=<region name>
export DEFAULT_OUTPUT_FORMAT=<output format>

MLFlow gives the following error while accessing the model artefacts for all the runs: MLFlow 在访问所有运行的 model 工件时出现以下错误:

botocore.exceptions.ClientError: An error occurred (InvalidToken) when calling the ListObjectsV2 operation: The provided token is malformed or otherwise invalid.

Any workaround for this?有什么解决方法吗?

According to the Environment Variables section in the Boto3 official documentation, setting AWS_SESSION_TOKEN was also necessary.根据 Boto3 官方文档中的环境变量部分,设置AWS_SESSION_TOKEN也是必要的。

With reference to this answer added by Stack Overflow user @Francis Lewis, I just reset the AWS access token inside the activated python environment as follows:参考 Stack Overflow 用户@Francis Lewis 添加的这个答案,我只是在激活的 python 环境中重置了 AWS 访问令牌,如下所示:

export AWS_SESSION_TOKEN=""

And the problem was solved.问题就解决了。 Thanks to @Francis Lewis!感谢@Francis Lewis!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 S3 存储桶的 ListObjectsV2 操作的访问被拒绝 - AccessDenied for ListObjectsV2 operation for S3 bucket 使用批处理作业时“调用 ListObjectsV2 操作时发生错误 (AccessDenied):访问被拒绝” - "An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied" when using batch jobs php 页面中的 aws s3 listobjectsv2 - aws s3 listobjectsv2 in php page 跳过 Amazon S3 ListObjectsV2 中的前“n”个键 - Skip first "n" keys in Amazon S3 ListObjectsV2 `调用 ListBuckets 操作时发生错误(InvalidToken):提供的令牌格式不正确或无效。`w/`aws s3 ls` - `An error occurred (InvalidToken) when calling the ListBuckets operation: The provided token is malformed or otherwise invalid.` w/`aws s3 ls` S3 ListObjectsV2 能否返回从最新到最旧排序的键? - Can S3 ListObjectsV2 return the keys sorted newest to oldest? AWS boto3 - 调用 GetObject 操作时出现 InvalidToken 错误 - AWS boto3 - InvalidToken Error when calling the GetObject operation aws-sdk S3:使用 listObjectsV2 列出所有键的最佳方式 - aws-sdk S3: best way to list all keys with listObjectsV2 aws S3 ListObjectsV2 api 中的 start-after 是什么意思? - What does start-after in aws S3 ListObjectsV2 api mean? AWS S3 Boto3 Python - 调用 DeleteObject 操作时发生错误 (AccessDenied):拒绝访问 - AWS S3 Boto3 Python - An error occurred (AccessDenied) when calling the DeleteObject operation: Access Denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM