[英]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.