{"record":{"id":"2b3151a3240891c7","repo":"trailofbits/algo","slug":"error-during-server-search-s-s","errorCode":null,"errorMessage":"Error during server search: (%s) %s","messagePattern":"Error during server search: \\((.+?)\\) (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"library/scaleway_compute.py","lineNumber":543,"sourceCode":"    return changed, target_server\n\n\nstate_strategy = {\n    \"present\": present_strategy,\n    \"restarted\": restart_strategy,\n    \"stopped\": stop_strategy,\n    \"running\": running_strategy,\n    \"absent\": absent_strategy,\n}\n\n\ndef find(compute_api, wished_server, per_page=1):\n    compute_api.module.debug(\"Getting inside find\")\n    # Only the name attribute is accepted in the Compute query API\n    response = compute_api.get(\"servers\", params={\"name\": wished_server[\"name\"], \"per_page\": per_page})\n\n    if not response.ok:\n        msg = \"Error during server search: (%s) %s\" % (response.status_code, response.json)\n        compute_api.module.fail_json(msg=msg)\n\n    search_results = response.json[\"servers\"]\n\n    return search_results\n\n\nPATCH_MUTABLE_SERVER_ATTRIBUTES = (\n    \"ipv6\",\n    \"tags\",\n    \"name\",\n    \"dynamic_ip_required\",\n    \"security_group\",\n)\n\n\ndef server_attributes_should_be_changed(compute_api, target_server, wished_server):\n    compute_api.module.debug(\"Checking if server attributes should be changed\")","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/trailofbits/algo/blob/20e22a8715c198b38c01c1ca62d0953b93587a74/library/scaleway_compute.py#L525-L561","documentation":"Raised when the GET /servers query used to look up a server by name fails at the HTTP level. All strategies (present, absent, running, stop, restart) call find() first, so this error aborts any state operation before it starts.","triggerScenarios":"compute_api.get('servers', params={'name': ..., 'per_page': 1}) returns not ok — invalid/expired token (401), wrong region endpoint, network failure, or malformed query.","commonSituations":"Expired SCW_TOKEN, wrong api_url/region in module args, proxy or network egress blocking api.scaleway.com, or a typo in the server name producing unexpected API behavior.","solutions":["Verify the authentication token and organization settings passed to the module","Check the api_url/region parameters point at the right Scaleway zone endpoint","Test connectivity: curl -H \"X-Auth-Token: $SCW_TOKEN\" https://api.scaleway.com/instance/v1/zones/fr-par-1/servers","Retry — transient 5xx from the Scaleway API is common"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-flight check of token and endpoint\ncurl -sf -H \"X-Auth-Token: $SCW_TOKEN\" \"https://api.scaleway.com/instance/v1/zones/${ZONE}/servers?per_page=1\" || echo 'auth/endpoint broken'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the token and region before running the playbook","Run a read-only lookup task first to fail fast with a clear cause"],"tags":["scaleway","api-error","ansible","lookup"],"backgroundTag":"cloud-api-auth-or-endpoint-error","analyzedSha":"20e22a8715c198b38c01c1ca62d0953b93587a74","analyzedAt":"2026-08-28T13:26:02.752Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}