DevelopingSpace / starchart

A self-serve tool for managing custom domains and certificates
MIT License
20 stars 13 forks source link

Certificate failure results in multiple emails #636

Closed humphd closed 1 year ago

humphd commented 1 year ago

I ran into a weird bug on staging, and my certificate request failed. I ended up getting 2 failure notification emails (both identical):

Screenshot 2023-04-17 at 1 40 16 PM

I guess the cleanup code and failure code are both doing it for some reason?

starchart_mycustomdomain.2.aygnlf872ljy@cudm-mgmt01dv.dcm.senecacollege.ca    | {"level":"error","message":"failed to finalize certificate Order state is invalid","stack":"Error: Order state is invalid\n    at LetsEncrypt.completeOrder (/app/build/index.js:1837:15)\n    at Worker.import_bullmq6.Worker.connection [as processFn] (/app/build/index.js:2223:140)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at Worker.processJob (/app/node_modules/bullmq/src/classes/worker.ts:667:22)\n    at Worker.retryIfFailed (/app/node_modules/bullmq/src/classes/worker.ts:858:16)","timestamp":"2023-04-17T17:37:48.305Z"}
starchart_mycustomdomain.2.aygnlf872ljy@cudm-mgmt01dv.dcm.senecacollege.ca    | {"certificateId":2,"level":"info","message":"Certificate flow failed. Running cleanup","rootDomain":"davidhumphrey.stage.mystudentproject.ca","timestamp":"2023-04-17T17:37:48.311Z"}
starchart_mycustomdomain.2.aygnlf872ljy@cudm-mgmt01dv.dcm.senecacollege.ca    | {"certificateId":2,"level":"info","message":"Cleanup completed on failed certificate flow","rootDomain":"davidhumphrey.stage.mystudentproject.ca","timestamp":"2023-04-17T17:37:48.372Z"}

I tried it again, and when it worked, I only receive a single email.

humphd commented 1 year ago

closing in favour of #650