parcelvoy/platform

Error 400 from API with send proof

Closed this issue · 2 comments

mjp0 commented

I'm testing Parcelvoy and I'm running into errors with send proof. I added SMTP gateway, created an email campaign, added a template and was trying to test the thing with send proof but I get error An error occurred with this request.. From the logs I see that both preview and send proof endpoints in API service give the following error:

api-1     |   TypeError [ERR_INVALID_URL]: Invalid URL
api-1     |       at new NodeError (node:internal/errors:405:5)
api-1     |       at new URL (node:internal/url:676:13)
api-1     |       at paramsToEncodedLink (/usr/src/app/build/render/LinkService.js:18:17)
api-1     |       at unsubscribeEmailLink (/usr/src/app/build/subscriptions/SubscriptionService.js:159:50)
api-1     |       at Render (/usr/src/app/build/render/index.js:79:113)
api-1     |       at EmailTemplate.compile (/usr/src/app/build/render/Template.js:93:37)
api-1     |       at EmailChannel.send (/usr/src/app/build/providers/email/EmailChannel.js:25:35)
ui-1      | 172.22.0.1 - - [11/Dec/2024:09:23:14 +0000] "POST /api/admin/projects/1/templates/2/proof HTTP/1.1" 400 65 "https://marketing.machian.com/projects/1/campaigns/2/preview" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" "109.108.31.211"
api-1     |       at sendProof (/usr/src/app/build/render/TemplateService.js:109:24)
api-1     |       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
api-1     |       at async /usr/src/app/build/render/TemplateController.js:287:16
api-1     |       at async /usr/src/app/build/render/TemplateController.js:196:12
api-1     |       at async serve (/usr/src/app/node_modules/koa-static/index.js:59:5)
api-1     |       at async cors (/usr/src/app/node_modules/@koa/cors/index.js:109:16)
api-1     |       at async /usr/src/app/build/api.js:48:17

It looks like something with unsubscribe link but I'm not sure what could cause this since I'm running on default settings from the repo.

I would check that your BASE_URL is set correctly to your domain name. The error looks like it's unable to generate a valid URL which typically points back to a missconfiguration somewhere and that's the first spot to check!

mjp0 commented

That fixed it, thanks!