python-3.x - 知府服务器 : No Tenant Found

标签 python-3.x prefect

我正在尝试启动 Prefect 代理,以完成与 Prefect 服务器的设置。我没有使用 prefect server start 进行开箱即用的设置,而是使用 prefect server config 生成 Docker Compose 文件,然后使用 docker compose up 启动服务器的服务。当我尝试启动代理时,出现以下错误:

prefect.utilities.exceptions.ClientError:
[{'message': 'No tenant found.', 
  'locations': [{'line': 2, 'column': 5}], 
  'path': ['register_agent'], 
  'extensions': {
    'code': 'INTERNAL_SERVER_ERROR', 
    'exception': {'message': 'No tenant found.'}
  }
}]

我该如何解决这个问题?

最佳答案

使用 Prefect CLI:prefect backend server,然后 prefect server create-tenant -n default

使用 Prefect Server GraphQL API,如 Prefect source code 中所做的那样:

tenant_info = self.graphql(
            {
                "mutation($input: create_tenant_input!)": {
                    "create_tenant(input: $input)": {"id"}
                }
            },
            variables=dict(input=dict(name=name, slug=slug)),
        )

关于python-3.x - 知府服务器 : No Tenant Found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67060826/

相关文章:

python - ImportError - 在 CircleCI 上测试失败但在本地通过

python-3.x - 在 Prefect 中,可以在流程运行期间缓存任务值吗?

docker - 如何在 Prefect 流程中使用自定义 Docker 存储?

docker - `docker run` 作为级长任务

python - 从嵌套子列表返回八元组模式

python - 在Python中生成具有不同属性的新对象实例

python - 捕获和重新抛出异常的替代方法

python - 如何将我的 Google Blogger 文件导入 Pelican 而不会出现错误?

python - 完善如何避免重新运行任务