ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

AxiosError: Request failed with status code 400, #208

Closed bskou57 closed 1 week ago

bskou57 commented 3 weeks ago

Hi

I just add awx connection with user/password and I get below error when I click "Test Awx"

AxiosError: Request failed with status code 400,

I am running version 5.0.4 of ansibleforms (to fix issue with use_credential)

Thanks for your support

bskou57 commented 3 weeks ago

Hi

I do not have dns/firewall issue

Note that I already configured without issue ldap connection (from AD) and also github connection from my private repo

I can successfully ping and nc https port of awx server from docker container

Note that I am using custom https certificate on our aansible awx server

Thanks for your help

bskou57 commented 3 weeks ago

A HTTP 400 status code usually means that the request was malformed or invalid, and the server could not understand it. The error could be due to a wrong URL, a missing or incorrect parameter, or an authorization issue. To fix this error, you would need to check the request and response objects to identify what went wrong, and correct the issue.

ansibleguy76 commented 3 weeks ago

I simply can't reproduce this. can you curl from within the container and see the http response ? what do the logs for AF say ? You can get them and see them through the help menu -> logs. Or you can do "docker logs"

bskou57 commented 3 weeks ago

Hello

works fine 👍 /app # ping tower.cgroup.com PING tower.cedelgroup.com (10.16.13.11): 56 data bytes 64 bytes from 10.16.13.11: seq=0 ttl=63 time=0.283 ms ^C --- tower.cedelgroup.com ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 0.283/0.283/0.283 ms /app # nc -vvv tower.cgroup.com 443 tower.cedelgroup.com (10.16.13.11:443) open

bskou57 commented 3 weeks ago

2024-08-21 15:42:01:421 info: Loading /app/dist/persistent/forms.yaml 2024-08-21 15:42:01:421 info: merging file hello_world.yml 2024-08-21 15:42:01:421 info: merging file maintenance.yaml 2024-08-21 15:42:01:421 notice: Launching form HelloWorld 2024-08-21 15:42:01:421 notice: Creating job 2024-08-21 15:42:01:421 info: searching job template HelloWorld 2024-08-21 15:42:01:421 notice: Updating job 113 failed 2024-08-21 15:42:01:421 notice: Sending status mail for jobid 113 2024-08-21 15:42:01:421 notice: Finding jobid 113 2024-08-21 15:42:01:421 info: Finding job 113 2024-08-21 15:42:01:421 notice: No notifications set 2024-08-21 15:42:01:421 error: Errors : failed to launch awx template HelloWorld Request failed with status code 400 2024-08-21 15:42:03:423 info: Finding job 113 2024-08-21 15:42:05:425 info: Finding job 113

ansibleguy76 commented 3 weeks ago

Hi,

This log output is not coming from the "test connection". You are launching the helloworld test form. Which targets the template HelloWorld => if you don't have that template, it makes sense you get a 400 error. But the awx test connection is simply loading all templates as test. That should work fine. Can you verify ?

Can you also do a CTRL-F5 (after an upgrade it happens that old client code is cached)

ansibleguy76 commented 3 weeks ago

image

do you see that test button ? Does that work ?

ansibleguy76 commented 3 weeks ago

If all is clear and fixed, can you let me know ?