The attachment macros
Asked by 551550:

Hello! We need help. Our attachment macros does not allow deleting page objects. When we try to delete an object, we see a dialog box with a suggestion to delete the object. However, the "OK" button is not active. Administrative rights configured correctly.

![Screenshot_1.png](/t5/image/serverpage/image-id/41146iEED32AC0E683A55B/image-size/large?v=v2&px=999 "Screenshot_1.png")![Screenshot_2.png](/t5/image/serverpage/image-id/41147i8F2DAB7F5793E632/image-size/large?v=v2&px=999 "Screenshot_2.png")![Screenshot_3.png](/t5/image/serverpage/image-id/41148i27BDB42B7B9CDC98/image-size/large?v=v2&px=999 "Screenshot_3.png")


Answers:
author: Diego
body: Hello there!  
I spent some time trying to replicate this and found two behaviours.   

**The first** is when we select the file inside the Attachment Macro, Click Delete and then OK. The file was **still listed** under the macro but **was deleted** . **Publishing the page** was needed to see the changes.   

The **second outcome** takes in consideration space permissions. **Without enough permissions** , the user was **not even shown the delete** button.   

This creates some questions:
> 1- Has this feature **worked at some point in the past** ?  
> 2- Was there **any change applied** to the instance prior to this issue?  
> 3- Is this **affecting all users** who access the attachments via Macro?  
> 4- Is this **affecting all pages** ?  
> 5- Is the user able to delete attachments by going **directly** into **Affected Page \> Three Dots Menu (...) \> Attachments** ?  
> 6- **What happens** when the user **clicks the OK button** ?  
> 7- Is there **any error** thrown?

Let us know if you are able to access and delete attachments directly via attachments page!

comments: author: 551550
body: 1) The function worked in the past

2) There were no changes

3) All users have this problem

4) Yes. All pages have this problem

5) A user (administrator) cannot delete attachments from the menu

![Screenshot_4.png](https://community.atlassian.com/t5/image/serverpage/image-id/41275iCE7A29417CB51844/image-size/large?v=v2&px=999 "Screenshot_4.png")

6) When the user clicks the "OK" button, the action is not performed, the dialog box does not close

7) No error messages


author: Diego
body: Thanks for replying!  
Could you clarify if you are facing this problem in **Confluence Cloud** or **Server** ?  

If you are in **Cloud**, would it be possible for you to:
> - Try the procedure with **another** **browser**   
> - Create a **new** **user** and try to **attach** and then **delete** the **attachment**

f you are on Confluence Server, could you try to**Shutdown and Clear Confluence**:
> 1- Shutdown Confluence  
> - Make sure that the process is not running  
> - You can check that with ps -aux \| grep confluence in Linux and via the Process manager in Windows  
> 2- Go to \<confluence-home\>  
> 3- Remove the following folders:  
> - \<confluence-home\>/bundled-plugins  
> - \<confluence-home\>/plugins-cache  
> - \<confluence-home\>/plugins-osgi-cache  
> - \<confluence-home\>/plugins-temp  
> - \<confluence-home\>/bundled-plugins_language  
> - \<confluence-home\>/index  
> - \<confluence-home\>/journal  
> - \<confluence-home\>/logs  
> 4- Check permissions for \<confluence-home\>  
> - The user running Confluence must have \*full read/write/execute permission on this folder  
> - You can use the following commands to set this. Keep in mind that the user confluence here is just a placeholder, you must use the user that exists in your system  
> - sudo chown -R confluence:confluence /path/to/\<confluence-home\>  
> - chmod -R u=rwx,g=rx,o=rx /path/to/\<confluence-home\>  
> 5- Check permissions for \<confluence-install\>  
> - The user running Confluence must have full read/write/execute permission on this folder  
> - You can use the following commands to set this. Keep in mind that the user confluence here is just a placeholder, you must use the user that exists in your system  
> - sudo chown -R confluence:confluence /path/to/\<confluence-install\>  
> - chmod -R u=rwx,g=rx,o=rx /path/to/\<confluence-install\>  
> 6- Start Confluence  
> 7- Click \*Cog Icon\>General Configuration\*  
> 8- Search for \*Content Indexing\* in the left menu bar  
> 9- Click the \*Rebuild\* button

**Note** : ++*the removed folders are recreated by Confluence upon startup, but you can surely back them up before proceeding with the process.*++   

Please, keep in mind that the **indexing action can take a long time** depending on how big your instance is. There are instances that could take 5 minutes and others that take hours. Having this in mind, the plugin clear/reindex action **should be performend during a scheduled downtime** of your instance. During this downtime, make sure that no user accesses Confluence. User activity can hinder the reindex, making it a lot slower.


author: 551550
body: Thank you very much! After clearing the cache and rebuilding the indexes, the problem has been fixed.


author: Diego
body: Great! Glad to know that this has fixed the behaviour.

If you ever need assistance, share your needs with the Community!