Storing data (images) on google cloud storage from app engine Java

54 views
Skip to first unread message

Baqir Rizvi

unread,
Mar 6, 2019, 12:19:45 AM3/6/19
to Google App Engine

I have an app engine application that store users demographic information along with their pictures. Demographic information like name, address etc is going to store on google cloud datastore. On daily basis I capture new user images. I want to store images on google cloud storage and want to store only image URL (bucket_name->image_name) of cloud storage, on datastore.

Also I want to load these images from my client application. Is it possible? Can we use firebase storage for the same purpose? which is better option with proper security consideration.?

I followed the below tutorial:


but just after putting   compile 'com.google.appengine.tools:appengine-gcs-client:0.8',
I am successfully able to deploy on app engine but none of my APIs are working. Whenever I call any endpoint it gives me below exception in app engine log viewer:

com.google.apphosting.runtime.jetty9.JettyLogger warn: /_ah/api/deliveryexecutive/v1/token (JettyLogger.java:29) java.lang.NullPointerException at com.google.api.server.spi.EndpointsServlet.service(EndpointsServlet.java:71) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772) at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:48) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at com.google.apphosting.runtime.jetty9.ParseBlobUploadHandler.handle(ParseBlobUploadHandler.java:119) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1182) at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doHandle(AppEngineWebAppContext.java:183) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:296) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:539) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) at com.google.apphosting.runtime.jetty9.RpcConnection.handle(RpcConnection.java:202) at com.google.apphosting.runtime.jetty9.RpcConnector.serviceRequest(RpcConnector.java:81) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:695) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:658) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:628) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:820) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:269) at java.lang.Thread.run(Thread.java:748)

compile 'com.google.appengine.tools:appengine-gcs-client:0.8'
compile 'com.google.appengine.tools:appengine-gcs-client:0.8'

Rajesh Gupta

unread,
Mar 11, 2019, 1:41:13 AM3/11/19
to google-a...@googlegroups.com
Using Firebase storage is a good idea.  I have used it recently in my own SaaS, and it worked out well.  There are ample security rules for firestore and firebase storage.



--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/c0cdbea2-e82f-42fc-8dc7-4f83e599ee25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Rajesh
Field Service Software on Google Cloud Platform and Mobile


Julie (cloud platform support)

unread,
Apr 4, 2019, 11:20:28 AM4/4/19
to Google App Engine
Sounds like your use case should work and you should be able to upload your files. You can use Cloud Storage on Firebase without significant change to your use case it seems. I don't believe either option would provide better security, either seems like it should work. This issue looks like it may require exchange of sensitive information like your project ID for more visibility so if you are still experiencing the issue please create an issue tracker and refer to this groups issue. 


Reply all
Reply to author
Forward
0 new messages