Google app engine 获取403错误,但正在部署版本,流量为0%

Google app engine 获取403错误,但正在部署版本,流量为0%,google-app-engine,google-cloud-platform,bitbucket,bitbucket-pipelines,Google App Engine,Google Cloud Platform,Bitbucket,Bitbucket Pipelines,我正在使用maven插件1.9.60和JDK 8 运行命令 mvn安装appengine:update-Dappengine.additionalParams=“--service\u account\u json\u key\u file=client secret.json” 我可以看到部署的版本,但流量为0%。日志显示错误如下。有人能建议如何解决这个问题吗 Beginning interaction for module default... 0% Created staging dire

我正在使用maven插件1.9.60和JDK 8

运行命令

mvn安装appengine:update-Dappengine.additionalParams=“--service\u account\u json\u key\u file=client secret.json”

我可以看到部署的版本,但流量为0%。日志显示错误如下。有人能建议如何解决这个问题吗

Beginning interaction for module default...
0% Created staging directory at: '/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp'
5% Scanning for jsp files.
8% Generated git repository information file.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 34 application files.
40% Uploading 2 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Sending batch containing 2 file(s) totaling 1KB.
73% Initializing precompilation...
90% Deploying new version.
95% Closing update: new version is ready to start serving.
98% Uploading index definitions.
Feb. 19, 2018 12:54:48 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #0
Feb. 19, 2018 12:54:48 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #1
Feb. 19, 2018 12:54:49 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #2
Feb. 19, 2018 12:54:49 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
This is try #3

Error Details:
2018-02-19 00:54:17.700:INFO::main: Logging initialized @409ms
2018-02-19 00:54:17.816:INFO:oejs.Server:main: jetty-9.3.18.v20170406
2018-02-19 00:54:19.481:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=1228ms
2018-02-19 00:54:19.497:INFO:oejq.QuickStartDescriptorGenerator:main: Quickstart generating
2018-02-19 00:54:19.512:INFO:oejsh.ContextHandler:main: Started o.e.j.q.QuickStartWebApp@2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp/,AVAILABLE}
2018-02-19 00:54:19.514:INFO:oejs.Server:main: Started @2231ms
2018-02-19 00:54:19.517:INFO:oejsh.ContextHandler:main: Stopped o.e.j.q.QuickStartWebApp@2aceadd4{/,file:///private/var/folders/ny/z92xw4ps0j71v43mnvjzjyd80000gn/T/appcfg7082099622802800350.tmp/,UNAVAILABLE}


com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').

Unable to update app: Error posting to URL: https://appengine.google.com/api/datastore/index/add?app_id=clean-aleph-191303&version=beta-001&
403 Forbidden
You do not have permission to modify this app (app_id=u'f~clean-aleph-191303').
appengine-web.xml ```



您遇到的问题是由于服务帐户上缺少角色造成的。它可能分配了“应用引擎部署器”角色,但缺少“数据存储索引管理员”角色,这导致在发布到appengine.google.com/api/Datastore/Index时出现403s/

添加该角色后,您需要重新生成私钥(您将其命名为client-secret.json),因为旧的私钥没有新的权限

有关部署GAE应用程序所需角色的更多信息,请参见第节


注:感谢您提供完整的复制。它总是很有用。

现在,由于您的代码中既没有index.yaml,也没有datastore-indexes.yaml,我无法解释与数据存储相关的角色的需要。我将尝试对此进行更深入的研究。我没有编写任何访问数据存储API的代码。我将尝试按照您的建议添加数据存储索引管理员角色。我添加了数据存储索引管理员角色,重新生成了密钥文件,它成功了。谢谢你的帮助。
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>clean-aleph-191303</application>
  <version>beta-001</version>
  <threadsafe>true</threadsafe>
  <runtime>java8</runtime>
</appengine-web-app>
<plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>1.9.60</version>
</plugin>