【问题标题】:error on command "gsutil notification watchbucket... "命令“gsutil notification watchbucket ...”错误
【发布时间】:2018-03-08 18:14:02
【问题描述】:

我正在尝试设置对象更改通知。我正在尝试在命令下运行: gsutil notification watchbucket https://<project_id>.appspot.com/ gs://bucket_name 并出现错误:

ServiceException: 401 Unauthorized WebHook callback channel: https://<project_id>.appspot.com

我已创建服务帐户并授予所有权限:

gsutil acl ch -u <project_id>@appspot.gserviceaccount.com:FC gs://bucket_name

已成功验证该域为网站管理员上的 url 的所有者。但仍然遇到同样的问题。 在 StackOverflow 上看到过类似的问题,但找不到答案。有人可以帮忙吗?

【问题讨论】:

    标签: python-3.x google-app-engine google-cloud-platform


    【解决方案1】:

    您似乎没有正确验证域。您可能犯了几个简单的错误:

    1. 您可能验证的是 http://project.appspot.com 而不是 https://project.appspot.com。您可以在search console 上检查并修复此问题。

    2. 您可能使用自己的 Google 帐户验证了域,但随后尝试通过其他帐户(例如服务帐户)使用 gsutil。这在 GCE 实例上特别容易,因为默认凭据将是实例的服务帐户。我建议在 cloud shell 中运行 gsutil,因为这会使用您的真实凭据。

    【讨论】:

    • 我已经使用 https://... 我可以看到它已更正添加到域中。
    • 仅使用 Cloud shell 运行 gsutil 。 :(不确定,我还想念什么:(
    猜你喜欢
    • 2018-06-01
    • 2018-06-01
    • 2021-01-17
    • 1970-01-01
    • 2014-08-06
    • 2021-03-22
    • 2017-04-13
    • 2020-11-03
    • 2017-11-10
    相关资源
    最近更新 更多