Deleting and Conflicting

I assume the app container is the correct one, though looking at the documentation of the docker command, it looks like that will just tail any new log output.

@personalizedrefriger can you advise if there is a way to extract the full docker server logs?

Joplin Server prints the logs to stdout so it's up to you how you retrieve it. The commands you mentioned are one way and you can also redirect stdout to file or CloudWatch for long term storage

1 Like

@guyan it looks like you won't be able to get the previous logs then unless you already set up something to capture stdout. Oh well.

I did have a further ponder though about the screenshot of the tasks screen which you posted. Joplin cloud / server is unique compared to other sync targets in that maintanence tasks can be run on the server side, not only on the client side. I did look into those listed tasks and the 'process orphaned items' task could be a potential candidate for the remote deletions that are causing conflicts.

According to the code for the task here: joplin/packages/server/src/models/ItemModel.ts at 0c405951ed35a6332e4b198a73c9e55b1cd33572 · laurent22/joplin · GitHub
It indicates in the comment above the linked line of code that for some unknown reason, occasionally notes get saved without an associated user_item (though the comment claims only 0.0008% of the time). Where this is the case, this task is intended to prevent potential unique constraint violations, by deleting the note.

The theory is that this could only happen if you are using note shares, but you don't use them. So it should be safe for you to disable that task in Joplin server. Then, should you hit an error relating to a constraint violation in future, it would indicate the process orphaned items task to be the culprit, and potentially that could aid with an investigation of why occasionally user_item entries are missing

ok, so I should disable the 'Process orphaned items' among the server tasks and then wait for some errors, right?
I'll do and let you know the update

Correct. That's worth doing in the meantime, and can remain disabled after you do the full reset.

But don't let that hold you up doing a full reset when you get round to it, as you may never get such errors and obviously you want to get your note collection fixed

Now like here


Let see what will happen

1 Like

@mrjo118 something went wrong

The Joplin container did not work correctly and the server was not anymore reachable.
I have it working as a Docker container and I should have postgres 16 on it
So I replaced the container with a new installation. I have the file of the last backup of the database like file.sql.gz

I've not opened yet any Joplin application in any of the synchronized device.
How to restore them?

This is the list of the running Joplin containers:

$ sudo docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED        STATUS                 PORTS                                                    NAMES
7caa5d73f6c3   etechonomy/joplin-server:latest   "tini -- yarn start-…"   2 months ago   Up 2 hours             0.0.0.0:22300->22300/tcp, :::22300->22300/tcp            joplin-app-1
345303ba4139   postgres:16                       "docker-entrypoint.s…"   2 months ago   Up 2 hours             0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                joplin-db-1
    

If I replaced the file.sql.gz file of the last backup I should have all the sync notes saved, right?
How to do this in the best way?
Which commands to use step by step?

Unfortunately I don't know the details for restoring a backup on the server side of things. I'm not a Joplin Server user myself.

But doing the full reset as per the procedure I mentioned will sort things out. This relies on making backups on the clients rather than the server. Make sure the internet is disconnected before opening any of the Joplin clients, then make a jex backup before connecting to the internet to avoid possible data loss

At that day I did not have the possibility to not open and use the Joplin notes.
So what happened is that I suppose in the database there are many missing notes that are instead present on the client side. I suppose this creates the errors I found: conflicting.

Now I think that one of the definitive solution is to understand how to restore the backup file of the database. And with the time all the errors will be eliminated.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.