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

DigitalOcean : Region is not available. #941

Closed
bytemare opened this issue May 13, 2018 · 3 comments · Fixed by #976
Closed

DigitalOcean : Region is not available. #941

bytemare opened this issue May 13, 2018 · 3 comments · Fixed by #976

Comments

@bytemare
Copy link

OS / Environment (where do you run Algo on)

Linux secure 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux

Cloud Provider (where do you deploy Algo to)

DigitalOcean

Summary of the problem

The selected region is not available.

The reason is surely the following :
DigitalOcean displays an unavailability for this datacenter, when connected on their interface.
"Due to limited availability we have temporarily disabled droplet creation in this region."

This is not really an Algo bug, but it would come handy if in the future Algo would only present datacenters that are actually available (e.g. by doing a first request with the given API token, and then listing the regions in reply).

I guess the same applies for the other providers, too.

Steps to reproduce the behavior

Launch algo with Digital Ocean selection, then choose "1" (Amsterdam (Datacenter 2)), and continue.

Full log

$ ./algo 

  What provider would you like to use?
    1. DigitalOcean
    2. Amazon Lightsail
    3. Amazon EC2
    4. Microsoft Azure
    5. Google Compute Engine
    6. Scaleway
    7. OpenStack (DreamCompute optimised)
    8. Install to existing Ubuntu 16.04 server (Advanced)

Enter the number of your desired provider
: 1

Enter your API token. The token must have read and write permissions (https://cloud.digitalocean.com/settings/api/tokens):
[pasted values will not be displayed]
: 

Name the vpn server:
[algo.local]: algo


  What region should the server be located in?
    1.  Amsterdam        (Datacenter 2)
    2.  Amsterdam        (Datacenter 3)
    3.  Frankfurt
    4.  London
    5.  New York         (Datacenter 1)
    6.  New York         (Datacenter 2)
    7.  New York         (Datacenter 3)
    8.  San Francisco    (Datacenter 1)
    9.  San Francisco    (Datacenter 2)
    10. Singapore
    11. Toronto
    12. Bangalore
    
Enter the number of your desired region:
[7]: 1

Do you want macOS/iOS clients to enable "VPN On Demand" when connected to cellular networks?
[y/N]: N

Do you want macOS/iOS clients to enable "VPN On Demand" when connected to Wi-Fi?
[y/N]: N

Do you want to install a DNS resolver on this VPN server, to block ads while surfing?
[y/N]: N

Do you want each user to have their own account for SSH tunneling?
[y/N]: N

Do you want the VPN to support Windows 10 or Linux Desktop clients? (enables compatible ciphers and key exchange, less secure)
[y/N]: N

Do you want to retain the CA key? (required to add users in the future, but less secure)
[y/N]: N

PLAY [Configure the server] **************************************************************************************

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

TASK [Local pre-tasks] *******************************************************************************************
included: /path/to/algo/playbooks/local.yml for localhost

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

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

TASK [Change mode for the SSH private key] ***********************************************************************
ok: [localhost]

TASK [Ensure the dynamic inventory exists] ***********************************************************************
ok: [localhost]

TASK [cloud-digitalocean : Set the DigitalOcean Access Token fact] ***********************************************
ok: [localhost]

TASK [cloud-digitalocean : Delete the existing Algo SSH keys] ****************************************************
ok: [localhost]

TASK [cloud-digitalocean : Upload the SSH key] *******************************************************************
changed: [localhost]

TASK [cloud-digitalocean : Creating a droplet...] ****************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: DoError: Region is not available
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Region is not available"}

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

TASK [cloud-digitalocean : fail] *********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

PLAY RECAP *******************************************************************************************************
localhost                  : ok=10   changed=1    unreachable=0    failed=2
@jackivanov
Copy link
Collaborator

Since ansible 2.5 we can move the prompts to the playbook. It would be more elegant way to ask user for any input. Covered here

@bytemare
Copy link
Author

That would effectively be way more elegant than the bash script, besides being awesome.
This would also open the possibility to choose the type of a desired server (e.g. names for scaleway are not up to date anymore).

Thanks !

@whitchapman
Copy link

whitchapman commented Aug 1, 2018

Some possibly related weirdness when selecting a DO region:

What region should the server be located in?
    1.  Amsterdam        (Datacenter 2)
    2.  Amsterdam        (Datacenter 3)
    3.  Frankfurt
    4.  London
    5.  New York         (Datacenter 1)
    6.  New York         (Datacenter 2)
    7.  New York         (Datacenter 3)
    8.  San Francisco    (Datacenter 1)
    9.  San Francisco    (Datacenter 2)
    10. Singapore
    11. Toronto
    12. Bangalore

Given these regions via the script:

  • when I select 7, DO indicates NYC3 region but the IP address is in Canada
  • when I select 8, DO indicates SFO2 region but the IP address is in Amsterdam

I've queried the regions using v2 of the DO API (abridged) which may relate to which regions are actually available:

{
  "regions": [
    {
      "name": "New York 1",
      "slug": "nyc1",
      "available": true
    },
    {
      "name": "Singapore 1",
      "slug": "sgp1",
      "available": true
    },
    {
      "name": "London 1",
      "slug": "lon1",
      "available": true
    },
    {
      "name": "New York 3",
      "slug": "nyc3",
      "available": true
    },
    {
      "name": "Amsterdam 3",
      "slug": "ams3",
      "available": true
    },
    {
      "name": "Frankfurt 1",
      "slug": "fra1",
      "available": true
    },
    {
      "name": "Toronto 1",
      "slug": "tor1",
      "available": true
    },
    {
      "name": "San Francisco 2",
      "slug": "sfo2",
      "available": true
    },
    {
      "name": "Bangalore 1",
      "slug": "blr1",
      "available": true
    }
  ],
  "links": {},
  "meta": {
    "total": 9
  }
}

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.

3 participants