Relative Content

Tag Archive for amazon-web-servicesaws-lambda

why textract dont return TABLES , just return “WORDS” end “LINES”

import boto3 from botocore.exceptions import ClientError class TextractWrapper: “””Encapsulates Textract functions.””” def __init__(self, textract_client, s3_resource, sqs_resource): “”” :param textract_client: A Boto3 Textract client. :param s3_resource: A Boto3 Amazon S3 resource. :param sqs_resource: A Boto3 Amazon SQS resource. “”” self.textract_client = textract_client self.s3_resource = s3_resource self.sqs_resource = sqs_resource def analyze_file(self, bucket, file_name): “”” Detects text and […]

Custom HTTP response codes in AWS Lambda custom runtime with function URLs

I built an AWS Lambda custom runtime function to be triggered through function URLs for a streaming response. I can create error and OK responses by posting to the Custom Runtime API, but I don’t see how I can set the HTTP response code, such as 404 or 500. I know it’s possible for most HTTP codes in the supported runtimes, like NodeJS. Is it possible with custom runtimes?

Protocol error (Page.navigate): Target closed – AWS Lambda failure message

{ “errorType”: “TargetCloseError”, “errorMessage”: “Protocol
error
(Page.navigate): Target closed”, “name”: “TargetCloseError”, “cause”: { “errorType”: “ProtocolError”, “errorMessage”: “”, “name”: “ProtocolError”, “stack”: [ “ProtocolError”, ” at <instance_members_initializer> (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:42:14)”, ” at new Callback (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:46:16)”, ” at CallbackRegistry.create (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:86:26)”, ” at Connection._rawSend (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:208:26)”, ” at CdpCDPSession.send (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:62:33)”, ” at navigate (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Frame.js:164:51)”, ” at CdpFrame.goto (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Frame.js:142:17)”, ” at CdpFrame. (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:108:27)”, ” at CdpPage.goto (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:724:43)”, ” at exports.handler (/var/task/index.js:38:18)” ] }, “stack”: [ “TargetCloseError: Protocol
error
(Page.navigate): Target closed”, ” at CallbackRegistry.clear (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:139:36)”, ” at CdpCDPSession._onClosed (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:97:25)”, ” at #onClose (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:285:21)”, ” at WebSocket. (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:57:30)”, ” at callListener (/var/task/node_modules/ws/lib/event-target.js:290:14)”, ” at WebSocket.onClose (/var/task/node_modules/ws/lib/event-target.js:220:9)”, ” at WebSocket.emit (node:events:517:28)”, ” at WebSocket.emitClose (/var/task/node_modules/ws/lib/websocket.js:260:10)”, ” at Socket.socketOnClose (/var/task/node_modules/ws/lib/websocket.js:1272:15)”, ” at Socket.emit (node:events:517:28)” ] }