trailofbits / algo

Set up a personal VPN in the cloud
https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
GNU Affero General Public License v3.0
28.49k stars 2.3k forks source link

Azure Deployment ModuleNotFoundError: No module named 'azure.mgmt.rdbms.postgresql_flexibleservers' #14704

Open MHN452 opened 3 months ago

MHN452 commented 3 months ago

Algo running on: Ubuntu 22.04.4 LTS (Virtualized: wsl) Created from git clone. Last commit: 74051d0 Update README.md dependencies (#14634) Python 3.10.12 Runtime variables: algo_provider "azure" algo_ondemand_cellular "True" algo_ondemand_wifi "True" algo_ondemand_wifi_exclude "X251bGw=" algo_dns_adblocking "True" algo_ssh_tunneling "False" wireguard_enabled "True" dns_encryption "True"

I keep getting this error when atttempting to deploy Algo on Azure

TASK [cloud-azure : Create AlgoVPN Server] ***** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'azure.mgmt.rdbms.postgresql_flexibleservers' fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on Haikal-PC's Python /home/haika/algo/.env/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

Full error in verbose is as follows

TASK [cloud-azure : Create AlgoVPN Server] ***** task path: /home/haika/algo/roles/cloud-azure/tasks/main.yml:14 The full traceback is: Traceback (most recent call last): File "/tmp/ansible_azure_rm_deployment_payload_pjddvq6q/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py", line 261, in from azure.mgmt.rdbms.postgresql_flexibleservers import PostgreSQLManagementClient as PostgreSQLFlexibleManagementClient ModuleNotFoundError: No module named 'azure.mgmt.rdbms.postgresql_flexibleservers' fatal: [localhost]: FAILED! => { "changed": false, "invocation": { "module_args": { "ad_user": null, "adfs_authority_url": null, "api_profile": "latest", "append_tags": true, "auth_source": "auto", "cert_validation_mode": null, "client_id": "", "cloud_environment": "AzureCloud", "deployment_mode": "incremental", "deployment_name": "NaVPN", "location": "southeastasia", "log_mode": null, "log_path": null, "name": "NaVPN", "parameters": { "SshPort": { "value": 4160 }, "UserData": { "value": "I2Nsb3VkLWNvbmZpZwpvdXRwdXQ6IHthbGw6ICd8IHRlZSAtYSAvdmFyL2xvZy9jbG91ZC1pbml0LW91dHB1dC5sb2cnfQoKcGFja2FnZV91cGRhdGU6IHRydWUKcGFja2FnZV91cGdyYWRlOiB0cnVlCgpwYWNrYWdlczoKIC0gc3VkbwoKdXNlcnM6CiAgLSBkZWZhdWx0CiAgLSBuYW1lOiBhbGdvCiAgICBob21lZGlyOiAvaG9tZS9hbGdvCiAgICBzdWRvOiBBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMCiAgICBncm91cHM6IGFkbSxuZXRkZXYKICAgIHNoZWxsOiAvYmluL2Jhc2gKICAgIGxvY2tfcGFzc3dkOiB0cnVlCiAgICBzc2hfYXV0aG9yaXplZF9rZXlzOgogICAgICAtICJzc2gtcnNhIEFBQUFCM056YUMxeWMyRUFBQUFEQVFBQkFBQUNBUUM3cDZTMmcyMGtoQ09vcTNVaCt2cUVKRnU3SS85Q0VwdkFVV1lBOEdNWmZzTU9nQTVrK2lkNEJpY3l3UndxSng3OENhY0hYM3dlN0VaMmdDRGNvNGM3aWxWSExxSkQ5TWZScUJFVVVObDEwbzBhMktJakNYRURVVjJxQTdkcDlCSlV5WVlWc3dUYUJmc3B3Q0xUUUFmaEE0RC8xcFdsWm1NaGpOZ0JhVVlraFQxM3pDclN5WUF5bk9oUi94S3R2cHBMY3hQeWI0aE84WkZnS3BMTmlXOEptSXRJWlAwd1ZvR3o3V3RkMmwrOUlPV0gzQ28yWFJYYkIxb1A1bmdQUHNJMFNGMGVFQzJNWjJBbEx3djkzYzdSaGhXRkJZZE9ydFRDZEg2Y1BRT3RKOTlVNVRDUEdlVVVUMFZEVlJJUnNIZDRuOHFMdkVqZjJwVkJHZ2ZYNHFoaHNsOGxMVS84OV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{ "value": 51820 }, "imageReferenceOffer": { "value": "0001-com-ubuntu-minimal-jammy-daily" }, "imageReferencePublisher": { "value": "Canonical" }, "imageReferenceSku": { "value": "minimal-22_04-daily-lts" }, "imageReferenceVersion": { "value": "latest" }, "osDiskType": { "value": "Standard_LRS" }, "sshKeyData": { "value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7p6S2g20khCOoq3Uh+vqEJFu7I/9CEpvAUWYA8GMZfsMOgA5k+id4BicywRwqJx78CacHX3we7EZ2gCDco4c7ilVHLqJD9MfRqBEUUNl10o0a2KIjCXEDUV2qA7dp9BJUyYYVswTaBfspwCLTQAfhA4D/1pWlZmMhjNgBaUYkhT13zCrSyYAynOhR/xKtvppLcxPyb4hO8ZFgKpLNiW8JmItIZP0wVoGz7Wtd2l+9IOWH3Co2XRXbB1oP5ngPPsI0SF0eEC2MZ2AlLwv93c7RhhWFBYdOrtTCdH6cPQOtJ99U5TCPGeUUT0VDVRIRsHd4n8qLvEjf2pVBGgfX4qhhsl8lLU/89W0iNnA7pfV71wxwgNDldhylt0pYTyGQges17lL7HeKyiK2S+6/sGNXebE1cZu4Y8w17yUoj0VoHC7XuQHNsRdDm4epmTQAIJV82UYzeKpngnd9I6aiG+ULDEP6UiS/exNZW8p5FBho4zw43IwXhB8gZAxh57U7BG8uo1+aRdv6FvRay64wcdO9P0iozBKn+5xgCGah1wu3hTYfO+UBHhfljKe2E5h0dlIgzESry9r1otcLcrH2DgGG1CC1OlAsVhU2syq704Ylepf1xRG1uZb7Pi1Tv2kH/FDq6WZW5bT1DKVVAdgHShla8/OLfHrhqtODZdoEpC54jgQ==" }, "vmSize": { "value": "Standard_B1S" } }, "parameters_link": null, "password": null, "profile": null, "resource_group": "NaVPN", "resource_group_name": "NaVPN", "secret": "", "state": "present", "subscription_id": "", "tags": null, "template": { "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", "contentVersion": "1.0.0.0", "outputs": { "publicIPAddresses": { "type": "string", "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses',resourceGroup().name),providers('Microsoft.Network', 'publicIPAddresses').apiVersions[0]).ipAddress]" } }, "parameters": { "SshPort": { "type": "int" }, "UserData": { "type": "string" }, "WireGuardPort": { "type": "int" }, "imageReferenceOffer": { "type": "string" }, "imageReferencePublisher": { "type": "string" }, "imageReferenceSku": { "type": "string" }, "imageReferenceVersion": { "type": "string" }, "osDiskType": { "type": "string" }, "sshKeyData": { "type": "string" }, "vmSize": { "type": "string" } }, "resources": [ { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[resourceGroup().name]", "properties": { "securityRules": [ { "name": "AllowSSH", "properties": { "access": "Allow", "description": "Allow SSH", "destinationAddressPrefix": "", "destinationPortRange": "[parameters('SshPort')]", "direction": "Inbound", "priority": 100, "protocol": "Tcp", "sourceAddressPrefix": "", "sourcePortRange": "" } }, { "name": "AllowIPSEC500", "properties": { "access": "Allow", "description": "Allow UDP to port 500", "destinationAddressPrefix": "", "destinationPortRange": "500", "direction": "Inbound", "priority": 110, "protocol": "Udp", "sourceAddressPrefix": "", "sourcePortRange": "" } }, { "name": "AllowIPSEC4500", "properties": { "access": "Allow", "description": "Allow UDP to port 4500", "destinationAddressPrefix": "", "destinationPortRange": "4500", "direction": "Inbound", "priority": 120, "protocol": "Udp", "sourceAddressPrefix": "", "sourcePortRange": "" } }, { "name": "AllowWireGuard", "properties": { "access": "Allow", "description": "Locks inbound down to ssh default port 22.", "destinationAddressPrefix": "", "destinationPortRange": "[parameters('WireGuardPort')]", "direction": "Inbound", "priority": 130, "protocol": "Udp", "sourceAddressPrefix": "", "sourcePortRange": "" } } ] }, "type": "Microsoft.Network/networkSecurityGroups" }, { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[resourceGroup().name]", "properties": { "publicIPAllocationMethod": "Static" }, "type": "Microsoft.Network/publicIPAddresses" }, { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[resourceGroup().name]", "properties": { "addressSpace": { "addressPrefixes": [ "10.10.0.0/16" ] }, "subnets": [ { "name": "[resourceGroup().name]", "properties": { "addressPrefix": "10.10.0.0/24" } } ] }, "type": "Microsoft.Network/virtualNetworks" }, { "apiVersion": "2015-06-15", "dependsOn": [ "[concat('Microsoft.Network/networkSecurityGroups/', resourceGroup().name)]", "[concat('Microsoft.Network/publicIPAddresses/', resourceGroup().name)]", "[concat('Microsoft.Network/virtualNetworks/', resourceGroup().name)]" ], "location": "[resourceGroup().location]", "name": "[resourceGroup().name]", "properties": { "ipConfigurations": [ { "name": "ipconfig1", "properties": { "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "[resourceId('Microsoft.Network/publicIPAddresses', resourceGroup().name)]" }, "subnet": { "id": "[variables('subnet1Ref')]" } } } ], "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', resourceGroup().name)]" } }, "type": "Microsoft.Network/networkInterfaces" }, { "apiVersion": "2016-04-30-preview", "dependsOn": [ "[concat('Microsoft.Network/networkInterfaces/', resourceGroup().name)]" ], "location": "[resourceGroup().location]", "name": "[resourceGroup().name]", "properties": { "hardwareProfile": { "vmSize": "[parameters('vmSize')]" }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces', resourceGroup().name)]" } ] }, "osProfile": { "adminUsername": "algo", "computerName": "[resourceGroup().name]", "customData": "[parameters('UserData')]", "linuxConfiguration": { "disablePasswordAuthentication": true, "ssh": { "publicKeys": [ { "keyData": "[parameters('sshKeyData')]", "path": "/home/algo/.ssh/authorized_keys" } ] } } }, "storageProfile": { "imageReference": { "offer": "[parameters('imageReferenceOffer')]", "publisher": "[parameters('imageReferencePublisher')]", "sku": "[parameters('imageReferenceSku')]", "version": "[parameters('imageReferenceVersion')]" }, "osDisk": { "createOption": "FromImage", "managedDisk": { "storageAccountType": "[parameters('osDiskType')]" } } } }, "type": "Microsoft.Compute/virtualMachines" } ], "variables": { "subnet1Ref": "[concat(variables('vnetID'),'/subnets/', resourceGroup().name)]", "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', resourceGroup().name)]" } }, "template_link": null, "tenant": "", "thumbprint": null, "wait_for_deployment_completion": true, "wait_for_deployment_polling_period": 10, "x509_certificate_path": null } }, "msg": "Failed to import the required Python library (ansible[azure] (azure >= 2.0.0)) on Haikal-PC's Python /home/haika/algo/.env/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter" } Read vars_file 'config.cfg'

TASK [include_tasks] *** task path: /home/haika/algo/cloud.yml:21 Read vars_file 'config.cfg' included: /home/haika/algo/playbooks/rescue.yml for localhost Read vars_file 'config.cfg' Read vars_file 'config.cfg'

TASK [debug] *** task path: /home/haika/algo/playbooks/rescue.yml:2 ok: [localhost] => { "fail_hint": [ "Sorry, but something went wrong!", "Please check the troubleshooting guide.", "https://trailofbits.github.io/algo/troubleshooting.html" ] } Read vars_file 'config.cfg'

TASK [Fail the installation] *** task path: /home/haika/algo/playbooks/rescue.yml:5 fatal: [localhost]: FAILED! => { "changed": false, "msg": "Failed as requested from task" }

PLAY RECAP ***** localhost : ok=32 changed=1 unreachable=0 failed=1 skipped=0 rescued=1 ignored=0

jackivanov commented 3 months ago

@MHN452 can you check this out? https://github.com/trailofbits/algo/pull/14706