问答详情
源自:4-4 电影详情

<提问> 数据不返回,查看云函数有错误提升,请教如何解决


请求:

https://frodo.douban.com/api/v2/movie/${event.movieid}?&apiKey=054022eaeae0b00e0fc068c0c0a2102a


执行时间: 220ms内存使用: 40.59 MB

返回结果

null

日志

START RequestId:ad66d0b7-6f73-11eb-8d8d-52540036d55c


2021-02-15T09:53:40.285Z  =====27619748


2021-02-15T09:53:40.499Z  { StatusCodeError: 500 - "\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html><head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n<style type=\"text/css\">\nbody{font-family:Arial,Helvetica,sans-serif;font-size:14px;}\nh1{font-size:25px;margin:25px 0 10px 0;}\n</style>\n<title>此应用出错了</title>\n</head>\n<body>\n       <div>\n       <div style=\"margin:20px auto;width:960px\">\n       <div style=\"font-size:25px;color:#1b9336;border-bottom:5px solid #eef9eb\"><span style=\"font-size:20px;font-weight:bold\">豆瓣</span> d<span style=\"color:#0092c8\">o</span><span style=\"color:#ffad68\">u</span><span>b</span><span style=\"color:#0092c8\">a</span><span style=\"color:#ffad68\">n</span>\n       </div>\n       <h1>此应用出错了</h1>\n       <div><p>请稍后再试</p></div>\n       </div>\n       </div>\n</body>\n</html>\n"

at new StatusCodeError (/var/user/node_modules/request-promise-core/lib/errors.js:32:15)

at Request.plumbing.callback (/var/user/node_modules/request-promise-core/lib/plumbing.js:104:33)

at Request.RP$callback [as _callback] (/var/user/node_modules/request-promise-core/lib/plumbing.js:46:31)

at Request.self.callback (/var/user/node_modules/request/request.js:185:22)

at Request.emit (events.js:189:13)

at Request.<anonymous> (/var/user/node_modules/request/request.js:1154:10)

at Request.emit (events.js:189:13)

at IncomingMessage.<anonymous> (/var/user/node_modules/request/request.js:1076:12)

at Object.onceWrapper (events.js:277:13)

at IncomingMessage.emit (events.js:194:15)

at endReadableNT (_stream_readable.js:1125:12)

at process._tickCallback (internal/process/next_tick.js:63:19)

name: 'StatusCodeError',

statusCode: 500,

message:

'500 - "\\n<!DOCTYPE HTML PUBLIC \\"-//W3C//DTD HTML 4.01 Transitional//EN\\">\\n<html><head>\\n<meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=utf-8\\"/>\\n<style type=\\"text/css\\">\\nbody{font-family:Arial,Helvetica,sans-serif;font-size:14px;}\\nh1{font-size:25px;margin:25px 0 10px 0;}\\n</style>\\n<title>此应用出错了</title>\\n</head>\\n<body>\\n       <div>\\n       <div style=\\"margin:20px auto;width:960px\\">\\n       <div style=\\"font-size:25px;color:#1b9336;border-bottom:5px solid #eef9eb\\"><span style=\\"font-size:20px;font-weight:bold\\">豆瓣</span> d<span style=\\"color:#0092c8\\">o</span><span style=\\"color:#ffad68\\">u</span><span>b</span><span style=\\"color:#0092c8\\">a</span><span style=\\"color:#ffad68\\">n</span>\\n       </div>\\n       <h1>此应用出错了</h1>\\n       <div><p>请稍后再试</p></div>\\n       </div>\\n       </div>\\n</body>\\n</html>\\n"',

error:

'\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n<style type="text/css">\nbody{font-family:Arial,Helvetica,sans-serif;font-size:14px;}\nh1{font-size:25px;margin:25px 0 10px 0;}\n</style>\n<title>此应用出错了</title>\n</head>\n<body>\n       <div>\n       <div style="margin:20px auto;width:960px">\n       <div style="font-size:25px;color:#1b9336;border-bottom:5px solid #eef9eb"><span style="font-size:20px;font-weight:bold">豆瓣</span> d<span style="color:#0092c8">o</span><span style="color:#ffad68">u</span><span>b</span><span style="color:#0092c8">a</span><span style="color:#ffad68">n</span>\n       </div>\n       <h1>此应用出错了</h1>\n       <div><p>请稍后再试</p></div>\n       </div>\n       </div>\n</body>\n</html>\n',

options:

{ uri:

'https://frodo.douban.com/api/v2/movie/27619748?apiKey=054022eaeae0b00e0fc068c0c0a2102a',

callback: [Function: RP$callback],

transform: undefined,

simple: true,

resolveWithFullResponse: false,

transform2xxOnly: false },

response:

IncomingMessage {

_readableState:

ReadableState {

objectMode: false,

highWaterMark: 16384,

buffer: BufferList { head: null, tail: null, length: 0 },

length: 0,

pipes: null,

pipesCount: 0,

flowing: true,

ended: true,

endEmitted: true,

reading: false,

sync: true,

needReadable: false,

emittedReadable: false,

readableListening: false,

resumeScheduled: false,

paused: false,

emitClose: true,

destroyed: false,

defaultEncoding: 'utf8',

awaitDrain: 0,

readingMore: true,

decoder: null,

encoding: null },

readable: false,

_events:

[Object: null prototype] {

end: [Array],

close: [Array],

data: [Function],

error: [Function] },

_eventsCount: 4,

_maxListeners: undefined,

socket:

TLSSocket {

_tlsOptions: [Object],

_secureEstablished: true,

_securePending: false,

_newSessionPending: false,

_controlReleased: true,

_SNICallback: null,

servername: 'frodo.douban.com',

alpnProtocol: false,

authorized: true,

authorizationError: null,

encrypted: true,

_events: [Object],

_eventsCount: 8,

connecting: false,

_hadError: false,

_handle: null,

_parent: null,

_host: 'frodo.douban.com',

_readableState: [ReadableState],

readable: false,

_maxListeners: undefined,

_writableState: [WritableState],

writable: false,

allowHalfOpen: false,

_sockname: null,

_pendingData: null,

_pendingEncoding: '',

server: undefined,

_server: null,

ssl: null,

_requestCert: true,

_rejectUnauthorized: true,

parser: null,

_httpMessage: [ClientRequest],

write: [Function: writeAfterFIN],

[Symbol(res)]: [TLSWrap],

[Symbol(asyncId)]: 9,

[Symbol(lastWriteQueueSize)]: 0,

[Symbol(timeout)]: null,

[Symbol(kBytesRead)]: 1259,

[Symbol(kBytesWritten)]: 122,

[Symbol(connect-options)]: [Object] },

connection:

TLSSocket {

_tlsOptions: [Object],

_secureEstablished: true,

_securePending: false,

_newSessionPending: false,

_controlReleased: true,

_SNICallback: null,

servername: 'frodo.douban.com',

alpnProtocol: false,

authorized: true,

authorizationError: null,

encrypted: true,

_events: [Object],

_eventsCount: 8,

connecting: false,

_hadError: false,

_handle: null,

_parent: null,

_host: 'frodo.douban.com',

_readableState: [ReadableState],

readable: false,

_maxListeners: undefined,

_writableState: [WritableState],

writable: false,

allowHalfOpen: false,

_sockname: null,

_pendingData: null,

_pendingEncoding: '',

server: undefined,

_server: null,

ssl: null,

_requestCert: true,

_rejectUnauthorized: true,

parser: null,

_httpMessage: [ClientRequest],

write: [Function: writeAfterFIN],

[Symbol(res)]: [TLSWrap],

[Symbol(asyncId)]: 9,

[Symbol(lastWriteQueueSize)]: 0,

[Symbol(timeout)]: null,

[Symbol(kBytesRead)]: 1259,

[Symbol(kBytesWritten)]: 122,

[Symbol(connect-options)]: [Object] },

httpVersionMajor: 1,

httpVersionMinor: 1,

httpVersion: '1.1',

complete: true,

headers:

{ date: 'Mon, 15 Feb 2021 09:53:40 GMT',

'content-type': 'text/html; charset=utf-8',

'transfer-encoding': 'chunked',

connection: 'close',

'x-dae-app': 'frodo',

'x-dae-instance': 'movie',

'set-cookie': [Array],

'x-douban-newbid': 'S8S0d14LZR8',

server: 'dae',

'strict-transport-security': 'max-age=15552000',

'x-content-type-options': 'nosniff' },

rawHeaders:

[ 'Date',

'Mon, 15 Feb 2021 09:53:40 GMT',

'Content-Type',

'text/html; charset=utf-8',

'Transfer-Encoding',

'chunked',

'Connection',

'close',

'X-DAE-App',

'frodo',

'X-DAE-Instance',

'movie',

'Set-Cookie',

'bid=S8S0d14LZR8; Expires=Tue, 15-Feb-22 09:53:40 GMT; Domain=.douban.com; Path=/',

'X-DOUBAN-NEWBID',

'S8S0d14LZR8',

'Server',

'dae',

'Strict-Transport-Security',

'max-age=15552000',

'X-Content-Type-Options',

'nosniff' ],

trailers: {},

rawTrailers: [],

aborted: false,

upgrade: false,

url: '',

method: null,

statusCode: 500,

statusMessage: 'INTERNAL SERVER ERROR',

client:

TLSSocket {

_tlsOptions: [Object],

_secureEstablished: true,

_securePending: false,

_newSessionPending: false,

_controlReleased: true,

_SNICallback: null,

servername: 'frodo.douban.com',

alpnProtocol: false,

authorized: true,

authorizationError: null,

encrypted: true,

_events: [Object],

_eventsCount: 8,

connecting: false,

_hadError: false,

_handle: null,

_parent: null,

_host: 'frodo.douban.com',

_readableState: [ReadableState],

readable: false,

_maxListeners: undefined,

_writableState: [WritableState],

writable: false,

allowHalfOpen: false,

_sockname: null,

_pendingData: null,

_pendingEncoding: '',

server: undefined,

_server: null,

ssl: null,

_requestCert: true,

_rejectUnauthorized: true,

parser: null,

_httpMessage: [ClientRequest],

write: [Function: writeAfterFIN],

[Symbol(res)]: [TLSWrap],

[Symbol(asyncId)]: 9,

[Symbol(lastWriteQueueSize)]: 0,

[Symbol(timeout)]: null,

[Symbol(kBytesRead)]: 1259,

[Symbol(kBytesWritten)]: 122,

[Symbol(connect-options)]: [Object] },

_consuming: false,

_dumped: false,

req:

ClientRequest {

_events: [Object],

_eventsCount: 5,

_maxListeners: undefined,

output: [],

outputEncodings: [],

outputCallbacks: [],

outputSize: 0,

writable: true,

_last: true,

chunkedEncoding: false,

shouldKeepAlive: false,

useChunkedEncodingByDefault: false,

sendDate: false,

_removedConnection: false,

_removedContLen: false,

_removedTE: false,

_contentLength: 0,

_hasBody: true,

_trailer: '',

finished: true,

_headerSent: true,

socket: [TLSSocket],

connection: [TLSSocket],

_header:

'GET /api/v2/movie/27619748?apiKey=054022eaeae0b00e0fc068c0c0a2102a HTTP/1.1\r\nhost: frodo.douban.com\r\nConnection: close\r\n\r\n',

_onPendingData: [Function: noopPendingOutput],

agent: [Agent],

socketPath: undefined,

timeout: undefined,

method: 'GET',

path:

'/api/v2/movie/27619748?apiKey=054022eaeae0b00e0fc068c0c0a2102a',

_ended: true,

res: [Circular],

aborted: undefined,

timeoutCb: null,

upgradeOrConnect: false,

parser: null,

maxHeadersCount: null,

[Symbol(isCorked)]: false,

[Symbol(outHeadersKey)]: [Object] },

request:

Request {

_events: [Object],

_eventsCount: 5,

_maxListeners: undefined,

uri: [Url],

readable: true,

writable: true,

_qs: [Querystring],

_auth: [Auth],

_oauth: [OAuth],

_multipart: [Multipart],

_redirect: [Redirect],

_tunnel: [Tunnel],

_rp_resolve: [Function],

_rp_reject: [Function],

_rp_promise: [Promise],

_rp_callbackOrig: undefined,

callback: [Function],

_rp_options: [Object],

headers: {},

setHeader: [Function],

hasHeader: [Function],

getHeader: [Function],

removeHeader: [Function],

method: 'GET',

localAddress: undefined,

pool: {},

dests: [],

__isRequestRequest: true,

_callback: [Function: RP$callback],

proxy: null,

tunnel: true,

setHost: true,

originalCookieHeader: undefined,

_disableCookies: true,

_jar: undefined,

port: 443,

host: 'frodo.douban.com',

path:

'/api/v2/movie/27619748?apiKey=054022eaeae0b00e0fc068c0c0a2102a',

httpModule: [Object],

agentClass: [Function],

agent: [Agent],

_started: true,

href:

'https://frodo.douban.com/api/v2/movie/27619748?apiKey=054022eaeae0b00e0fc068c0c0a2102a',

req: [ClientRequest],

ntick: true,

response: [Circular],

originalHost: 'frodo.douban.com',

originalHostHeaderName: 'host',

responseContent: [Circular],

_destdata: true,

_ended: true,

_callbackCalled: true },

toJSON: [Function: responseToJSON],

caseless: Caseless { dict: [Object] },

body:

'\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>\n<style type="text/css">\nbody{font-family:Arial,Helvetica,sans-serif;font-size:14px;}\nh1{font-size:25px;margin:25px 0 10px 0;}\n</style>\n<title>此应用出错了</title>\n</head>\n<body>\n       <div>\n       <div style="margin:20px auto;width:960px">\n       <div style="font-size:25px;color:#1b9336;border-bottom:5px solid #eef9eb"><span style="font-size:20px;font-weight:bold">豆瓣</span> d<span style="color:#0092c8">o</span><span style="color:#ffad68">u</span><span>b</span><span style="color:#0092c8">a</span><span style="color:#ffad68">n</span>\n       </div>\n       <h1>此应用出错了</h1>\n       <div><p>请稍后再试</p></div>\n       </div>\n       </div>\n</body>\n</html>\n' } }

END RequestId:ad66d0b7-6f73-11eb-8d8d-52540036d55c

Report RequestId:ad66d0b7-6f73-11eb-8d8d-52540036d55c Duration:220ms Memory:256MB MemUsage:40.593750MB


提问者:Qaufue 2021-02-15 17:55

个回答

  • mhj_001
    2021-02-25 23:21:23

    我的也这样,一堆乱码