google-app-engine - 对 API 调用 datastore_v3.Put() 的请求太大。使用 Objectify (DataStore) 而不是上传文件

标签 google-app-engine session primefaces jsf-2 google-cloud-datastore

我收到以下错误。

com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large.

我正在使用 Objectify 4.0 并且没有上传任何文件。我正在为我的应用程序使用 DataStore,但唯一超过 1Mb 的项目是 _ah_SESSION 实体中的 _values blob。

控制台的图像在: http://goo.gl/qP7v7U

我不知道如何解决这个问题,即使之前已经询问过这个错误,我的问题是我没有使用文件,我实际上正在使用数据存储。

编辑:再次测试,似乎中断了删除操作。这是日志。

W 12:37:39.798 /editarContrato.jsf
  com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large.
    at com.google.apphosting.utils.runtime.ApiProxyUtils.convertApiError(ApiProxyUtils.java:42)
    at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:497)
    at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:411)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher$1.runInContext(RpcStub.java:856)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.runCallback(RpcStub.java:894)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:904)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.success(RpcStub.java:883)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.runCallbacks(RpcClientInternalContext.java:1130)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.finishRpcAndNotifyApp(RpcClientInternalContext.java:1030)
    at com.google.net.rpc3.impl.client.RpcNetChannel.afterFinishingActiveRpc(RpcNetChannel.java:1459)
    at com.google.net.rpc3.impl.client.RpcNetChannel.finishRpc(RpcNetChannel.java:1280)
    at com.google.net.rpc3.impl.client.RpcNetChannel.handleResponse(RpcNetChannel.java:2995)
    at com.google.net.rpc3.impl.client.RpcNetChannel.messageReceived(RpcNetChannel.java:2731)
    at com.google.net.rpc3.impl.client.RpcNetChannel.access$2900(RpcNetChannel.java:175)
    at com.google.net.rpc3.impl.client.RpcNetChannel$TransportCallback.receivedMessage(RpcNetChannel.java:3922)
    at com.google.net.rpc3.impl.client.RpcChannelTransportData$TransportCallback.receivedMessage(RpcChannelTransportData.java:669)
    at com.google.net.rpc3.impl.wire.RpcBaseTransport.receivedMessage(RpcBaseTransport.java:457)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport$ClientAdapter.receivedMessage(UdrpcTransport.java:577)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport.dispatchPacket(UdrpcTransport.java:386)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport.readPackets(UdrpcTransport.java:283)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport$1.run(UdrpcTransport.java:100)
    at com.google.net.eventmanager.AbstractFutureTask$Sync.innerRun(AbstractFutureTask.java:260)
    at com.google.net.eventmanager.AbstractFutureTask.run(AbstractFutureTask.java:121)
    at com.google.net.eventmanager.EventManagerImpl.runTask(EventManagerImpl.java:594)
    at com.google.net.eventmanager.EventManagerImpl.internalRunWorkerLoop(EventManagerImpl.java:1011)
    at com.google.net.eventmanager.EventManagerImpl.runWorkerLoop(EventManagerImpl.java:892)
    at com.google.net.eventmanager.WorkerThreadInfo.runWorkerLoop(WorkerThreadInfo.java:161)
    at com.google.net.eventmanager.EventManagerImpl$WorkerThread.run(EventManagerImpl.java:1879)
F 12:37:39.801 Uncaught exception from servlet
  com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large.
    at com.google.apphosting.utils.runtime.ApiProxyUtils.convertApiError(ApiProxyUtils.java:42)
    at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:497)
    at com.google.apphosting.runtime.ApiProxyImpl$AsyncApiFuture.success(ApiProxyImpl.java:411)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher$1.runInContext(RpcStub.java:856)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.runCallback(RpcStub.java:894)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:904)
    at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.success(RpcStub.java:883)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.runCallbacks(RpcClientInternalContext.java:1130)
    at com.google.net.rpc3.impl.client.RpcClientInternalContext.finishRpcAndNotifyApp(RpcClientInternalContext.java:1030)
    at com.google.net.rpc3.impl.client.RpcNetChannel.afterFinishingActiveRpc(RpcNetChannel.java:1459)
    at com.google.net.rpc3.impl.client.RpcNetChannel.finishRpc(RpcNetChannel.java:1280)
    at com.google.net.rpc3.impl.client.RpcNetChannel.handleResponse(RpcNetChannel.java:2995)
    at com.google.net.rpc3.impl.client.RpcNetChannel.messageReceived(RpcNetChannel.java:2731)
    at com.google.net.rpc3.impl.client.RpcNetChannel.access$2900(RpcNetChannel.java:175)
    at com.google.net.rpc3.impl.client.RpcNetChannel$TransportCallback.receivedMessage(RpcNetChannel.java:3922)
    at com.google.net.rpc3.impl.client.RpcChannelTransportData$TransportCallback.receivedMessage(RpcChannelTransportData.java:669)
    at com.google.net.rpc3.impl.wire.RpcBaseTransport.receivedMessage(RpcBaseTransport.java:457)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport$ClientAdapter.receivedMessage(UdrpcTransport.java:577)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport.dispatchPacket(UdrpcTransport.java:386)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport.readPackets(UdrpcTransport.java:283)
    at com.google.apphosting.runtime.udrpc.UdrpcTransport$1.run(UdrpcTransport.java:100)
    at com.google.net.eventmanager.AbstractFutureTask$Sync.innerRun(AbstractFutureTask.java:260)
    at com.google.net.eventmanager.AbstractFutureTask.run(AbstractFutureTask.java:121)
    at com.google.net.eventmanager.EventManagerImpl.runTask(EventManagerImpl.java:594)
    at com.google.net.eventmanager.EventManagerImpl.internalRunWorkerLoop(EventManagerImpl.java:1011)
    at com.google.net.eventmanager.EventManagerImpl.runWorkerLoop(EventManagerImpl.java:892)
    at com.google.net.eventmanager.WorkerThreadInfo.runWorkerLoop(WorkerThreadInfo.java:161)
    at com.google.net.eventmanager.EventManagerImpl$WorkerThread.run(EventManagerImpl.java:1879)

感谢任何帮助。

AppStat 错误堆栈

@2998ms datastore_v3.RunQuery real=7ms api=0ms cost=0 billed_ops=[]
Stack:
  com.google.appengine.tools.appstats.Recorder:276 makeAsyncCall()
  com.google.apphosting.api.ApiProxy:199 makeAsyncCall()
  com.google.appengine.api.datastore.DatastoreApiHelper:82 makeAsyncCall()
  com.google.appengine.api.datastore.QueryRunnerV3:36 runQuery()
  com.google.appengine.api.datastore.PreparedQueryImpl:32 runQuery()
  com.google.appengine.api.datastore.PreparedQueryImpl:61 asQueryResultIterator()
  com.googlecode.objectify.impl.engine.QueryEngine$ChunkingToRefIterator:100 <init>()
  com.googlecode.objectify.impl.engine.QueryEngine$1:64 iterator()
  com.googlecode.objectify.util.TranslatingQueryResultIterable:28 iterator()
  com.googlecode.objectify.util.TranslatingQueryResultIterable:11 iterator()
  com.googlecode.objectify.util.ResultProxy$1:26 translate()
  com.googlecode.objectify.util.ResultProxy$1:22 translate()
  com.googlecode.objectify.util.ResultTranslator:21 nowUncached()
  com.googlecode.objectify.util.ResultCache:30 now()
  com.googlecode.objectify.util.ResultProxy:52 invoke()
  com.sun.proxy.$Proxy16:164 toArray()
  co.gov.fonada.planeacion.mb.ContratoMB:67 fillContratos()

 @4218ms memcache.Get real=71ms api=0ms cost=0 billed_ops=[]
Stack:
  com.google.appengine.tools.appstats.Recorder:276 makeAsyncCall()
  com.google.apphosting.api.ApiProxy:199 makeAsyncCall()
  com.google.apphosting.api.ApiProxy:138 makeAsyncCall()
  com.google.appengine.api.memcache.MemcacheServiceApiHelper:95 makeAsyncCall()
  com.google.appengine.api.memcache.AsyncMemcacheServiceImpl:475 doGetAll()
  com.google.appengine.api.memcache.AsyncMemcacheServiceImpl:436 getIdentifiables()
  com.google.appengine.api.memcache.MemcacheServiceImpl:59 getIdentifiables()
  com.googlecode.objectify.cache.EntityMemcache:215 getAll()
  com.googlecode.objectify.cache.CachingAsyncDatastoreService:253 get()
  com.googlecode.objectify.impl.engine.LoadEngine$Round:172 fetchPending()
  com.googlecode.objectify.impl.engine.LoadEngine$Round:118 execute()
  com.googlecode.objectify.impl.engine.LoadEngine:258 execute()
  com.googlecode.objectify.impl.engine.QueryEngine$ChunkingToRefIterator:152 advanceBatch()
  com.googlecode.objectify.impl.engine.QueryEngine$ChunkingToRefIterator:105 <init>()
  com.googlecode.objectify.impl.engine.QueryEngine$1:64 iterator()
  com.googlecode.objectify.util.TranslatingQueryResultIterable:28 iterator()
  com.googlecode.objectify.util.TranslatingQueryResultIterable:11 iterator()
  com.googlecode.objectify.util.ResultProxy$1:26 translate()
  com.googlecode.objectify.util.ResultProxy$1:22 translate()
  com.googlecode.objectify.util.ResultTranslator:21 nowUncached()
  com.googlecode.objectify.util.ResultCache:30 now()
  com.googlecode.objectify.util.ResultProxy:52 invoke()
  com.sun.proxy.$Proxy16:164 toArray()
  co.gov.fonada.planeacion.mb.ContratoMB:67 fillContratos()

新编辑:

我在 memcache 中发现了一个大字符串,带有 _ahs* 键,这应该是一个 session 变量。我认为这就是变数太大了。该文本包括一份用于“调试”的 HTML 副本和一堆产品的版权免责声明。

全文为[clic here]

这是文本的一部分:

> pppppt6mainAccordion:formPago:dataPagos:modelInputFebrero2016uq~uq~uq~ppppuq~q~q~ �q~!q~$q~%q~    �pppppt6mainAccordion:formPago:dataPagos:modelInputFebrero2015uq~uq~uq~ppppuq~q~q~  �q~!q~$q~%q~    �pppppt6mainAccordion:formPago:dataPagos:modelInputFebrero2018uq~uq~uq~ppppuq~q~q~  �q~!q~$q~%q~    �pppppt6mainAccordion:formPago:dataPagos:modelInputFebrero2017uq~uq~uq~ppppuq~q~q~  �q~!q~$q~%q~    �pppppt%mainAccordion:formPago:dataPagos:ajaxuq~uq~uq~sq~Ssq~Ww#{pagoMB.buttonCrear}uq~Yq~[ppxwDB/formContrato.xhtml @806,33 actionListener="#{pagoMB.buttonCrear}"xsq~Ww'#{pagoMB.buttonCrear}java.lang.Voiduq~Yppxppppxxxtfacelets.ui.DebugOutputsr'com.sun.faces.facelets.tag.ui.UIDebug$2#E�#�  -xq~
?@wt
1427384717777|9<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.


    This file incorporates work covered by the following copyright and
    permission notice:

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Debug - /editarContrato.xhtml</title>
<style type="text/css">
body, div, span, td, th, caption { font-family: 'Trebuchet MS', Verdana, Arial, Sans-Serif; font-size: small; }
ul, li, pre { padding: 0; margin: 0; }
h1 { color: #090; }
h2, h2 span { font-size: large; color: #339; }
h2 a { text-decoration: none; color: #339; }
.grayBox { padding: 8px; margin: 10px 0; border: 1px solid #CCC; background-color: #f9f9f9;  }
#view { color: #090; font-weight: bold; font-size: medium; }
#tree, #vars { display: none; }
code { font-size: medium; }
#tree dl { color: #006; }
#tree dd { margin-top: 2px; margin-bottom: 2px; }
#tree dt { border: 1px solid #DDD; padding: 4px; border-left: 2px solid #666; font-family: "Courier New", Courier, mono; font-size: small; }
.uicText { color: #999;  }
table { border: 1px solid #CCC; border-collapse: collapse; border-spacing: 0px; width: 100%; text-align: left; }
td { border: 1px solid #CCC; }
thead tr th { padding: 2px; color: #030; background-color: #F9F9F9; }
tbody tr td { padding: 10px 6px; }

使用@BalusC “穷人的调试”方法来监听和调试 JSF 生命周期阶段,我在 END PHASE RENDER_RESPONSE 6 之后发现了错误。

仍然不知道是什么让我的应用程序将这些文件写入存储。

非常感谢任何帮助。

最佳答案

1MB 限制适用于所有 Datastore 实体。您需要将大型实体分解成更小的部分。

请注意, session 由 Memcache 和 Datastore 备份,并且它们对单个实体都有 1MB 的限制。确保您放入 session 中的所有实体都远低于此限制。

关于google-app-engine - 对 API 调用 datastore_v3.Put() 的请求太大。使用 Objectify (DataStore) 而不是上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29148054/

相关文章:

php登录页面与mysql的问题

jsf - 如何使用 onBlur 比较两个 inputText 包含并显示消息

jsf - PrimeFaces CSS 外观缺失和 JS "Uncaught Reference Error: PrimeFaces is not defined"

google-app-engine - 如何在Google云中部署现有的Spring MVC + JPA + MYSql + Maven应用程序

google-app-engine - 从备份恢复是否损坏?

python - 在 python 中为 url 参数生成固定长度的哈希

language-agnostic - 持久连接的套接字 session

google-app-engine - 在 Google App Engine 上部署 Tornado

php - 如何在 php、mysql 和 ajax session 中显示用户在线或离线

jsf-2 - p :tabView: direct link to tab