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

Error creating Vultr server in non-default region #14712

Closed
matthewhall79 opened this issue Mar 30, 2024 · 0 comments · Fixed by #14713
Closed

Error creating Vultr server in non-default region #14712

matthewhall79 opened this issue Mar 30, 2024 · 0 comments · Fixed by #14713

Comments

@matthewhall79
Copy link
Contributor

Describe the bug

Deploying to Vultr fails on task 'cloud-vultr : Creating a server' when a non-default region is chosen. The error from the Vultr API is 'Cannot add instance plan is not available in the selected region'.

To Reproduce

Steps to reproduce the behavior:

  1. Run ./algo, selecting Vultr as the provider (7).
  2. When prompted to select a region, enter any valid number, rather than accepting the default.

Expected behavior

Deployment should succeed in the selected Vultr region.

Additional context

The problem exists due to a gap in the fix for #14707, leading to the region name being passed to the Vultr API for non-default regions, rather than the three-letter region code.

Full log

PLAY [localhost] ******************************************************************************

TASK [Gathering Facts] ************************************************************************
ok: [localhost]

TASK [Playbook dir stat] **********************************************************************
ok: [localhost]

TASK [Ensure Ansible is not being run in a world writable directory] **************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}
[DEPRECATION WARNING]: Use 'ansible.utils.ipaddr' module instead. This feature will be removed
 from ansible.netcommon in a release after 2024-01-01. Deprecation warnings can be disabled by
 setting deprecation_warnings=False in ansible.cfg.
[WARNING]: The value '' is not a valid IP address or network, passing this value to ipaddr
filter might result in breaking change in future.

TASK [Ensure the requirements installed] ******************************************************
ok: [localhost]

TASK [Set required ansible version as a fact] *************************************************
ok: [localhost] => (item=ansible==9.1.0)

TASK [Just get the list from default pip] *****************************************************
ok: [localhost]

TASK [Verify Python meets Algo VPN requirements] **********************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Verify Ansible meets Algo VPN requirements] *********************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}
[WARNING]: Found variable using reserved name: no_log

PLAY [Ask user for the input] *****************************************************************

TASK [Gathering Facts] ************************************************************************
ok: [localhost]
[Cloud prompt]
What provider would you like to use?
    1. DigitalOcean
    2. Amazon Lightsail
    3. Amazon EC2
    4. Microsoft Azure
    5. Google Compute Engine
    6. Hetzner Cloud
    7. Vultr
    8. Scaleway
    9. OpenStack (DreamCompute optimised)
    10. CloudStack (Exoscale optimised)
    11. Linode
    12. Install to existing Ubuntu latest LTS server (for more advanced users)

Enter the number of your desired provider
:

TASK [Cloud prompt] ***************************************************************************
ok: [localhost]

TASK [Set facts based on the input] ***********************************************************
ok: [localhost]
[VPN server name prompt]
Name the vpn server
[algo]
:

TASK [VPN server name prompt] *****************************************************************
ok: [localhost]
[Cellular On Demand prompt]
Do you want macOS/iOS clients to enable "Connect On Demand" when connected to cellular networks?
[y/N]
:

TASK [Cellular On Demand prompt] **************************************************************
ok: [localhost]
[Wi-Fi On Demand prompt]
Do you want macOS/iOS clients to enable "Connect On Demand" when connected to Wi-Fi?
[y/N]
:

TASK [Wi-Fi On Demand prompt] *****************************************************************
ok: [localhost]
[Retain the PKI prompt]
Do you want to retain the keys (PKI)? (required to add users in the future, but less secure)
[y/N]
:

TASK [Retain the PKI prompt] ******************************************************************
ok: [localhost]
[DNS adblocking prompt]
Do you want to enable DNS ad blocking on this VPN server?
[y/N]
:

TASK [DNS adblocking prompt] ******************************************************************
ok: [localhost]
[SSH tunneling prompt]
Do you want each user to have their own account for SSH tunneling?
[y/N]
:

TASK [SSH tunneling prompt] *******************************************************************
ok: [localhost]

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

PLAY [Provision the server] *******************************************************************

TASK [Gathering Facts] ************************************************************************
ok: [localhost]

--> Please include the following block of text when reporting issues:

