---
title: "removeAttachmentVersion is not working as expected for Confluence CLI"
canonical: "https://support.appfire.com/space/SUPPORT/89134871/removeAttachmentVersion%20is%20not%20working%20as%20expected%20for%20Confluence%20CLI"
format: markdown
---
## Problem statement

Experiencing unexpected errors when trying to remove multiple versions of attachment using **removeAttachmentVersion.**

## Example Error message 

```plaintext
Stopped looking for more versions to remove as we hit a limit of 25 missing versions in a row.
0 versions removed for attachment 'xxxxxx.png' on page 'Sample test' in space TEST. 15 versions remain.
```

## Sample log entries

```plaintext
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: 200, url: https://test.int/rest/api/latest/space/EVAL?expand=description.plain%2Cmetadata.labels%2Chomepage
URL requested: https://test.int/rest/api/latest/content?spaceKey=EVAL&expand=space.homepage%2Chistory%2Cversion%2Cancestors%2Cbody.storage&type=page&title=Analysis+Increments&status=current
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: 200, url: https://test.int/rest/api/latest/content?spaceKey=EVAL&expand=space.homepage%2Chistory%2Cversion%2Cancestors%2Cbody.storage&type=page&title=Analysis+Increments&status=current
URL requested: https://test.int/rest/api/latest/content/58130527/child/attachment?expand=container%2Cspace%2Cversion&filename=Inc_09_100.png&limit=50&start=0
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: 200, url: https://test.int/rest/api/latest/content/58130527/child/attachment?expand=container%2Cspace%2Cversion&filename=Inc_09_100.png&limit=50&start=0
URL requested: https://test.int/rpc/json-rpc/confluenceservice-v2/getAttachment
Request type: POST
Content type: application/json; charset=utf-8
Content length: 35
Post data: 
["58130527","xxxxxxx.png","942"]
Response code: 200, message: 200, url: https://test.int/rpc/json-rpc/confluenceservice-v2/getAttachment
"
"
["58130527","Inc_09_100.png","908"]
Response code: 200, message: 200, url: https://test.int/rpc/json-rpc/confluenceservice-v2/getAttachment
URL requested: https://test.int/rpc/json-rpc/confluenceservice-v2/getAttachment
Request type: POST
Content type: application/json; charset=utf-8
Content length: 35
Post data: 
["58130527","xxxxxxx.png","907"]
Response code: 200, message: 200, url: https://test.int/rpc/json-rpc/confluenceservice-v2/getAttachment
Stopped looking for more versions to remove as we hit a limit of 25 missing versions in a row.
0 versions removed for attachment 'xxxxxx.png' on page 'Sample test' in space TEST. 12 versions remain.
```

## Environment

| **Component** | Server |
| --- | --- |
| **Application** | Confluence |
| **Host Product Version** | 6.13.0 |
| **App Version** | 8.3.0 |
| **Database Type** | N/A |

## Cause

The <span style="color: #000000">issue occurs only when there are 25 or more versions missing in the sequence, for example, if you are trying to remove around 950 attachment versions and there are 25 versions or more missing in the version sequence.</span>

## Problem determination

The following are general troubleshooting steps when **removeAttachmentVersion** is not working as expected:

- Verify that **removeAttachmentVersions** is used for deleting multiple versions whereas the **removeAttachmentVersion **<span style="color: #172b4d">deletes only one version of an attachment.</span>
- Verify the debug logs by appending **--debug** to the CLI command.

## Solution

Upgrade to the latest version of <span style="color: #172b4d"> ACLI </span>from the [Downloads](https://appfire.atlassian.net/wiki/spaces/ACLI/pages/60562669/Downloads) link.

> ℹ️ Use
> ℹ️ 
> ℹ️ - **removeAttachmentVersions **for deleting multiple versions of an attachment
> ℹ️ - **removeAttachmentVersion **for deleting a single version of an attachment