# Image attachments displaying duplicates

**URL:** <https://community.vikunja.io/t/image-attachments-displaying-duplicates/461>\
**Category:** Bug\
**Created:** [11 November 2021 14:42 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461 "2021-11-11T14:42:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [11 November 2021 14:42 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/1 "2021-11-11T14:42:20Z")

</div>

Uploading an image as a task attachment has resulted in the image displaying multiple times when viewing the task:

 ![image](https://community.vikunja.io/uploads/default/original/1X/f1df0912c92f70dd019a5c72242032d100bce740.png)

After deleting just one of them, an attempt to delete any of the others results in a message in a little red box (sorry but it will only let me embed a single image) that says:

Error: Request failed with status code 404 The task attachment does not exist.

Logging out and back in to either the desktop app or the web interface doesn’t change anything - these rogue entries are still shown.

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [11 November 2021 14:43 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/2 "2021-11-11T14:43:29Z")

</div>

Here we go…

 ![image](https://community.vikunja.io/uploads/default/original/1X/b4247f118d5ed3fff7068c7f6893fb77da8119a4.png)

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [11 November 2021 14:47 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/3 "2021-11-11T14:47:24Z")

</div>

I’ve just tried deleting 3 of the entries and all three are showing the same ID’s in the log:

vikunja[19115]: #033[31m2021-11-11T14:45:05.159004315Z: ERROR#011▶ handler/DeleteWeb 1c160#033[0m Task attachment does not exist [TaskID: 62, AttachmentID: 2, FileID: 0]  
vikunja[19115]: #033[31m2021-11-11T14:45:07.393272806Z: ERROR#011▶ handler/DeleteWeb 1c174#033[0m Task attachment does not exist [TaskID: 62, AttachmentID: 2, FileID: 0]  
vikunja[19115]: #033[31m2021-11-11T14:45:09.380268423Z: ERROR#011▶ handler/DeleteWeb 1c188#033[0m Task attachment does not exist [TaskID: 62, AttachmentID: 2, FileID: 0]

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [13 November 2021 14:18 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/4 "2021-11-13T14:18:13Z")

</div>

> [@m4rk](#):
>
> I’ve just tried deleting 3 of the entries and all three are showing the same ID’s in the log:

The `FileID: 0` part looks odd.

Does this happen every time you upload an attachment?  
Can you reproduce this on [try](https://try.vikunja.io)?

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [13 November 2021 17:44 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/5 "2021-11-13T17:44:03Z")

</div>

No I can’t. Going back to the tasks that were showing rogue entries… they’ve now gone. Possibly some strange caching issue. I’ve just tried attaching a file to another task. It shows 1 attachement. If I come back out of the task then click on it, it shows 2. Out and back in again and there’s 3… and so on. So I’m guessing the first time I delete it, it works - after that it fails because the attachments aren’t actually really there even though they’re still displaying. I have a nginx reverse proxy in front of it so maybe I’ll take a look in there

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [13 November 2021 17:51 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/6 "2021-11-13T17:51:43Z")

</div>

I generally use nginx as a security layer and serve any http content up from apache. The relevant location blocks in nginx are as follows:

```nginx
    location ~* ^/(api|dav|\.well-known)/ {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://localhost:3456;
    client_max_body_size 20M;
    }

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_max_temp_file_size 0;
        proxy_buffers 16 16k;  
        proxy_buffer_size 16k;
        proxy_pass http://127.0.0.1:8080;
    }

```

and apache 2 is as follows:

```apache
    RewriteEngine On
 	RewriteRule ^\/?(favicon\.ico|assets|audio|fonts|images|manifest\.webmanifest|robots\.txt|sw\.js|workbox-.*|api|dav|\.well-known) - [L]
    RewriteRule ^(.*)$ /index.html [QSA,L]
    <Directory /var/www/tasks.example.com/html>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted

    </Directory>

    SetEnvIf X-Forwarded-Proto "https" HTTPS=on

    RemoteIPHeader X-Forwarded-For
    RemoteIPTrustedProxy 127.0.0.1

```

Can you spot anything wrong here? Other than this issue it all appears to be working ok.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [13 November 2021 18:50 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/7 "2021-11-13T18:50:39Z")

</div>

I’m not sure if this is related to using apache and nginx the way you do. It looks like you used the apache2 config from the proxy + frontend host example. Try [this one](https://vikunja.io/docs/install-frontend/#apache) which is for hosting just the frontend.

What version are you using?

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [13 November 2021 19:04 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/8 "2021-11-13T19:04:43Z")

</div>

Of vikunja? I only downloaded it last week so I imagine the most recent unless something else has been released since. I’ll try tinkering with that apache config and report back.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [13 November 2021 19:22 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/9 "2021-11-13T19:22:37Z")

</div>

And what version did you download?

You can check this in the about dialog in the frontend.

---

<div class="post-metadata">

**Author:** ![m4rk](https://community.vikunja.io/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@m4rk](https://community.vikunja.io/u/m4rk)\
**Post date:** [13 November 2021 19:52 UTC](https://community.vikunja.io/t/image-attachments-displaying-duplicates/461/10 "2021-11-13T19:52:37Z")

</div>

Both frontend and API are v0.18.1