Algo running on: macOS 14.3.1
Created from git clone. Last commit: a4a9d6d Fix Vultr collection (#14707)
Python 3.12.2
Runtime variables:
    algo_provider "vultr"
    algo_ondemand_cellular "False"
    algo_ondemand_wifi "False"
    algo_ondemand_wifi_exclude "X251bGw="
    algo_dns_adblocking "True"
    algo_ssh_tunneling "False"
    wireguard_enabled "True"
    dns_encryption "True"

TASK [Display the invocation environment] *****************************************************
changed: [localhost]

TASK [Install the requirements] ***************************************************************
ok: [localhost]

TASK [Generate the SSH private key] ***********************************************************
ok: [localhost]

TASK [Generate the SSH public key] ************************************************************
ok: [localhost]

TASK [Copy the private SSH key to /tmp] *******************************************************
ok: [localhost]

TASK [Include a provisioning role] ************************************************************
[cloud-vultr : pause]
Enter the local path to your configuration INI file
(https://trailofbits.github.io/algo/cloud-vultr.html):
:

TASK [cloud-vultr : pause] ********************************************************************
ok: [localhost]

TASK [cloud-vultr : Set the token as a fact] **************************************************
ok: [localhost]

TASK [cloud-vultr : Get regions] **************************************************************
ok: [localhost]

TASK [cloud-vultr : Format regions] ***********************************************************
ok: [localhost]

TASK [cloud-vultr : Set regions as a fact] ****************************************************
ok: [localhost]

TASK [cloud-vultr : Set default region] *******************************************************
ok: [localhost]
[cloud-vultr : pause]
What region should the server be located in?
(https://www.vultr.com/locations/):
    1.   Melbourne (mel)
    2.   Sydney (syd)
    3.   São Paulo (sao)
    4.   Toronto (yto)
    5.   Santiago (scl)
    6.   Frankfurt (fra)
    7.   Madrid (mad)
    8.   Paris (cdg)
    9.   London (lhr)
    10.   Manchester (man)
    11.   Tel Aviv (tlv)
    12.   Bangalore (blr)
    13.   Delhi NCR (del)
    14.   Mumbai (bom)
    15.   Osaka (itm)
    16.   Tokyo (nrt)
    17.   Seoul (icn)
    18.   Mexico City (mex)
    19.   Amsterdam (ams)
    20.   Warsaw (waw)
    21.   Stockholm (sto)
    22.   Singapore (sgp)
    23.   Atlanta (atl)
    24.   Chicago (ord)
    25.   Dallas (dfw)
    26.   Honolulu (hnl)
    27.   Los Angeles (lax)
    28.   Miami (mia)
    29.   New Jersey (ewr)
    30.   Seattle (sea)
    31.   Silicon Valley (sjc)
    32.   Johannesburg (jnb)

Enter the number of your desired region
[29]
:

TASK [cloud-vultr : pause] ********************************************************************
ok: [localhost]

TASK [cloud-vultr : Set the desired region as a fact] *****************************************
ok: [localhost]

TASK [cloud-vultr : Creating a firewall group] ************************************************
ok: [localhost]

TASK [cloud-vultr : Creating firewall rules] **************************************************
ok: [localhost] => (item={'protocol': 'tcp', 'port': 4160, 'ip': 'v4', 'cidr': '0.0.0.0/0'})
ok: [localhost] => (item={'protocol': 'tcp', 'port': 4160, 'ip': 'v6', 'cidr': '::/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 500, 'ip': 'v4', 'cidr': '0.0.0.0/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 500, 'ip': 'v6', 'cidr': '::/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 4500, 'ip': 'v4', 'cidr': '0.0.0.0/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 4500, 'ip': 'v6', 'cidr': '::/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 51820, 'ip': 'v4', 'cidr': '0.0.0.0/0'})
ok: [localhost] => (item={'protocol': 'udp', 'port': 51820, 'ip': 'v6', 'cidr': '::/0'})

TASK [cloud-vultr : Upload the startup script] ************************************************
ok: [localhost]

TASK [cloud-vultr : Creating a server] ********************************************************
fatal: [localhost]: FAILED! => {"changed": false, "fetch_url_info": {"body": "{\"error\":\"Cannot add instance plan is not available in the selected region\",\"status\":400}", "connection": "close", "content-type": "application/json", "date": "Wed, 27 Mar 2024 04:35:10 GMT", "msg": "HTTP Error 400: Bad Request", "server": "nginx", "status": 400, "strict-transport-security": "max-age=63072000", "transfer-encoding": "chunked", "url": "https://api.vultr.com/v2/instances", "x-content-type-options": "nosniff", "x-frame-options": "DENY", "x-robots-tag": "noindex,noarchive", "x-user": "vultr@matthall.co.uk"}, "msg": "Failure while calling the Vultr API v2 with POST for \"/instances\"."}
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

Successfully merging a pull request may close this issue.

1 participant