sararob / video-intelligence-demo

Video Intelligence API keynote demo from Google Next 2017
https://medium.com/@srobtweets/get-the-code-for-the-video-intelligence-api-demo-794e7675effe
Apache License 2.0
192 stars 83 forks source link

TypeError: Cannot read property '0' of undefined at Request._callback (/app/app.js:117:55) #19

Open onofrioP89 opened 7 years ago

onofrioP89 commented 7 years ago

Hello, I have deployed the app on GAE and Cloud Function, but I have a problem when app is started. This is a stacktrace of the command

gcloud app logs tail -s default

2017-05-03 11:02:07 default[20170503t125523]  GET /_ah/health 200 2.579 ms - 1004
2017-05-03 11:02:07 default[20170503t125523]  GET /_ah/health 200 0.507 ms - 1004
2017-05-03 11:02:07 default[20170503t125523]  { kind: 'storage#object',
2017-05-03 11:02:07 default[20170503t125523]    id: 'video-intelligence-json/google-home-superbowlmp4.json/1493804433756714',
2017-05-03 11:02:07 default[20170503t125523]    selfLink: 'https://www.googleapis.com/storage/v1/b/video-intelligence-json/o/google-home-superbowlmp4.json',
2017-05-03 11:02:07 default[20170503t125523]    name: 'google-home-superbowlmp4.json',
2017-05-03 11:02:07 default[20170503t125523]    bucket: 'video-intelligence-json',
2017-05-03 11:02:07 default[20170503t125523]    generation: '1493804433756714',
2017-05-03 11:02:07 default[20170503t125523]    metageneration: '1',
2017-05-03 11:02:07 default[20170503t125523]    contentType: 'application/json',
2017-05-03 11:02:07 default[20170503t125523]    timeCreated: '2017-05-03T09:40:33.601Z',
2017-05-03 11:02:07 default[20170503t125523]    updated: '2017-05-03T09:40:33.601Z',
2017-05-03 11:02:07 default[20170503t125523]    storageClass: 'MULTI_REGIONAL',
2017-05-03 11:02:07 default[20170503t125523]    timeStorageClassUpdated: '2017-05-03T09:40:33.601Z',
2017-05-03 11:02:07 default[20170503t125523]    size: '40178',
2017-05-03 11:02:07 default[20170503t125523]    md5Hash: 'O15kbUixMKzQM41DOAhG/A==',
2017-05-03 11:02:07 default[20170503t125523]    mediaLink: 'https://www.googleapis.com/download/storage/v1/b/video-intelligence-json/o/google-home-superbowlmp4.json?generation=1493804433756714&alt=media',
2017-05-03 11:02:07 default[20170503t125523]    crc32c: 'D1ouWQ==',
2017-05-03 11:02:07 default[20170503t125523]    etag: 'CKqkjZW309MCEAE=' }
2017-05-03 11:02:08 default[20170503t125523]  /app/app.js:117
2017-05-03 11:02:08 default[20170503t125523]                    annotations: body.annotation_results[0]
2017-05-03 11:02:08 default[20170503t125523]                                                        ^
2017-05-03 11:02:08 default[20170503t125523]
2017-05-03 11:02:08 default[20170503t125523]  TypeError: Cannot read property '0' of undefined      at Request._callback (/app/app.js:117:55)      at Request.self.callback (/app/node_modules/request/request.js:188:22)      at emitTwo (events.js:106:13)      at Request.emit (events.js:191:7)      at Request.<anonymous> (/app/node_modules/request/request.js:1171:10)      at emitOne (events.js:96:13)      at Request.emit (events.js:188:7)      at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1091:12)      at IncomingMessage.g (events.js:291:16)      at emitNone (events.js:91:20)
2017-05-03 11:02:08 default[20170503t125523]
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Linux 3.16.0-4-amd64
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! node v6.10.2
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! npm  v3.10.10
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! code ELIFECYCLE
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! appengine-express@0.0.1 start: `node ./bin/www`
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Exit status 1
2017-05-03 11:02:08 default[20170503t125523]  npm ERR!
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Failed at the appengine-express@0.0.1 start script 'node ./bin/www'.
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! If you do, this is most likely a problem with the appengine-express package,
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! not with npm itself.
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Tell the author that this fails on your system:
2017-05-03 11:02:08 default[20170503t125523]  npm ERR!     node ./bin/www
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! You can get information on how to open an issue for this project with:
2017-05-03 11:02:08 default[20170503t125523]  npm ERR!     npm bugs appengine-express
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Or if that isn't available, you can get their info via:
2017-05-03 11:02:08 default[20170503t125523]  npm ERR!     npm owner ls appengine-express
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! There is likely additional logging output above.
2017-05-03 11:02:08 default[20170503t125523]
2017-05-03 11:02:08 default[20170503t125523]  npm ERR! Please include the following file with any support request:
2017-05-03 11:02:08 default[20170503t125523]  npm ERR!     /app/npm-debug.log

