Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Hard Error: No such column IsSharedAlbum #495

Closed
Doug411 opened this issue Jun 25, 2024 · 8 comments · Fixed by #500
Closed

Hard Error: No such column IsSharedAlbum #495

Doug411 opened this issue Jun 25, 2024 · 8 comments · Fixed by #500

Comments

@Doug411
Copy link

Doug411 commented Jun 25, 2024

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
Copy link
Author

Doug411 commented Jun 29, 2024

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

@ikwyl6
Copy link

ikwyl6 commented Jun 29, 2024

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
Copy link
Author

Doug411 commented Jun 30, 2024

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
Copy link
Contributor

lutzky commented Jun 30, 2024

This field was added in 4d36985 and apparently there was no update path. 🤔

@Doug411
Copy link
Author

Doug411 commented Jun 30, 2024

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
Copy link

ikwyl6 commented Jun 30, 2024

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
Copy link
Owner

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.

@gilesknap
Copy link
Owner

My apologies for the delay. My day job is just way too interesting right now and is eating my weekend coding time.

This issue is my bad, I accepted #492 which is a good piece of work but I did not consider that it is changing the schema of the index database.

Luckily the fix is really easy.

gphotos-sync --flush-inde <my_photos_folder>

Will cause the index to be completely regenerated. This will take a little bit of extra time but the index is intentionally just a cache to speed things up and holds no unique information.

If for any reason that does not work then

rm <my_photos_folder>/gphotos.sqlite

I'll put a warning in the README about this too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants