Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt_vm_info fails with "The response content type 'text/html;charset=UTF-8' isn't the expected XML" #407

Open
jangel97 opened this issue Dec 13, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jangel97
Copy link

jangel97 commented Dec 13, 2021

Summary

Hi, module ovirt_vm_info is failing with error: The response content type 'text/html;charset=UTF-8' isn't the expected XML.

Environment:

Python version: 3.6.8
Ansible version: 2.9.11
ovirt-engine-sdk-python version: 4.4.14 

My RHV instance has digital certificate expired. Even though,ovirt_auth has entry insecure set to true the error is still happening. Is this a bug? Or is it something I am missing?

Steps to reproduce

   - name: Authenticating to RHV at {{ rhv_host }}
     ovirt_auth:
       url: "https://{{ rhv_host }}/ovirt-engine/api"
       insecure: true
       kerberos: true
    - name: Get all rhv vms
      ovirt_vm_info:
        auth: "{{ ovirt_auth }}"
      register: all_rhv_vms

Problem

I would expect the previous code to run successfully (even with the RHV instance with cert epired), but I am finding the following error:

The response content type 'text/html;charset=UTF-8' isn't the expected XML

Is this a bug? Could it be that I am missing something? If this is a bug, is there something I can do to bypass it temporarily?

Thanks in advance,

@jangel97 jangel97 added the bug Something isn't working label Dec 13, 2021
@mnecas
Copy link
Member

mnecas commented Feb 14, 2022

HI, are you sure that the Kerberos login is working? The error which you got is because the engine does not return the XML. Could you try logging into the engine with a python api/curl request?
(I'm thinking to implement better logging for these errors.)

@mnecas mnecas removed their assignment Jun 15, 2022
@mohanrajb9
Copy link

Getting similar error when run through ovirt module
ovirtsdk4.Error: The response content type 'text/html; charset=utf-8' isn't the expected JSON
When I tried to hit the API with curl and getting this error

[dev@tm ~]$ curl --cacert ca.crt --request GET --header 'Version: 4' --header 'Accept: application/xml' --user 'user@internal:***********' https://olvm-domain1/ovirt-engine/api -k

Curl response:

<TITLE>Network Error</TITLE> Network Error (dns_unresolved_hostname) ... Your requested host "olvm-domain1" could not be resolved by DNS. ...

But I could able to ping olvm-domain1 good from the host tm.

How to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants