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

Update-users failure (Could not find or access 'configs/...) #14726

Open
RochMoreau opened this issue Jun 11, 2024 · 0 comments
Open

Update-users failure (Could not find or access 'configs/...) #14726

RochMoreau opened this issue Jun 11, 2024 · 0 comments

Comments

@RochMoreau
Copy link

RochMoreau commented Jun 11, 2024

Describe the bug

When trying to update users by calling ./algo update-users, the CLI throws an error.

I am on MacOS M1, the remote server is a custom Ubuntu 22.04

To Reproduce

Steps to reproduce the behavior:

  1. Have an existing VPN server (configured with Algo, ensure a directory is correctly set in config/)
  2. call ./algo update-users
  3. Select option 1, corresponding to the server to be updated

Expected behavior

The process continues and updates users on the selected server

Additional context

Observing the behavior, I see that the options for the server-selection step includes the IP repeated 2 times. This string is then used as the server identifier when fetching the server config. The bug comes from this.
In short, let's say the server IP is x.x.x.x. There is a directory config/x.x.x.x. The CLI gives the following choice:

1. x.x.x.xx.x.x.x

(notice how the IP is repeated twice). When the user selects the option 1, instead of just using the ip, the CLI uses the full string, i.e. the IP repeated twice. The CLI now looks for the server config at config/x.x.x.xx.x.x.x/ instead of config/x.x.x.x

The line causing this is line 30 from users.yml: '{{ config.IP_subject_alt_name }}'
I tracked down the introduction of this behavior in the PR #14718 from may 5 2024, so about 1 month old.

Full log

[Server address prompt]
Select the server to update user list below:
    1. x.x.x.xx.x.x.x

:

TASK [Server address prompt] ****************************************************************************************************************************************************
ok: [localhost]

TASK [Set facts based on the input] *********************************************************************************************************************************************
ok: [localhost]

TASK [Import host specific variables] *******************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "ansible_included_var_files": [], "changed": false, "message": "Could not find or access 'configs/x.x.x.xx.x.x.x/.config.yml'\nSearched in:\n\t/Users/USER/PATH/algo/vars/configs/x.x.x.xx.x.x.x/.config.yml\n\t/Users/USER/PATH/algo/configs/x.x.x.xx.x.x.x/.config.yml\n\t/Users/USER/PATH/algo/vars/configs/x.x.x.xx.x.x.x/.config.yml\n\t/Users/USER/PATH/algo/configs/x.x.x.xx.x.x.x/.config.yml on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}

TASK [include_tasks] ************************************************************************************************************************************************************
included: /Users/USER/PATH/algo/playbooks/rescue.yml for localhost

TASK [debug] ********************************************************************************************************************************************************************
ok: [localhost] => {
    "fail_hint": [
        "Sorry, but something went wrong!",
        "Please check the troubleshooting guide.",
        "https://trailofbits.github.io/algo/troubleshooting.html"
    ]
}

TASK [Fail the installation] ****************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

PLAY RECAP **********************************************************************************************************************************************************************
localhost                  : ok=7    changed=0    unreachable=0    failed=1    skipped=0    rescued=1    ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant