skrashevich/double-take

[BUG] Error in log -> Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)

Closed this issue · 5 comments

marq24 commented

Describe the bug
In the log there is output 'Not implemented: HTMLCanvasElement.prototype.getContext'...

23-08-27 09:46:06 info: processing fri_front: 032382f2-6a1a-44d3-86dc-2c7d166e8793
23-08-27 09:46:06 error: Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/double-take/api/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/double-take/api/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/double-take/api/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at Object.Module.imread (/double-take/api/src/util/opencv/lib.js:9180:24)
    at Object.module.exports.faceCount (/double-take/api/src/util/opencv/index.js:68:20)
    at async Object.module.exports.start (/double-take/api/src/util/process.util.js:136:45)
    at async module.exports.polling (/double-take/api/src/util/process.util.js:55:25)
    at async Promise.all (index 0)
    at async module.exports.start (/double-take/api/src/controllers/recognize.controller.js:152:7) null
23-08-27 09:46:06 error: opencv error:  Cannot read properties of null (reading 'drawImage')
23-08-27 09:46:06 error: Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/double-take/api/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/double-take/api/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/double-take/api/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at Object.Module.imread (/double-take/api/src/util/opencv/lib.js:9180:24)
    at Object.module.exports.faceCount (/double-take/api/src/util/opencv/index.js:68:20)
    at async Object.module.exports.start (/double-take/api/src/util/process.util.js:136:45)
    at async module.exports.polling (/double-take/api/src/util/process.util.js:55:25)
    at async Promise.all (index 0)
    at async module.exports.start (/double-take/api/src/controllers/recognize.controller.js:152:7) null
23-08-27 09:46:06 error: opencv error:  Cannot read properties of null (reading 'drawImage')

Version of Double Take
1.13.11

Expected behavior
"clean log"

Hardware

  • Architecture or platform: amd64
  • OS: Ubuntu
  • Docker image: skrashevich/double-take:latest

additional info
I am running compreface & codeprojec-ai as detectors and I have 'opencv_face_required' set to true for both... my opencv settings are the default:

opencv:
  scale_factor: 1.05
  min_neighbors: 4.5
  min_size_width: 40
  min_size_height: 40

+1 on this

try this build: ghcr.io/skrashevich/double-take:sha-524b747 (v1.13.11.1)

marq24 commented

... thanks... I have updated here my system and after the restart of the container there was the following output:

23-08-31 04:55:34 info: Double Take v1.13.11
23-08-31 04:55:36 info: MQTT: connected
23-08-31 04:55:36 info: MQTT: subscribed to frigate/events, frigate/+/person/snapshot
23-08-31 04:56:23 info: processing fri_front: 1693457781.473588-soos67
23-08-31 04:56:23 info: processing fri_front: 46e53127-777f-4589-bf48-b3f5fcbf0487
23-08-31 04:56:34 error: AxiosError: stream error: timeout of 5000ms exceeded
    at RedirectableRequest.handleRequestTimeout (/double-take/api/node_modules/axios/dist/node/axios.cjs:3053:16)
    at RedirectableRequest.emit (node:events:513:28)
    at Timeout.<anonymous> (/double-take/api/node_modules/follow-redirects/index.js:169:12)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
23-08-31 04:56:53 info: processing fri_front: 3ef85885-b348-4688-b548-8886c896a3d0
23-08-31 04:56:53 info: done processing fri_front: 46e53127-777f-4589-bf48-b3f5fcbf0487 in 0.06 sec
23-08-31 04:56:53 info: {
  id: '46e53127-777f-4589-bf48-b3f5fcbf0487',
  duration: 0.06,
  timestamp: '2023-08-31T04:56:53.057Z',
  attempts: 1,
  camera: 'fri_front',
  zones: [],
  counts: { person: 1, match: 0, miss: 0, unknown: 1 },
  matches: [],
  misses: [],
  ...

but the previous log-output (why this issue has been created) seams to be gone - thanks! - if this AxiosError: stream error is normal/ok cause of the restart then all is fine ;-)

... thanks... I have updated here my system and after the restart of the container there was the following output:

23-08-31 04:55:34 info: Double Take v1.13.11
23-08-31 04:55:36 info: MQTT: connected
23-08-31 04:55:36 info: MQTT: subscribed to frigate/events, frigate/+/person/snapshot
23-08-31 04:56:23 info: processing fri_front: 1693457781.473588-soos67
23-08-31 04:56:23 info: processing fri_front: 46e53127-777f-4589-bf48-b3f5fcbf0487
23-08-31 04:56:34 error: AxiosError: stream error: timeout of 5000ms exceeded
    at RedirectableRequest.handleRequestTimeout (/double-take/api/node_modules/axios/dist/node/axios.cjs:3053:16)
    at RedirectableRequest.emit (node:events:513:28)
    at Timeout.<anonymous> (/double-take/api/node_modules/follow-redirects/index.js:169:12)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
23-08-31 04:56:53 info: processing fri_front: 3ef85885-b348-4688-b548-8886c896a3d0
23-08-31 04:56:53 info: done processing fri_front: 46e53127-777f-4589-bf48-b3f5fcbf0487 in 0.06 sec
23-08-31 04:56:53 info: {
  id: '46e53127-777f-4589-bf48-b3f5fcbf0487',
  duration: 0.06,
  timestamp: '2023-08-31T04:56:53.057Z',
  attempts: 1,
  camera: 'fri_front',
  zones: [],
  counts: { person: 1, match: 0, miss: 0, unknown: 1 },
  matches: [],
  misses: [],
  ...

but the previous log-output (why this issue has been created) seams to be gone - thanks! - if this AxiosError: stream error is normal/ok cause of the restart then all is fine ;-)

try to increase timeouts in detectors section

marq24 commented

both timeouts (for both of my detectors) are set to 20sec (at least I think this are seconds)... I assume this output came from my single container restart... nevertheless - let's keep things separate - the initial problem Not implemented... is IMHO solved...

I just restarted all my ha-related containers (docker-compose restart) and no unusual things in the log(s)...

So for me it's totally fine to close this issue - and if this timeout thing reoccur I will open a new issue.