Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when annotation is enabled #284

Closed
r3dsouza opened this issue Jun 20, 2020 · 5 comments
Closed

Error when annotation is enabled #284

r3dsouza opened this issue Jun 20, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@r3dsouza
Copy link

Issue
I tried enabling annotations, however, I get the following error. Please could you let me know what I can do to make annotations work. Thanks.

Log entries
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stringToGlyphs' of null
at Object.t.measureText (/home/node/app/bundle.js:544:24375)
at Object.t.processTextPath (/home/node/app/bundle.js:544:23398)
at fillText (/home/node/app/bundle.js:702:199457)
at /home/node/app/bundle.js:702:190245
at Array.map ()
at Object. (/home/node/app/bundle.js:702:190152)
at /home/node/app/bundle.js:702:189268
at Object.next (/home/node/app/bundle.js:702:189373)
at o (/home/node/app/bundle.js:702:188087)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Installation details

  • Running in Docker on QNAP TS-451+
  • Running the latest release 3.0.0

Docker Compose
deepstackai-trigger:
container_name: deepstackai-trigger
image: danecreekphotography/node-deepstackai-trigger:latest
hostname: deepstackai-trigger
networks:
- qnet-dhcp-eth0-3d3dab
ports:
- 4242:4242
environment:
- TZ=Europe/London
volumes:
- /share/CCTV/AI_Input:/aiinput
- /share/Containers/DeepStackAI_Trigger/config:/config
- /share/Containers/DeepStackAI_Trigger/node-deepstackai-trigger:/node-deepstackai-trigger
restart: always

@neilenns neilenns added bug Something isn't working and removed Support labels Jun 21, 2020
@neilenns
Copy link
Owner

neilenns commented Jun 21, 2020

I thought I already had a closed bug for this but I guess not. This is fixed as part of my work for #260, but hasn't made it out to the latest build yet. I'm glad you hit it though, I thought I was the only one!

Would you mind testing the fix to see if it resolves the issue? Change your docker-compose.yaml to point to danecreekphotography/node-deepstackai-trigger:issue260 instead of danecreekphotography/node-deepstackai-trigger:latest then run docker-compose up. That should fix it.

@splatura
Copy link

splatura commented Jun 21, 2020

I came across the same issue. It only appeared once I added the "annotateImage": true, into the telegram configuration (in triggers.json). I was using the danecreekphotography/node-deepstackai-trigger:dev image.

I have tested with danecreekphotography/node-deepstackai-trigger:issue260 and this has worked OK. Images come through to telegram correctly annotated.

trigger_1 | 2020-06-21T16:28:44+10:00 [Annotations] Annotating /aiinput/garagehd.20200621_142306873.jpg
trigger_1 | (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'stringToGlyphs' of null
trigger_1 | at Object.t.measureText (/home/node/app/bundle.js:564:24389)
trigger_1 | at Object.t.processTextPath (/home/node/app/bundle.js:564:23412)
trigger_1 | at fillText (/home/node/app/bundle.js:721:199545)
trigger_1 | at /home/node/app/bundle.js:721:190333
trigger_1 | at Array.map ()
trigger_1 | at Object. (/home/node/app/bundle.js:721:190240)
trigger_1 | at /home/node/app/bundle.js:721:189356
trigger_1 | at Object.next (/home/node/app/bundle.js:721:189461)
trigger_1 | at o (/home/node/app/bundle.js:721:188175)
trigger_1 | at processTicksAndRejections (internal/process/task_queues.js:97:5)
trigger_1 | (Use node --trace-warnings ... to show where the warning was created)
trigger_1 | (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

@neilenns
Copy link
Owner

This fix is now available in the latest image. Thanks!

@r3dsouza
Copy link
Author

r3dsouza commented Jun 21, 2020

Thanks for fixing this. I pulled the latest version and tried it again and it works perfectly!

Note: in case it helps someone, because I am mapping the volume /node-deepstackai-trigger to a folder on the docker host, I received a permission denied error. In order to fix this, I added the line "user: 99:99" to my docker compose file. Please note the first 99 is the UID and the second 99 is the GID. This runs the container with the privileges of this user.

@neilenns
Copy link
Owner

It was driving me crazy. I'd hit it all the time during development and couldn't figure out why. Finally found a random comment on a random issue about the library from 2018 and gave it a try and... phew!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants