InvocationTargetException storing files with appen

2019-05-21 11:45发布

I'm using appengine-gcs-client-0.5 and seeing InvocationTargetExceptions in my dev_appserver when calling GcsService.createOrReplace and GcsOutputChannel.close.

It seems like the call to storeBlob does not have the appropriate permission, as the appserver gets an AccessControlException in com.google.appengine.api.blobstore.dev.FileBlobStorage.storeBlob:

java.security.AccessControlException: access denied ("java.io.FilePermission" "/tmp/1440435923000-0/encoded_gs_key:<some key>" "write")

What do I need to do to get this working?

2条回答
ゆ 、 Hurt°
2楼-- · 2019-05-21 12:01

Starting with AE 1.9.27 (which is now available) there is no longer a need for the jvm_flag (it should just work).

查看更多
迷人小祖宗
3楼-- · 2019-05-21 12:13

appengine-gcs-client-0.5 removed a dependency on the deprecated Files API, but the SDK does not yet acquire the necessary permissions to store files the BlobStorage service. As a workaround until the next SDK version is released, you can pass a flag to configure a memory-backed store for the Blobstore service like so:

dev_appserver.sh --jvm_flag=-Dblobstore.no_storage=true

This is only necessary for the dev_appserver - production applications will not have this problem.

查看更多
登录 后发表回答