Enjoy the detours!

paperless

After procrastinating this for far too long, I sat down and did a new setup of Paperless-NGX on my NAS.

For this, I followed the setup guide for docker-compose: https://docs.paperless-ngx.com/setup/#docker

This guide requires you to have Container Manager installed on your NAS. Under /volume1 I have created a folder called docker which has another folder called paperless in it. So the path will be /volume1/docker/paperless.

My adjustments to the docker-compose.yml file:

    volumes:
      - /volume1/docker/paperless/data:/usr/src/paperless/data
      - /volume1/docker/paperless/media:/usr/src/paperless/media
      - /volume1/docker/paperless/export:/usr/src/paperless/export
      - /volume1/docker/paperless/consume:/usr/src/paperless/consume

And a different port: someportnumber:8000.

My changes to the docker-compose.env:

PAPERLESS_TIME_ZONE=Europe/Berlin
PAPERLESS_OCR_LANGUAGE=deu

And the correct IDs for USERMAP_UID= and USERMAP_GID= which you can get from id -u and id -g. The guide will tell you this as well.

Notes

The guide uses docker compose ... to run docker-compose, without the dash. Synology uses docker-compose ... with dash, to run it. I was searching, why this was not working on my side. So, this could be one reason. 😅

Database Error

I've got this error: PostgreSQL Database directory appears to contain a database; Skipping initialization. Which resulted from an old installation. Because I wanted to a fresh start, I needed to remove the old data and found this command: 🚨 docker-compose down --volumes 🚨 Be careful, this will erase all related data.

Webserver Error

Because I'm stupid, I used the wrong timezone and got an error. ValueError: Incorrect timezone setting: Germany/Berlin The correct timezone I needed to set in docker-compose.env was: PAPERLESS_TIME_ZONE=Europe/Berlin.

Conclusion?

I've used docker-compose because I broke my installation for too often with the Container Manager. And in the end, it's just a UI wrapper which confuses me. So I go with docker-compose, which I'm used in the past for client projects. The setup was straightforward, excluding the errors I had, which were self-made in the end.


17 of #100DaysToOffload
#log #toFutureMe #paperless
Thoughts? Discuss...

Today I did an update of my paperless-ngx installation. Unplanned. 😅

I logged into my Synology DSM and saw that there was an update for the Redis image. Like always, I started the update and went on. Later that Day, I wanted to upload some files, but I got an 500: Error. I've searched the web and found that there could be an error with Redis.

First, I thought that this could be an issue with file permissions. Because I tried, for the first time, uploading an PDF via the share button on my Phone. But then it also failed while uploading a normal image of a Document. So I started my investigation.

First, I found this error message in the Redis logs: WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition.. Did a small search and found some shell command for sysctl which didn't help. Because in this Redis image, there is no sysctl installed. This was one of the commands:

sudo sysctl -w vm.overcommit_memory=1

If set to 1, it is enabled. Mine was set to 0. Without sysctl installed, it looked that there was no way to set it. So I searched again. With no luck.

Then I thought maybe I could just restart the Redis container, but this also leaded into nothing.

So maybe I just could re-use the instructions (Link to a German Synology Forum), I've used to install paperless-ngx.

There were 4 commands I simply run again.

cd /volume1/docker/paperlessngx/config
sudo docker-compose pull
sudo docker-compose run --rm webserver createsuperuser
sudo docker-compose up -d

This helped. In some way. The downside was, that it reinstalled everything and also deleted the database. Luckily, I could restore all my files from the File system. The only thing I needed to add again were tags. For the next time, I should make a real backup with the document_exporter from paperless-ngx. (Second time I need to do this. https://bruegge.dev/paperless-ngx, maybe I should not postpone it for too long. 😅)

In the End, I have no solution to the initial problem. Just solved it accidentally by updating my installation and lost my database.

This post is also more or less a documentation for future-me, if I come to this point again. 👍


7/100 of #100DaysToOffload

#log #toFutureMe #paperless #fail

Discuss...