我有一个谷歌云函数,它涉及数据加载过程(google Bucket中的CSV->cloud SQL(。
云功能在处理较大的文件时遇到了内存问题,当我开始迭代和重新部署时,我开始收到以下错误:
生成失败:{"error":{"canonicalCode":"INVALID_ARGUMENT","errorMessage":"
yarn_install
具有stderr输出:\n警告package.json:没有许可证字段\n数据错误:MarkCompactCollector:半空间复制,在旧一代中回退分配失败-JavaScript堆内存不足\n 1:0x55ed663dfc50 node::Abort(([节点]\n 2:0x55ed663dfc9e[节点]\n 3:0x55ed6660e462v8::Utils::ReportOOMFailure(v8::internal::Isolate*,char const*,bool([节点]\n 4:0x55ed6660e7b8v8::internal::v8::FatalProcessOutOfMemory(v8::internal::Isolate*,charconst*,bool([节点]\n 5:0x55ed66a61462[节点]\n\n 6:0x55ed66 a8e274v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject*,int([节点]\n 7:0x55ed66a92957无效v8::internal::LiveObjectVisitor::VisitBlackObjectsNoFail(v8::internal::MemoryChunk*,v8::internal::MajorNonAtomicMarkingState*,v8::internal::抽空NewSpaceVisitor*,v8::internal::LiveObjectVisitor::IterationMode([节点]\n 8:0x55 ed66a9cc9v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::Page*,long*([节点]\n 9:0x55ed66a89569v8::internal::抽空器::抽空页面(v8::internal::Page*([node]\n10:0x55ed66a898a2 v8::internal::PageEvacuationTask::RunInParallel(([节点]\n11:0x55ed66a823dfv8::internal::ItemParallelJob::Task::RunInternal(([node]\n12:0x55 ed66a8323dv8::internal::ItemParallelJob::Run(std::shared_ptr([节点]\n13:0x55ed66a8edc1无效v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks(v8::internal::MarkCompact Collector*,v8::internal::ItemParallelJob*,v8::internal::RecordMigratedLotusVisitor*,v8::internal::MigrationObserver*,long([节点]\n14:0x55ed66a99bb7v8::internal::MarkCompactCollector::抽空页面InParallel(([节点]\n15:0x55ed66a99d2bv8::internal::MarkCompactCollector::Evacuate(([节点]\n16:0x55ed66a9a73d v8::internal::MarkCompactCollector::CollectGarbage(([节点]\n17:0x55ed66a71789 v8::内部::堆::MarkCompact(([节点]\n18:0x55ed66a72023v8::internal::堆::PerformGarbageCollection(v8::internal::GarbageCollector,v8::GCCallbackFlags([节点]\n19:0x55ed66a72affv8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace,v8::internal::GarbageCollectionReason,v8::GCCallbackFlags([节点]\n20:0x55ed66a75315v8::internal::堆::AllocateRawWithRetryOrFail(int,v8::internal::AllocationSpace,v8::internal::Allocation Alignment([节点]\n21:0x55ed66a3c164 v8::内部::工厂::NewFillerObject(int,bool,v8::internal::AllocationSpace([节点]\n22:0x55ed66d1059ev8::internal::Runtime_AllocateInNewSpace(int,v8::internal::Object**,v8::internal::Isolate*([node]\n23:0x31bac4adb1d\n\n错误:yarn_install
返回代码:-6","errorType":"InternalError","errorId":"5A8D99A0"}}
我的package.json中只有少数几个库,所以看到这个问题真是令人惊讶。
我的GCP托管函数似乎遇到了内存泄漏,所以我尝试删除该函数并重新部署(希望获得一个新的容器/机器(,但没有成功。我还尝试过升级库、重新部署现有代码以及从不同的机器进行部署,但都没有成功。
当前使用以下内容:
- 节点10
- 谷歌云SDK 285.0.1
- bq 2.0.55
- 堆芯2020.03.17
- gsutil 4.48
在yarn install
过程中,似乎有一个依赖项(已经安装了很长一段时间(突然引发了问题。我有@google云/functions-framework@1.1.0安装,删除后,我的构建过程完成得很好(我还尝试升级到最新的@1.5.0,但没有成功(。
yarn remove @google-cloud/functions-framework
允许我成功地重新部署