SmilyOrg / photofield

Experimental fast photo viewer.
MIT License
398 stars 7 forks source link

SQLlite error on first run, executable for arm64v8 / raspberrypi 4 #61

Closed theinfra closed 9 months ago

theinfra commented 1 year ago

Describe the bug Getting an SQLlite syntax error on first run. Executing the precompiled binary for arm64v8.

panic: sqlite: prepare "\n\tSELECT COUNT(id)\n\tFROM infos\n\tWHERE path_prefix_id IN (\n\t\tSELECT id\n\t\tFROM prefix\n\t\tWHERE\n\t\n\t\t)\n\t": SQL logic error: near ")": syntax error

goroutine 1 [running]:
zombiezen.com/go/sqlite.(*Conn).Prep(0x4000218be0, {0x40002ba000, 0x63})
        /home/runner/go/pkg/mod/zombiezen.com/go/sqlite@v0.10.1/sqlite.go:431 +0x130
photofield/internal/image.(*Database).GetDirsCount(0x400025b580, {0x0, 0x0, 0x0?})
        /home/runner/work/photofield/photofield/internal/image/database.go:722 +0x140
photofield/internal/image.(*Source).GetDirsCount(0x40000b6010?, {0x0?, 0x22?, 0xfa2d4?})
        /home/runner/work/photofield/photofield/internal/image/source.go:450 +0x38
photofield/internal/collection.(*Collection).UpdateStatus(0x40002bfc80, 0x48?)
        /home/runner/work/photofield/photofield/internal/collection/collection.go:78 +0x88
main.main()
        /home/runner/work/photofield/photofield/main.go:1234 +0xe54

To Reproduce Steps to reproduce the behavior:

  1. downloaded release https://github.com/SmilyOrg/photofield/releases/download/v0.10.0/photofield_0.10.0_Linux_arm64.tar.gz
  2. make working directoy ~/photofield/
  3. extract contents to directory. Contents are:
    • LICENSE
    • photofield
    • README.md
  4. Create file configuration.yaml. Contents are
    collections:
    - name: myPhotos
    layout: timeline
    dirs:
        - /mnt/myPhotos

    I should note that the dir where the images are it's a network mounted cifs folder, belonging to the same user executing the script with 755 perms

  5. Execute ./photofield
  6. Output is as stated above, even after executing ./photofield -vacuum and deleting all photofield.cache. and photofield.thumbs. files

Expected behavior No error and server starts correctly

Desktop:

SmilyOrg commented 1 year ago

Thanks for testing! It looks like it's trying to show a collection with no dirs. Could it be that the extra indentation under "dirs" confuses it? It should be 6 spaces and then "-".

The error reporting leaves something to be desired for sure 😊

theinfra commented 9 months ago

Sorry for the long time but I totally forgot about this personal project 😅

But the solution was correct, in my configuration.yaml file the line with the dir was started with a tab character instead of 6 spaces. BTW I copied the format from the instructions of the README file in the repo, which is indented with a tab, so might want to change that since I think many people would do just that