Confluence - Uploading attachement results in error
Asked by Juri Begoihn:

Hi,

I have multiple spaces in Confluence and one group that has the permissions to manage the attachements in these spaces.

In some of the spaces an error occurs when uploading an attachment. It says "Error creating temp file in folder ...".

I found suggestions for a solultion regarding the permissions of the users and the disk space. But users who have the same permissions in different spaces can upload attachements in one space but not in the other.

Do you have ideas or hints how to solve this problem?


Answers:
author: Milena Gonzalez
body: Hi

I am presenting the same error, I would like to know what your solution was? [@Juri Begoihn](/t5/user/viewprofilepage/user-id/1463804)


author: Diego
body: Hello there Juri!

As I understand, users are currently unable to upload attachments to Confluence. Is that right?

The error you showed us can be caused by some factors:
> 1. Not enough *Disk Space*
> 2. Not enough *Permissions* under the \<confluence-home\> folder

Both have something to do with the underlying structure rather than Confluence itself. We can start by checking the ++*Available Disk* Space++ in the drive where \<confluence-home\> is located.

After that, we can also check ++*Permissions set for \<confluence-home\>*++ . The user that runs Confluence must have full ++*Read, Write and* *Execute*++ permissions for that folder.

Also, could you clarify a few points for us? Here they are:
> 1. Is the file upload working for other users?
> 2. When did you first notice this issue?
> 3. Are users unable to upload any kind of file?
> 4. Are users able to upload files in newly created pages in the affected space?

Looking forward to your reply Juri!

comments: author: Juri Begoihn
body: Hello Diego,

thank you for your reply and excuse my belated answer.

The two factors "disk space" and "permissions" have already been checked.

The points you asked me to clarify:
> 1. The file upload in the spaces works for no user, but the same users can upload files in other spaces.
>
> 2. Two or three months ago we encountered this problem the first time. The solution that worked at this newly created space was to delete the whole space and create it again.
>
> 3. We found out with pdfs, but docx, jpg and png also does not work.
>
> 4. No, they aren't.

I hope, this helps you.

Regards

Juri


author: Diego
body: Hey there!

Thanks for replying Juri. Make sure that the permissions and ownership of ++*Both \<confluence-home\> and \<confluence-install\>*++ folders are not under root, but under the user *++Designated to run Confluence.++*

For you to check this, you can use this command after navigating to the folders:

```
ls -la 
```

If you ++*Do Not*++ have the correct ownership and permissions, you can use the following commands:

```
chown -R confluence.confluence <confluence-install-folder>chown -R confluence.confluence <confluence-home-folder>chmod -R u=rwx,go-rwx <confluence-install-folder>chmod -R u=rwx,go-rwx <confluence-home-folder>
```

Please, keep in mind that the confluence user that we specified in the excerpt above is simply a ++*Placeholder for actual username*++ used in your instance. Also, keep in mind that Confluence ++*Must Be Down*++ for this to be done.

You can also fetch some data for troubleshooting with the following command:

```
df -h <confluence-install>/folder
```

```
df -h <confluence-home>/folder
```

After that, you could also perform a ++*Re-index From Scratch*++ ++:++
> 1. ++Shutdown Confluence.++
> 2. ++Perform a backup of the home directory (so we can restore any content if required).++
> 3. ++++Remove the following directories++++
>    * \<confluence-home\>/index/
>    * \<confluence-home\>/journal/
>
> 4. ++Restart Confluence++
> 5. ++Go to *Cog Icon \> General Configuration*++
> 6. ++Select *Content Indexing*++
> 7. ++Click *Rebuild*++
> 8. ++Wait for the process to finish++

++***Reference:***++

++***[Content Index Administration](https://confluence.atlassian.com/doc/content-index-administration-148844.html)***++

++***[How to Rebuild the Content Indexes From Scratch on Confluence Server](https://confluence.atlassian.com/confkb/how-to-rebuild-the-content-indexes-from-scratch-on-confluence-server-110035351.html)***++

Also, keep an eye for ++*write.lock* *files*++ in your folders. Incorrect ownership of anything in the \<confluence-home\> and \<confluence-install\> folders can be root cause of many problems.

Further, we also try the ++*Saf* *e* *Mode*++ and check if the issue is being caused by a third-party application:

***++[Disabling and enabling apps](https://confluence.atlassian.com/upm/disabling-and-enabling-apps-273875716.html#DisablingorEnablingaPlugin-Disabling/Enablingalluser-installedplugins(safemode))++***

Let us hear from you Juri!


Tags: attachment

confluence-server

error

server