fedora-infra / tiny-stage

Development / Testing Environment for Fedora Infra
8 stars 8 forks source link

vagrant up auth fails with "You need to install "jmespath" prior to running json_query filter" #57

Closed keestux closed 1 year ago

keestux commented 1 year ago

Running vagrant up auth results in a failure

TASK [ipsilon : copy ipsilon admin configuration] ******************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleError: You need to install "jmespath" prior to running json_query filter
fatal: [auth]: FAILED! => changed=false 
  msg: 'AnsibleError: You need to install "jmespath" prior to running json_query filter'
keestux commented 1 year ago

Installing python3-jmespath helped my to get a bit further

diff --git a/README.md b/README.md
index c706197..f89645e 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ There are also many additional machines for development and testing purposes tha
 tiny-stage uses Vagrant to create and manage machines. Prepare your machine to run tiny-stage with the commands:

 ` ` `
-$ sudo dnf install ansible ansible-freeipa libvirt vagrant-libvirt vagrant-sshfs vagrant-hostmanager
+$ sudo dnf install ansible ansible-freeipa libvirt vagrant-libvirt vagrant-sshfs vagrant-hostmanager python3-jmespath
 $ sudo systemctl enable libvirtd
 $ sudo systemctl start libvirtd
 ` ` `

(( the triple back-quote was modified in the diff ))

keestux commented 1 year ago

Next failure :-(

TASK [oidc-register : register the application with oidc-register] *************
fatal: [auth]: FAILED! => changed=true 
  cmd: oidc-register --debug --output-file /home/vagrant/test-auth.client_secrets.json https://ipsilon.tinystage.test/idp/openidc/ https://auth.tinystage.test/test-auth/oidc/oidc_callback
  delta: '0:00:00.136738'
  end: '2023-10-03 15:06:15.735454'
  msg: non-zero return code
  rc: 1
  start: '2023-10-03 15:06:15.598716'
  stderr: |-
    ERROR:oidc-register:Error caught when discovering OP information:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/oidc_register/registration_util.py", line 69, in main
        OP = discovery.discover_OP_information(args.provider_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/oidc_register/discovery.py", line 44, in discover_OP_information
        return _json_loads(content)
               ^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/oidc_register/__init__.py", line 31, in _json_loads
        return json.loads(content)
               ^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.11/json/__init__.py", line 346, in loads
        return _default_decoder.decode(s)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.11/json/decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  stderr_lines: <omitted>
  stdout: |-
    Error discovering OP information
    Expecting value: line 1 column 1 (char 0)
  stdout_lines: <omitted>
abompard commented 1 year ago

Thanks for reporting. This looks like Ipsilon (the OIDC IDP) isn't replying correctly to oidc-register. I'll try to reproduce it, can you check that ipsilon is running properly? It should be at http://ipsilon.tinystage.test.

keestux commented 1 year ago

This all happens during the first time bringing up auth. After the failure auth is removed and deleted. So now Ipsilon (aka auth) is not running.

abompard commented 1 year ago

OK, the auth VM boots up fine for me now, could you check with the latest commit please?

keestux commented 1 year ago

@abompard thanks. It looks like that solved it.