Azure Kubernetes-Puppeteer准备PDF错误:页面崩溃!在Page._onTargetCrashed

时间:2019-09-19 06:17:34

标签: kubernetes puppeteer azure-kubernetes

程序运行await page.evaluate(...);时,抛出错误:

Error: Page crashed!
    at Page._onTargetCrashed (/usr/src/app/node_modules/puppeteer/lib/Page.js:170:24)
    at CDPSession.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/Page.js:125:56)
    at CDPSession.emit (events.js:203:13)
    at CDPSession._onMessage (/usr/src/app/node_modules/puppeteer/lib/Connection.js:200:12)
    at Connection._onMessage (/usr/src/app/node_modules/puppeteer/lib/Connection.js:112:17)
    at WebSocket.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/WebSocketTransport.js:41:24)
    at WebSocket.onMessage (/usr/src/app/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:203:13)
    at Receiver.receiverOnMessage (/usr/src/app/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:203:13)
[2019-09-19T02:59:56.202Z] Error for printPdf()
Error: Protocol error (Runtime.callFunctionOn): Target closed.
    at /usr/src/app/node_modules/puppeteer/lib/Connection.js:183:56
    at new Promise (<anonymous>)
    at CDPSession.send (/usr/src/app/node_modules/puppeteer/lib/Connection.js:182:12)
    at ExecutionContext.evaluateHandle (/usr/src/app/node_modules/puppeteer/lib/ExecutionContext.js:106:44)
    at ExecutionContext.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:111:23)
    at ExecutionContext.evaluate (/usr/src/app/node_modules/puppeteer/lib/ExecutionContext.js:48:31)
    at ExecutionContext.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:111:23)
    at DOMWorld.evaluate (/usr/src/app/node_modules/puppeteer/lib/DOMWorld.js:112:20)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
  -- ASYNC --
    at Frame.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:110:27)
    at Page.evaluate (/usr/src/app/node_modules/puppeteer/lib/Page.js:782:43)
    at Page.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:111:23)
    at printPdf (/usr/src/app/puppeteer.js:219:16)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async /usr/src/app/puppeteer.js:133:21 {
  message: 'Protocol error (Runtime.callFunctionOn): Target closed.'
}

我试图增加Azure Kubernetes VM的大小以具有更好的CPU和内存,但是它可以正常工作并且问题不存在了。 但是,它又突然发生了,我不想将VM大小升级到EXTREMELY模型。

如何彻底解决?


进一步添加htop屏幕捕获以供参考:
(尚未达到80%) enter image description here

0 个答案:

没有答案