Any feedback are appreciated!
Thanks
Onofrio
EmilAvalon commented 7 years ago

have the same - when I am deploying frontend to appengine there is an error that npm 1.4.8 is not supported.

EmilAvalon commented 7 years ago

In addition I have error: dog:12 Uncaught TypeError: Cannot read property 'thumbnail' of undefined at exports.default (eval at (https://xxxxxxxxxx.appspot.com/javascripts/compiled.js:95:2), :12:57) at eval (eval at (https://xxxxxxxxxxxxx.appspot.com/javascripts/compiled.js:107:2), :187:40) at Array.map (native) at SearchPage.renderResultCards (eval at (https://xxxxxxxxxxxx.appspot.com/javascripts/compiled.js:107:2), :186:33) at SearchPage.render (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:107:2), :89:14) at new SearchPage (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:107:2), :52:10) at App.renderPage (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:47:2), :146:30) at searchQuery (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:47:2), :125:17) at eval (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:77:2), :321:125) at manageHooks (eval at (https://avalon-platform-demo.appspot.com/javascripts/compiled.js:77:2), :210:4)

sararob commented 7 years ago

@onofrioP89 is the JSON annotations file available (and readable) in the JSON storage bucket you've specified? If the name of your video is test.mp4, the associated JSON file should be called testmp4.json.

Can you also try setting both the JSON file and video file to publicly readable to make sure it's not an access issue?

storage-access

@EmilAvalon I fixed the thumbnail issue yesterday.

onofrioP89 commented 7 years ago

@sararob Hi, thanks for the answer. As soon as I can check it and I will give you an answer. Thanks

EmilAvalon commented 7 years ago

Thanks. Works fine.

śr., 24.05.2017, 17:23 użytkownik Onofrio Petragallo < notifications@github.com> napisał:

@sararob https://github.com/sararob Hi, thanks for the answer. As soon as I can check it and I will give you an answer. Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sararob/video-intelligence-demo/issues/19#issuecomment-303758432, or mute the thread https://github.com/notifications/unsubscribe-auth/AbNKGI3su7jSAKFqEXYYFviyWjfUAyfrks5r9EthgaJpZM4NPP25 .

--

Emil Dąbrowski

Avalon Solutions Sp.z o.o.

Warsaw Financial Center

ul. Emilii Plater 53

00-113 Warsaw Poland

O + 48 22 528 67 00

M +48 514 653 400 | avaloncloud.com

[image: Avalon Solutions - Innovating Your Digital Workplace] http://avaloncloud.com/

onofrioP89 commented 7 years ago

@sararob Hello, the error, object of the isssue, is no longer present. At this time however on App Engine I see this error:

GCS error getting files {ApiError: Not Found      At Object.parseHttpRespBody (/app/node_modules/@google-cloud/common/src/util.js:191:30)      At Object.handleResp (/app/node_modules/@google-cloud/common/src/util.js:131:18)      At /app/node_modules/@google-cloud/common/src/util.js:465:12      At Request.onResponse [as _callback] (/app/node_modules/retry-request/index.js:120:7)      At Request.self.callback (/app/node_modules/request/request.js:188:22)      At emitTwo (events.js: 106: 13)      At Request.emit (events.js: 191: 7)      At Request. (/app/node_modules/request/request.js:1171:10)      At emitOne (events.js: 96: 13)      At Request.emit (events.js: 188: 7)

shoreshgithub commented 6 years ago

@onofrioP89 Did you find a solution for the error Cannot read property '0' of undefined at Request._callback?It would be appreciated if let me know your solution.

onofrioP89 commented 6 years ago

@shoreshgithub the fix of the problem was writed by @sararob https://github.com/sararob/video-intelligence-demo/issues/19#issuecomment-303756394

I had another error, described here, but now I'm not working on the fix.

hashkanna commented 5 years ago

@shoreshgithub The problem seems to be with the missing "annotation_results" tag in the json result. Compare the output generated by the API with the sample annotation of superbowl. Another problem is all the tags in the result JSON have changed to camel case. so replacing that to lower case with underscores might also help.