TypeError Only absolute URLs are supported

For this workflow

I sent an image via SMS to Twilio and it was saved at this URL

https://api.twilio.com/2010-04-01/Accounts/AC14865f2cc5abee71309e5c14215dc6a4/Messages/MM7b5a9584622519940b539666fbb7bfde/Media/ME542ad00a5ac596bc4e194352c946ce07

I got this error

ypeErrorOnly absolute URLs are supported

at null.getNodeRequestOptions (/opt/ee/node_modules/node-fetch/lib/index.js:1305:9) at null.null (/opt/ee/node_modules/node-fetch/lib/index.js:1410:19) at null.Promise (null:null:null) at null.fetch (/opt/ee/node_modules/node-fetch/lib/index.js:1407:9) at Object.module.exports (/steps/checkimage.js:14:20) at MessagePort.messageHandler (/opt/nodejs/node_modules/@pipedreamhq/execution-environment/launch_worker.js:447:41) at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24) at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)

The workflow was a copy, not sure if the original had a bug or if I have introduced a bug…

Hi @anon17313468 , would you mind clicking the Share button at the top-right of your workflow and share it with dylan@pipedream.com?

it is public I will see about sharing to a person too

shared

Great thanks. The reason it helps to share the workflow with us is because the event data isn’t public to others - just the workflow code. When you share workflows with collaborators, they can see the event data. It’s helpful to see that when we’re troubleshooting specific issues.

In your case, the workflow depends on the value of a specific environment variable: process.env.MS_COG_EP. Did you create that environment variable? If that’s not set, you’d get the error you’re seeing because the HTTP request on line 14 is making a request to a host that doesn’t exist, so it’ll just try to make a request to the URL:

/vision/v3.1/analyze?visualFeatures=Categories,Description

without any host / domain, so it throws the error you see.

It looks like the workflow expects to talk to a Microsoft service - is that right? It looks like it expects other environment variables (e.g. that contain the subscription key), as well.

Let me know if that helps.

ok cool, I will review and give you an update. Thanks!

Per your suggestion I did add the environment variables, and printed them via the console log

Looks like to use the API it would be similar to this documentation:

Still getting the absolute URL error, not sure if I am supposed to set up the auth separately or is that part of this call? Anyway…

I’d recommend modifying the code to construct the URL before you pass it to axios, e.g.

const url = `https://example.com/path/resource.html`

await axios({
  url,
})

That way, you can console.log its value to see exactly what’s getting passed to axios in the request. That should help you troubleshoot the absolute URL error.

Yes good idea, build the variable and log it