Getting URI Error While Receiving Response from Ansible

Hi everyone,

I’m encountering an issue with my Ansible setup. When trying to send a request to a specific URI, I receive an error and the request is not sent. The URI in question is similar to https://example.com/api/v2/jobs/<job_id>

Steps Taken:
Verified the URI is correct and accessible.
Checked authentication tokens and credentials.
Ensured there are no network issues or firewall rules blocking the request.
Reviewed AWX logs for any related error messages.
Confirmed the API version being used is correct.

Any insights or suggestions on how to resolve this issue would be greatly appreciated!

Thanks in advance!

and what, pray, may the error be?

yes all URLs are pretty similar to that, though it’s quite doubtful you’re using example.com

1 Like

Thank you for your response.

The specific error message I’m receiving is: Request not sent to uri https://ansible.com/api/v2/jobs/123

Regarding the URI, you’re right, I’m not using example.com. The actual domain is hidden for privacy reasons, but the structure is the same as https://<actual-domain>/api/v2/jobs/<job_id>.

Any insights on what might be causing this error would be greatly appreciated!

That should have a “/” after the <job_id>. Maybe it isn’t handling the redirect?

Thanks for your input. The URI I’m using does include a trailing slash after <job_id>, so it looks like this: https:///api/v2/jobs/<job_id>/.

However, I’m still encountering the error. Could there be another reason why the request isn’t being sent?

How are you sending the request? With a module? Which? with which parameters? With a utility? Which? How?

Thanks for your follow-up.

The requests are being sent from ServiceNow using a MID server. Here are the technical details:

  • Request Method: The requests are made using the ServiceNow REST API.
  • MID Server: The MID server is configured to handle the communication between ServiceNow and the Ansible AWX API.
  • URI: The URI format is https://<actual-domain>/api/v2/jobs/<job_id>/.
  • Authentication: The requests include the necessary authentication tokens.

Despite having the correct URI and authentication, the requests are not being sent, and I’m encountering an error. Could there be any additional configurations or settings I need to check?

You say the request is not being sent (note I explicitly repeat “sent” and not “received”) and the MID server is configured to handle the communication between ServiceNow and the Ansible AWX API, so that’s where I’d look. I don’t know what a “MID server” is, but it’s bound to have some way of logging what’s going on… It might be something as simple as a firewall between it and AWX or the MID server not being able to resolve the domain name in the URL.

What I’d try to do is login to the MID server system and attempt a curl to the target URL to see if at least the communication is set up correctly.

A mid-server is basically a Service Now agent running on an on-prem server so that catalog requests can interact with on-prem customer resources.

If the OP could paste the entire error as received from Service Now (edit out any sensitive URLs), it might be more helpful to figure out the problem. For example, when I google “servicenow mid server request not sent to uri” and go to Help on REST with error : Request not sent to uri ... - ServiceNow Community it looks like this person had some more information in their error than what you’ve been posting. It’s also interesting in that thread implies an SSL signer issue on the target URL; could that be related to what you’re seeing?

At any rate, if you can hit the AWX job URL from some part of the environment but the Service Now server can’t, you’ll need someone with access to Service Now and/or the mid-server to see if they can hit the URL, or a Networking tech to look in to it, or some other Enterprise-y drudgery we’re all accustomed to. It could also be there was a configuration mistake and the Service Now workflow isn’t actually using the mid-server. Tough to say with the amount of detail provided so far.

If you’re asking if there’s some kind of known bug in AWX that prevents it from accepting requests from arbitrary systems like ServiceNow, the answer I can give from my experience is “no.”