# Fix Preview Bug

In case the file preview is erroneous/empty but the file can be processed and it can be downloaded by URL like [https://dms.yourdomain.de/api/file/:FILE\_ID/data](https://dms.yourdomain.de/api/file/:FILE_ID/data):

[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/KjIXuU25Hl733DtU-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/KjIXuU25Hl733DtU-grafik.png)

Root Cause: unkown. Seems to happen after migration from H2 to PostgreSQL

## Fixing proposal

### Remove the \_thumb and \_web files

and let Teedy create new ones by running a (complete) re-processing

[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/SjmkuitYxvaI31rJ-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/SjmkuitYxvaI31rJ-grafik.png)

```bash
cd /var/docs/storage
ll | grep "<YOUR_FILE_ID>"
mv <YOUR_FILE_ID>_thumb <YOUR_FILE_ID>_thumb.bak
mv <YOUR_FILE_ID>_web <YOUR_FILE_ID>_web.bak
 
#or just move all stuff to some sub directory if you plan to re-process the complete file system:
mkdir thumb_web_bak
mv *_thumb *_web thumb_web_bak/
 
#restart your instance to let Teedy recognize that changes due to caching
sudo systemctl restart jetty9.service
```

### Reprocess documents

See [Teedy API Scripts / database queries](https://wiki.stadtfabrikanten.org/books/inventar-und-handbucher/chapter/teedy-api-scripts-database-queries "Teedy API Scripts / database queries") for reprocessing of everything.