DavidMStraub/gramps-web-sync

Media Sync error

zkab opened this issue · 18 comments

zkab commented

I used DigitalOcean 1-Click App.
I installed the downloaded 'gramps-addon-webapisync-main' in gramps51/plugins and restarted Gramps.
When I choose 'Tools > Family Tree Processing > Gramps Web Sync' the data files are fetched ... but when I click Next/Media Files I will get errors (pls check attachment)
How can this be solved?

error.txt

Hi, in the web interface, can you please go to Settings > System Information and copy & paste the version info?

If there is no System Information tab there, can you please update to the latest version:

cd /opt/grampsweb
docker-compose pull grampsweb && docker-compose up -d
zkab commented

There was no System Information tab so I gave the commands after login to DigitalOcean Droplet:

root@sugupuu:~# cd /opt/grampsweb
root@sugupuu:/opt/grampsweb# docker-compose pull grampsweb && docker-compose up -d
Pulling grampsweb ... done
grampsweb_grampsweb_1 is up-to-date
nginx-proxy is up-to-date
nginx-proxy-acme is up-to-date
root@sugupuu:/opt/grampsweb# logout

After that there still was no System Information tab.

Gramps-1
Gramps-2

Oh, sorry. Forgot the new version is not released yet, will let you know

Actually, please retry sync now after the update and the let me know what your logs say: docker-compose logs --tail 100 grampsweb

zkab commented

Looking forward to the new version ...
Though I made a sync and got this after the command:

root@sugupuu:~# docker-compose logs --tail 100 grampsweb
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

root@sugupuu:~#

cd /opt/grampsweb

zkab commented

Sorry for late answer but I was away for a week.
Here is what I got from
cd /opt/grampsweb; docker-compose logs --tail 100 grampsweb
gramps-log.txt

Thanks, got it!

So the problem is that you have one or more media files with absolute paths, but the absolute path does not lie within the media base directory. This is not allowed (otherwise somebody could just create a media object with path /etc/passwd...).

The documentation should be improved here. Ideally, you should not have any absolute paths for media files (since those are dependent on the host system). You can use the Gramps (desktop) Media Manager to automatically convert all abs to rel.

zkab commented

OK ... I converted all abs to rel.
Now it seems to work !!!
The upload encountered 3 errors.
How can I find which were not uploaded?
Still I get alot of output from
cd /opt/grampsweb; docker-compose logs --tail 100 grampsweb
error.txt

Upload errors often occur because the checksum in the Gramps db is incorrect. Can you please try the Media Verify Tool to check if this is the case?

zkab commented

Thanks ... I ran 'Media Verify Tool' and corrected the checksum ... now it seems to upload OK.
But one thing seems strange to me in Desktop Gramps.
I replaced an image for an existing person ... it synced OK with Grams Web.
But when I choose Media in Desktop Gramps and click on the person
the Media Previw in the split window gives me the old images.
Clicking on the old images gives me the new & correct images with default images viewer.
Same correct images is shown when double-clicing at person in Media window.
Do you have any idea what is going on?

It means the thumbnails are not updated. The thumbnail cache should use the checksum as part of the cache key, so the only explanation I have is that your checksum did not change, but the image changed. Is that possible?

zkab commented

In .gramps/thumb/ there are 2 subdir - large and normal.
In subdir large there is the old thumbnail but in subdir normal the correct thumbnail is.
Both images have the same filename ...
50add6cafa020b39c17cab9b7843ecd8.png large
50add6cafa020b39c17cab9b7843ecd8.png normal
Can I copy the correct thumbnail from normal -> large

Hi, it's weird, but if it's a bug, it's unrelated to the sync addon, because that doesn't touch the thumbnails. I suspect that large was created when you had the wrong checksum. What are the timestamps of those two files?

zkab commented

The old (incorrect) thumbnail:

[forsete@balder: ~/.gramps/thumb/large] $ stat 50add6cafa020b39c17cab9b7843ecd8.png
File: 50add6cafa020b39c17cab9b7843ecd8.png
Size: 32677 Blocks: 64 IO Block: 4096 regular file
Device: 0,40 Inode: 430026 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ forsete) Gid: ( 1000/ forsete)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2023-07-16 17:02:39.156601659 +0200
Modify: 2023-07-15 16:32:43.450905597 +0200
Change: 2023-07-15 16:32:43.450905597 +0200
Birth: 2023-07-15 16:32:43.439905710 +0200
[forsete@balder: ~/.gramps/thumb/large] $

The new (correct) thumbnail:

[forsete@balder: ~/.gramps/thumb/normal] $ stat 50add6cafa020b39c17cab9b7843ecd8.png
File: 50add6cafa020b39c17cab9b7843ecd8.png
Size: 11454 Blocks: 24 IO Block: 4096 regular file
Device: 0,40 Inode: 64347 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ forsete) Gid: ( 1000/ forsete)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2023-07-16 17:07:56.708743861 +0200
Modify: 2023-07-15 16:37:44.674797554 +0200
Change: 2023-07-15 16:37:44.674797554 +0200
Birth: 2023-06-08 18:35:11.607467391 +0200
[forsete@balder: ~/.gramps/thumb/normal] $

You are right ... the thumbnail in large was created around the date I was checksum ...

zkab commented

I think I solved the problem.
I deleted the wrong thumbnail in large and restarted Gramps.
Then somehow in a magical way Gramps created the right thumbnail in large.
Now the right tumbnail is shown everywhere.
Thanks for your patience and support in this case ...

Hi, I realized by looking at the Gramps source code that the hashes in the Gramps thumbnail filenames are not actually the file hashes, but just the hashed path. So you probably replaced the image with a new file, but the same path, correct?

It looks like in such a case, Gramps does not invalidate the old thumbnails and you would have to remove them manually.

Anyway, closing as it is not a Gramps Web issue.

zkab commented

So you probably replaced the image with a new file, but the same path, correct?

Yes