Repository: trailofbits/algo

Issue #1354: Cloudflare 400 Bad Request: invalid header value when deploying to Digital Ocean
Created: 2019-03-12T18:57:06Z
I tried my first algo deployment - which failed with this
[cloud-digitalocean : pause]
Enter your API token. The token must have read and write permissions (https://cloud.digitalocean.com/settings/api/tokens):
(output is hidden):
TASK [cloud-digitalocean : pause] **********************************************
ok: [localhost]
TASK [cloud-digitalocean : Set the token as a fact] ****************************
ok: [localhost]
TASK [cloud-digitalocean : Get regions] ****************************************
fatal: [localhost]: FAILED! => {"cf_ray": "LHR", "changed": false, "connection": "close", "content": "400 Bad Request: invalid header value", "content_type": "text/plain; charset=utf-8", "date": "Tue, 12 Mar 2019 18:25:03 GMT", "expect_ct": "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request: invalid header value", "redirected": false, "server": "cloudflare", "set_cookie": "__cfduid=; expires=Wed, 11-Mar-20 xx:xx:xxGMT; path=/; domain=.digitalocean.com; HttpOnly", "status": 400, "transfer_encoding": "chunked", "url": "https://api.digitalocean.com/v2/regions"}
??? It doesn't say in the documentation what part of the token should be entered - the name or the long hexadecimal value. I entered the latter and it said OK, so I assume it is failing because the Ansible script is asking for a region list URL which is broken ???

Duplicate issue #1915: Digital Ocean Get Regions - HTTP Error 400
Created: 2020-11-17T23:04:47Z
While running Algo on Ubuntu inside Windows 10, Algo fails to retrieve list of regions. I am unable to complete the process despite multiple attempts over 48 hours.  I have tried using different Digital Ocean accounts and different Digital Ocean API keys. I have tried using different DNS servers.
--> Please include the following block of text when reporting issues:
Algo running on: Ubuntu 18.04.5 LTS (Virtualized: wsl)
Created from git fork. Last commit: ebec20e Multiple Azure fixes (#1908)
Python 3.6.9
Runtime variables:
algo_provider "digitalocean"
algo_ondemand_cellular "True"
algo_ondemand_wifi "True"
algo_ondemand_wifi_exclude "U2VtcGVyV2lGaSwgc2tpdHRsZXM="
algo_dns_adblocking "True"
algo_ssh_tunneling "False"
wireguard_enabled "True"
dns_encryption "True"
TASK [Display the invocation environment] **********************************************************************************************************************************************************************************
changed: [localhost -> localhost]
TASK [Install the requirements] ********************************************************************************************************************************************************************************************
ok: [localhost -> 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 -> localhost]
[cloud-digitalocean : pause]
Enter your API token. The token must have read and write permissions (https://cloud.digitalocean.com/settings/api/tokens):
(output is hidden):
TASK [cloud-digitalocean : pause] ******************************************************************************************************************************************************************************************
ok: [localhost]
TASK [cloud-digitalocean : Set the token as a fact] ************************************************************************************************************************************************************************
ok: [localhost]
TASK [cloud-digitalocean : Get regions] ************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"cf_cache_status": "DYNAMIC", "cf_ray": "5f3cf4d9dc4ce1f6-ORD", "cf_request_id": "0679f75c260000e1f657ab1000000001", "changed": false, "connection": "close", "content": "400 Bad Request: invalid header value", "content_type": "text/plain; charset=utf-8", "date": "Tue, 17 Nov 2020 22:40:58 GMT", "elapsed": 0, "expect_ct": "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request: invalid header value", "redirected": false, "server": "cloudflare", "set_cookie": "__cfduid=d95efc97f4016ba165dba722229822f191605652857; expires=Thu, 17-Dec-20 22:40:57 GMT; path=/; domain=.digitalocean.com; HttpOnly; SameSite=Lax", "status": 400, "transfer_encoding": "chunked", "url": "https://api.digitalocean.com/v2/regions"}
included: /home/jon/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=28   changed=1    unreachable=0    failed=1    skipped=0    rescued=1    ignored=0

Closing comment (2020-11-18T13:47:12Z): I can't recreate this (though I'm not using WSL):
Algo running on: Ubuntu 18.04.5 LTS (Virtualized: lxc)
Created from git clone. Last commit: ebec20e Multiple Azure fixes (#1908)
Python 3.6.9

A similar error was reported in #1354 but it apparently went away on its own.
Please post here if you figure out what's going on.