I'm using my App Engine to allow an app to upload a file.
The file is received in HTTP POST, and I'm trying to store it in Google
Storage.
My Server code;
GcsFileOptions instance = GcsFileOptions.getDefaultInstance();
GcsFilename fileName = new GcsFilename("mate-server-2017", directory + "/" +
filename);
GcsOutputChannel outputChannel;
log.info("Saving " + fileName + " to " + instance);
outputChannel = gcsService.createOrReplace(fileName, instance);
copy(req.getInputStream(), Channels.newOutputStream(outputChannel));
The Log entry in the middle yields;
com.mate.server.MateServlet: Saving GcsFilename(mate-server-2017,
425020376158645/1497796971438) to GcsFileOptions [userMetadata={}]
This results in exception;
com.google.appengine.tools.cloudstorage.RetriesExhaustedException:
RetryHelper(5.644 s, 10 attempts,
com.google.appengine.tools.cloudstorage.GcsServiceImpl$1@1af95fcc): Too many
failures, giving up
at
com.google.appengine.tools.cloudstorage.RetryHelper.doRetry(RetryHelper.java:127)
at
com.google.appengine.tools.cloudstorage.RetryHelper.runWithRetries(RetryHelper.java:166)
at
com.google.appengine.tools.cloudstorage.RetryHelper.runWithRetries(RetryHelper.java:156)
at
com.google.appengine.tools.cloudstorage.GcsServiceImpl.createOrReplace(GcsServiceImpl.java:70)
at com.mate.server.MateServlet.saveFile(MateServlet.java:128)
at com.mate.server.MateServlet.doPost(MateServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
... <Cut by submitter>
Caused by: java.io.IOException: java.lang.NullPointerException
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService$BlobStorageAdapter.getInstance(LocalRawGcsService.java:186)
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService$BlobStorageAdapter.access$000(LocalRawGcsService.java:109)
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService.ensureInitialized(LocalRawGcsService.java:194)
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService.beginObjectCreation(LocalRawGcsService.java:249)
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService.beginObjectCreation(LocalRawGcsService.java:92)
at
com.google.appengine.tools.cloudstorage.GcsServiceImpl$1.call(GcsServiceImpl.java:74)
at
com.google.appengine.tools.cloudstorage.GcsServiceImpl$1.call(GcsServiceImpl.java:70)
at
com.google.appengine.tools.cloudstorage.RetryHelper.doRetry(RetryHelper.java:108)
... 34 more
Caused by: java.lang.NullPointerException
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService$BlobStorageAdapter.<init>(LocalRawGcsService.java:123)
at
com.google.appengine.tools.cloudstorage.dev.LocalRawGcsService$BlobStorageAdapter.getInstance(LocalRawGcsService.java:184)
... 41 more
--
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 [email protected].
To post to this group, send email to [email protected].
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/89a16236-848f-44be-8ecc-3ab1c92655d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.