---
search:
  tags:
    - servers
    - POST
seo:
  description: >-
    Runs the cleanup of a server that needs cleanup… Reference for the POST
    /api/v1/servers/{id}/retry-cleanup endpoint in the TimescaleDB Enterprise
    API.
  noindex: true
sidebar:
  label: Retry a server cleanup
  badge: POST
title: Retry a server cleanup
type: openapi-operation
---
Runs the cleanup of a server that needs cleanup (cleanup_pending): an earlier cleanup failed or could not run. It removes the software that the console deploys: PostgreSQL, TimescaleDB and the extensions with their holds and pins, Patroni, PgBouncer, pgBackRest, etcd, HAProxy, keepalived, confd, the exporters, their units, configuration, data directories, logs and users, and the package pack sources. It also removes the OS settings that the deploy made: the kernel settings of /etc/sysctl.d/tse.sysctl.conf, with their live values, the unit that disables transparent huge pages, the swap file, the open file limits of postgres, RemoveIPC of logind, the softdog watchdog, the firewall rules of the VIP and the SELinux settings of HAProxy and keepalived. The server keeps its mesh enrollment, the tse user, its locale and its chrony configuration. pgBackRest stays when a repository directory has backup files. It runs as a workflow; its log names what it removed and what it could not remove. The server needs no cleanup after a run that removed everything. Rejected with 409 when the server needs no cleanup, or while it is a member of a database service with a cluster or an operation, a member of a standalone DCS cluster, or the host of backup data or of a LiveSync session. A member of a service with no cluster (pending or failed, for example a first deploy that stopped on the packages of an earlier role) can get the cleanup. So can the server of a slot of a running service when the rebuild of the slot stopped on the packages of an earlier role (cleanup_kind deploy_refusal): the server has no data of the service. The cleanup runs on that server only. It does not change the other members, the DCS members or the slot. After it, rebuild the slot again.

`POST /api/v1/servers/{id}/retry-cleanup`

**Responses**

- `202` — Accepted
- `default` — Error

Response example, 202:

```json
{
  "workflow_id": "string"
}
```
