gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 160 forks source link

Hard Error: No such column IsSharedAlbum #495

Open Doug411 opened 1 week ago

Doug411 commented 1 week ago

I am having 2 issues with gphotos-sync. The first issue is that it doesnt pick up new photos added to shared albums. I have to add parameter --rescan to force it to happen.

The second issue occured in my most recent run. I received a hard error "no such column: IsSharedAlbum". My compose file and error log are included below.

services:
  gphotos-sync:
    container_name: gphotos-sync
    volumes:
      - ./:/config # BACKUP
      - ${FOLDER_FOR_MEDIA}/photos:/storage # SKIP_BACKUP
    #ports:
    #  - 8080:8080
    stdin_open: true
    # tty: true
    image: ghcr.io/gilesknap/gphotos-sync
    environment:
      TZ: ${TIMEZONE}
    command: --progress --db-path=/config --omit-album-date
      --rescan --logfile=/config/gphotos.log --albums-path=/storage/Albums-Doug
      --photos-path=/storage/Photos-Doug /storage

Subset of error log (end of file)

gphotos-sync  | 06-25 10:04:02 WARNING  Listed 16580 items ... 
gphotos-sync  | 06-25 10:04:02 WARNING  Listed 16590 items ... 
gphotos-sync  | 06-25 10:04:02 WARNING  Listed 16600 items ... 
gphotos-sync  | 06-25 10:04:02 WARNING  Listed 16610 items ... 
gphotos-sync  | 06-25 10:04:02 WARNING  indexed 0 items 
gphotos-sync  | 06-25 10:04:02 WARNING  Downloading Photos ... 
gphotos-sync  | 06-25 10:04:02 WARNING  Downloaded 0 Items, Failed 0, Already Downloaded 25307 
gphotos-sync  | 06-25 10:04:02 WARNING  Indexing Shared (titled) Albums ... 
gphotos-sync  | 06-25 10:04:03 WARNING  Done. 
gphotos-sync  | 06-25 10:04:03 ERROR    
gphotos-sync  | Process failed. 
gphotos-sync  | Traceback (most recent call last):
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/__main__.py", line 553, in main
gphotos-sync  |     self.start(args)
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/__main__.py", line 471, in start
gphotos-sync  |     self.do_sync(args)
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/__main__.py", line 446, in do_sync
gphotos-sync  |     self.google_albums_sync.index_album_media()
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/GoogleAlbumsSync.py", line 160, in index_album_media
gphotos-sync  |     self.index_albums_type(
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/GoogleAlbumsSync.py", line 199, in index_albums_type
gphotos-sync  |     indexed_album = self._db.get_album(album_id=album.id)
gphotos-sync  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gphotos-sync  |   File "/root/.local/lib/python3.12/site-packages/gphotos_sync/LocalData.py", line 318, in get_album
gphotos-sync  |     self.cur.execute(query, (album_id,))
gphotos-sync  | sqlite3.OperationalError: no such column: IsSharedAlbum
Doug411 commented 2 days ago

any updates? I can no longer run gphotos-sync as it fails every time when syncing albums.

ikwyl6 commented 2 days ago

This isn’t a constantly updated repo. I think you need to be patient and wait. Did you try a previous revision or commit and see if that works as you want it to?

Doug411 commented 2 days ago

Thanks. Good suggestion. I rolled back to 3.2.3 and the hard-error went away. So it seems to be an issue that was introduced in 3.2.4. As far as the issue regarding not syncing new pictures from shared albums (albums not owned by me, but shared with me), it seems this issue has been open for a few years, and is related to when the --omit-album-date parameter is used. I hate leaving --rescan on (because of the time it takes), but for now, that seems to be the only way to reliably sync shared albums. I'd love to see this addressed in the future.

lutzky commented 2 days ago

This field was added in https://github.com/gilesknap/gphotos-sync/commit/4d36985c33ca79f98722d72d976ad402eba83fe0 and apparently there was no update path. :thinking:

Doug411 commented 1 day ago

Any recommendations? Should I stick on 3.2.3 for now? Wait for resolution? Or should I upgrade to 3.2.4 and redownload/rebuild everything (and if so, what parameter should I add to force this to happen?)

ikwyl6 commented 1 day ago

Any recommendations? Should I stick on 3.2.3 for now? Wait for resolution? Or should I upgrade to 3.2.4 and redownload/rebuild everything (and if so, what parameter should I add to force this to happen?)

Stick with 3.2.3 for now. Unless someone else besides the author can look at it soon and provide a PR, this probably won’t get looked at for atleast a few weeks or more. It’s summer time and if I’m to guess like most things on github, this is a hobby project.

gilesknap commented 1 day ago

Sorry only just saw this - that's not good - I'll have to take a look on the weekend and get a fix out. Clearly my system test CI is not covering everything.