trailofbits/algo · error

Error during server search: (%s) %s

Error message

Error during server search: (%s) %s

What it means

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.

Source

Thrown at library/scaleway_compute.py:543

    return changed, target_server


state_strategy = {
    "present": present_strategy,
    "restarted": restart_strategy,
    "stopped": stop_strategy,
    "running": running_strategy,
    "absent": absent_strategy,
}


def find(compute_api, wished_server, per_page=1):
    compute_api.module.debug("Getting inside find")
    # Only the name attribute is accepted in the Compute query API
    response = compute_api.get("servers", params={"name": wished_server["name"], "per_page": per_page})

    if not response.ok:
        msg = "Error during server search: (%s) %s" % (response.status_code, response.json)
        compute_api.module.fail_json(msg=msg)

    search_results = response.json["servers"]

    return search_results


PATCH_MUTABLE_SERVER_ATTRIBUTES = (
    "ipv6",
    "tags",
    "name",
    "dynamic_ip_required",
    "security_group",
)


def server_attributes_should_be_changed(compute_api, target_server, wished_server):
    compute_api.module.debug("Checking if server attributes should be changed")

View on GitHub (pinned to 20e22a8715)

Solutions

  1. Verify the authentication token and organization settings passed to the module
  2. Check the api_url/region parameters point at the right Scaleway zone endpoint
  3. Test connectivity: curl -H "X-Auth-Token: $SCW_TOKEN" https://api.scaleway.com/instance/v1/zones/fr-par-1/servers
  4. Retry — transient 5xx from the Scaleway API is common
Defensive patterns

Strategy: validation

Validate before calling

# Pre-flight check of token and endpoint
curl -sf -H "X-Auth-Token: $SCW_TOKEN" "https://api.scaleway.com/instance/v1/zones/${ZONE}/servers?per_page=1" || echo 'auth/endpoint broken'

Prevention

When it happens

Trigger: compute_api.get('servers', params={'name': ..., 'per_page': 1}) returns not ok — invalid/expired token (401), wrong region endpoint, network failure, or malformed query.

Common situations: 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.

Related errors


AI-assisted analysis of trailofbits/algo@20e22a8715 (2026-08-28). Data as JSON: /api/errors/2b3151a3240891c7. Report an issue: GitHub.