{"record":{"id":"1a272ad8ef9fcbb7","repo":"pulumi/pulumi","slug":"pinging-stack-webhook-w","errorCode":null,"errorMessage":"pinging stack webhook: %w","messagePattern":"pinging stack webhook: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/stack/stack_webhook_ping.go","lineNumber":118,"sourceCode":"\t\tctx, cmdutil.Diag(), pkgWorkspace.Instance, cmdBackend.DefaultLoginManager, stackFlag)\n}\n\nfunc runStackWebhookPing(\n\tctx context.Context,\n\tw io.Writer,\n\tfactory stackWebhookPingClientFactory,\n\tstackFlag string,\n\twebhookName string,\n\trender webhookPingRenderFunc,\n) error {\n\tc, stackID, err := factory(ctx, stackFlag)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdelivery, err := c.PingStackWebhook(ctx, stackID, webhookName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"pinging stack webhook: %w\", err)\n\t}\n\n\treturn render(w, delivery)\n}\n\ntype webhookPingRenderFunc func(w io.Writer, d apitype.WebhookDelivery) error\n\nfunc renderWebhookPingJSON(w io.Writer, d apitype.WebhookDelivery) error {\n\tenc := json.NewEncoder(w)\n\tenc.SetEscapeHTML(false)\n\tenc.SetIndent(\"\", \"  \")\n\treturn enc.Encode(d)\n}\n\nfunc renderWebhookPingText(w io.Writer, d apitype.WebhookDelivery) error {\n\tts := time.Unix(d.Timestamp, 0).UTC().Format(time.RFC3339)\n\n\tfmt.Fprintf(w, \"ID:                %s\\n\", d.ID)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/stack/stack_webhook_ping.go#L100-L136","documentation":"Wraps any error returned by the backend client when calling PingStackWebhook, which asks the Pulumi Cloud to deliver a test payload to the stack webhook. The CLI surfaces the underlying transport/API failure (webhook not found, unreachable endpoint, auth failure) under this prefix so the user knows the failure happened during the ping operation.","triggerScenarios":"Running `pulumi stack webhook ping <name>` when the webhook does not exist on the stack, the webhook endpoint is down or returns a non-success status, the backend API is unreachable, or the API token lacks access to the stack.","commonSituations":"Testing a webhook after rotating its secret or changing the target URL; typo'd webhook name; corporate proxy/firewall blocking outbound calls to the webhook URL; expired PULUMI_ACCESS_TOKEN.","solutions":["Verify the webhook name with `pulumi stack webhook list` and re-run the ping with the exact name","Check the webhook endpoint is reachable and returning 2xx (curl the URL)","Run `pulumi login` / refresh PULUMI_ACCESS_TOKEN to fix auth issues","Retry once connectivity is confirmed; transient network errors are common"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before calling: ensure webhook exists and endpoint reachable\nnames, _ := client.ListStackWebhooks(ctx, stackID)\nif !slices.Contains(names, webhookName) { return fmt.Errorf(\"webhook %q not found\", webhookName) }\nresp, err := http.Head(webhookURL)\nif err != nil || resp.StatusCode >= 400 { return fmt.Errorf(\"webhook endpoint unreachable\") }","typeGuard":null,"tryCatchPattern":"// Go\nif err := ping(); err != nil {\n    var retriable = strings.Contains(err.Error(), \"connection\")\n    if retriable { backoffRetry(ping, 3) }\n    return fmt.Errorf(\"pinging stack webhook: %w\", err)\n}","preventionTips":["Verify webhook names with `pulumi stack webhook list` before pinging","Monitor webhook endpoint uptime; pings fail if the target is down","Keep PULUMI_ACCESS_TOKEN fresh and scoped to the stack"],"tags":["cli","webhook","network"],"backgroundTag":"webhook-delivery-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}