diff --git a/contabo/lib/common.sh b/contabo/lib/common.sh index 49472dc3..0f2fcc7a 100644 --- a/contabo/lib/common.sh +++ b/contabo/lib/common.sh @@ -255,7 +255,11 @@ destroy_server() { response=$(contabo_api DELETE "/compute/instances/$instance_id") if echo "$response" | grep -q '"error"'; then - log_error "Failed to destroy instance: $response" + log_error "Failed to destroy instance $instance_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The instance may still be running and incurring charges." + log_error "Delete it manually at: https://my.contabo.com/" return 1 fi diff --git a/e2b/lib/common.sh b/e2b/lib/common.sh index 359efdfc..fd616c40 100644 --- a/e2b/lib/common.sh +++ b/e2b/lib/common.sh @@ -85,7 +85,16 @@ create_server() { fi if [[ -z "${E2B_SANDBOX_ID}" ]]; then - log_error "Failed to create sandbox: ${output}" + log_error "Failed to create E2B sandbox" + if [[ -n "${output}" ]]; then + log_error "Error: ${output}" + fi + log_error "" + log_error "Common causes:" + log_error " - Invalid or expired API key (verify at: https://e2b.dev/dashboard)" + log_error " - Sandbox limit reached for your account" + log_error " - Template '${template}' not found" + log_error " - Network connectivity issues" return 1 fi diff --git a/github-codespaces/lib/common.sh b/github-codespaces/lib/common.sh index 2da1cd15..71f2379b 100755 --- a/github-codespaces/lib/common.sh +++ b/github-codespaces/lib/common.sh @@ -103,7 +103,15 @@ create_codespace() { if [[ $? -ne 0 ]]; then log_error "Failed to create codespace" - log_error "$codespace_name" + if [[ -n "$codespace_name" ]]; then + log_error "Error: $codespace_name" + fi + log_error "" + log_error "Common causes:" + log_error " - Codespace spending limit reached (check: https://github.com/settings/billing)" + log_error " - Machine type unavailable for this repository" + log_error " - Repository does not exist or you lack access" + log_error " - GitHub CLI not authenticated (run: gh auth login)" return 1 fi @@ -133,6 +141,11 @@ wait_for_codespace() { done log_error "Codespace failed to become ready after $max_attempts attempts" + log_error "" + log_error "The codespace may still be starting. You can:" + log_error " 1. Check status: gh codespace list" + log_error " 2. Connect manually: gh codespace ssh --codespace $codespace" + log_error " 3. View in browser: https://github.com/codespaces" return 1 } diff --git a/hetzner/lib/common.sh b/hetzner/lib/common.sh index 3ef0333d..13cf76d9 100755 --- a/hetzner/lib/common.sh +++ b/hetzner/lib/common.sh @@ -410,7 +410,11 @@ destroy_server() { response=$(hetzner_api DELETE "/servers/$server_id") if echo "$response" | grep -q '"error"'; then - log_error "Failed to destroy server: $response" + log_error "Failed to destroy server $server_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The server may still be running and incurring charges." + log_error "Delete it manually at: https://console.hetzner.cloud/" return 1 fi diff --git a/hostinger/lib/common.sh b/hostinger/lib/common.sh index 579cd49a..d11f2297 100644 --- a/hostinger/lib/common.sh +++ b/hostinger/lib/common.sh @@ -266,7 +266,13 @@ destroy_server() { response=$(hostinger_api DELETE "/virtual-machines/$vps_id") if echo "$response" | grep -q '"error"\|"message".*fail'; then - log_error "Failed to destroy VPS: $response" + log_error "Failed to destroy VPS $vps_id" + local error_msg + error_msg=$(echo "$response" | python3 -c "import json,sys; d=json.loads(sys.stdin.read()); print(d.get('message','') or d.get('error','Unknown error'))" 2>/dev/null || echo "$response") + log_error "API Error: $error_msg" + log_error "" + log_error "The VPS may still be running and incurring charges." + log_error "Delete it manually at: https://hpanel.hostinger.com/" return 1 fi diff --git a/hostkey/lib/common.sh b/hostkey/lib/common.sh index 3aa3b4fe..9ab95e70 100644 --- a/hostkey/lib/common.sh +++ b/hostkey/lib/common.sh @@ -249,7 +249,11 @@ destroy_server() { response=$(hostkey_api POST "/eq/terminate" "{\"id\":$json_id}") if echo "$response" | grep -qi "error"; then - log_error "Failed to destroy instance: $response" + log_error "Failed to destroy instance $instance_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The instance may still be running and incurring charges." + log_error "Delete it manually at: https://manage.hostkey.com/" return 1 fi diff --git a/koyeb/lib/common.sh b/koyeb/lib/common.sh index 89f65bca..9ecd00a7 100644 --- a/koyeb/lib/common.sh +++ b/koyeb/lib/common.sh @@ -98,8 +98,19 @@ get_server_name() { _koyeb_create_app() { local app_name="$1" log_step "Creating Koyeb app: $app_name" - if ! koyeb app create "$app_name" >/dev/null 2>&1; then - log_error "Failed to create Koyeb app" + local create_output + create_output=$(koyeb app create "$app_name" 2>&1) + if [[ $? -ne 0 ]]; then + log_error "Failed to create Koyeb app '$app_name'" + if [[ -n "$create_output" ]]; then + log_error "Error: $create_output" + fi + log_error "" + log_error "Common causes:" + log_error " - App name already taken by another user" + log_error " - Invalid app name (must be lowercase alphanumeric with hyphens)" + log_error " - API token lacks permissions" + log_error "Check your dashboard: https://app.koyeb.com/" return 1 fi } @@ -124,8 +135,14 @@ _koyeb_create_service() { 2>&1) if echo "$create_output" | grep -q "Error"; then - log_error "Failed to create Koyeb service" + log_error "Failed to create Koyeb service '$service_name'" log_error "$create_output" + log_error "" + log_error "Common causes:" + log_error " - Insufficient account balance or payment method required" + log_error " - Region unavailable (try a different region)" + log_error " - Instance type not available" + log_error "Check your dashboard: https://app.koyeb.com/" return 1 fi @@ -158,7 +175,13 @@ _koyeb_wait_for_service() { fi if [[ "$status" == "error" || "$status" == "failed" ]]; then - log_error "Service deployment failed" + log_error "Service deployment failed (status: $status)" + log_error "" + log_error "Common causes:" + log_error " - Docker image pull failure" + log_error " - Insufficient resources for the selected instance type" + log_error " - Health check failure (service crashed on startup)" + log_error "View deployment logs: https://app.koyeb.com/" return 1 fi @@ -166,7 +189,11 @@ _koyeb_wait_for_service() { sleep 5 done - log_error "Timeout waiting for service to be ready" + log_error "Service did not become ready after $((max_attempts * 5))s" + log_error "" + log_error "The service may still be deploying. You can:" + log_error " 1. Check status at: https://app.koyeb.com/" + log_error " 2. Re-run the command to try again" return 1 } @@ -179,7 +206,10 @@ _koyeb_get_instance_id() { KOYEB_INSTANCE_ID=$(koyeb instances list --service "$service_id" 2>/dev/null | grep -v "^ID" | awk '{print $1}' | head -1) if [[ -z "$KOYEB_INSTANCE_ID" ]]; then - log_error "Failed to get instance ID" + log_error "Failed to get instance ID for service $service_id" + log_error "" + log_error "The service may not have any running instances yet." + log_error "Check service status at: https://app.koyeb.com/" return 1 fi diff --git a/latitude/lib/common.sh b/latitude/lib/common.sh index 3d16377c..555dda16 100644 --- a/latitude/lib/common.sh +++ b/latitude/lib/common.sh @@ -294,7 +294,11 @@ destroy_server() { response=$(latitude_api DELETE "/servers/$server_id") if echo "$response" | python3 -c "import json,sys; d=json.loads(sys.stdin.read()); sys.exit(0 if d.get('errors') else 1)" 2>/dev/null; then - log_error "Failed to destroy server: $response" + log_error "Failed to destroy server $server_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The server may still be running and incurring charges." + log_error "Delete it manually at: https://www.latitude.sh/dashboard" return 1 fi diff --git a/netcup/lib/common.sh b/netcup/lib/common.sh index cbc33e01..c2c3b7ec 100644 --- a/netcup/lib/common.sh +++ b/netcup/lib/common.sh @@ -301,7 +301,11 @@ destroy_server() { response=$(netcup_api "deleteVServer" "{\"vserverid\": \"$server_id\"}") if ! _netcup_is_success "$response"; then - log_error "Failed to destroy VPS: $response" + log_error "Failed to destroy VPS $server_id" + log_error "API Error: $(_extract_json_field "$response" "d.get('longmessage','Unknown error')")" + log_error "" + log_error "The VPS may still be running and incurring charges." + log_error "Delete it manually at: https://ccp.netcup.net/" return 1 fi diff --git a/ovh/lib/common.sh b/ovh/lib/common.sh index 987ebb36..bfe9d967 100644 --- a/ovh/lib/common.sh +++ b/ovh/lib/common.sh @@ -329,7 +329,11 @@ destroy_ovh_instance() { response=$(ovh_api_call DELETE "/cloud/project/${OVH_PROJECT_ID}/instance/${instance_id}") if echo "$response" | grep -q '"message"'; then - log_error "Failed to destroy instance: $response" + log_error "Failed to destroy instance $instance_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The instance may still be running and incurring charges." + log_error "Delete it manually at: https://www.ovhcloud.com/manager/" return 1 fi diff --git a/ramnode/lib/common.sh b/ramnode/lib/common.sh index 51d2b42c..330ee09f 100755 --- a/ramnode/lib/common.sh +++ b/ramnode/lib/common.sh @@ -369,7 +369,11 @@ destroy_server() { response=$(ramnode_compute_api DELETE "/servers/$server_id") if echo "$response" | grep -q '"error"'; then - log_error "Failed to destroy server: $response" + log_error "Failed to destroy server $server_id" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The server may still be running and incurring charges." + log_error "Delete it manually at: https://manage.ramnode.com/" return 1 fi diff --git a/upcloud/lib/common.sh b/upcloud/lib/common.sh index 588221dd..40aae096 100644 --- a/upcloud/lib/common.sh +++ b/upcloud/lib/common.sh @@ -246,7 +246,11 @@ destroy_server() { response=$(upcloud_api DELETE "/server/$server_uuid?storages=1") if echo "$response" | grep -q '"error"'; then - log_error "Failed to destroy server: $response" + log_error "Failed to destroy server $server_uuid" + log_error "API Error: $(extract_api_error_message "$response" "$response")" + log_error "" + log_error "The server may still be running and incurring charges." + log_error "Delete it manually at: https://hub.upcloud.com/" return 1 fi