LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
https://lycheeorg.github.io/
MIT License
3.35k stars 299 forks source link

Album photo upload bug on 4.4.0 #1162

Closed YannPl closed 2 years ago

YannPl commented 2 years ago

Detailed description of the problem [REQUIRED]

I'm having a bug on a fresh 4.4.0 install. When I create a simple test album, and upload images into it, I get an error for every photo. The error log:

 2021-12-07 21:59:41 -- error   -- App\Actions\Photo\Extensions\Save::recover -- 59 -- Something went wrong, error 22003, SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'album_id' at row 1 (SQL: insert into `photos` (`id`, `checksum`, `title`, `url`, `description`, `tags`, `width`, `height`, `type`, `filesize`, `iso`, `aperture`, `make`, `model`, `lens`, `shutter`, `focal`, `taken_at`, `taken_at_orig_tz`, `latitude`, `longitude`, `altitude`, `imgDirection`, `location`, `livePhotoContentID`, `public`, `star`, `album_id`, `owner_id`, `thumb2x`, `thumbUrl`, `medium_width`, `medium_height`, `medium2x_width`, `medium2x_height`, `small_width`, `small_height`, `small2x_width`, `small2x_height`, `updated_at`, `created_at`) values (16389143783122, 3858aecb19032163273bf325013490334f7c26e1, IMG_20210307_104221, 3858aecb19032163273bf32501349033.jpg, , , 4160, 3120, image/jpeg, 4846236, 100, f/2.2, asus, ASUS_X00TD, , 1/980 s, 3 mm, 2021-03-07 10:42:21, UTC, 45.026660388889, 5.5883266388889, 1898.857, 282, ?, ?, 0, 0, 16389142874379, 0, 1, 3858aecb19032163273bf32501349033.jpeg, 1440, 1080, 2880, 2160, 480, 360, 960, 720, 2021-12-07 21:59:41, 2021-12-07 21:59:41))

From what I understand, the album_id provided when adding the photo is too big for the database. So I deleted my album, reset the Autoincrement to 1 in phpmyadmin, but still got the same error. As you can see, the ID generated for a new album is weird: image

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Install Lychee 4.4.0 with PHP 8.0 and MariaDB 10.3.32
  2. Click on 'New album'
  3. Go in the empty album and click on 'Add photo or video'
  4. Select a bunch of photos, and get the error
  5. (it's random but I got it 3 times out of 4 tries after fresh install each time)

Screenshots

Output of the diagnostics [REQUIRED]

 Diagnostics
    -------
    Warning: Dropbox import not working. dropbox_key is empty.
    Info: Latest version of PHP is 8.1

    System Information
    --------------
    Lychee Version (release):        4.4.0
    DB Version:                      4.4.0

    composer install:                --no-dev
    APP_ENV:                         production
    APP_DEBUG:                       false

    System:                          Linux
    PHP Version:                     8
    PHP User agent:                  Lychee/4 (https://lycheeorg.github.io/)
    Max uploaded file size:          128M
    Max post size:                   128M
    Max execution time:              200
    MySQL Version:                   10.3.32-MariaDB

    Imagick:                         1
    Imagick Active:                  1
    Imagick Version:                 1808
    GD Version:                      2.2.5

    Config Information
    --------------
    version:                         040400
    check_for_updates:               0
    sorting_Photos_col:              taken_at
    sorting_Photos_order:            ASC
    sorting_Albums_col:              max_taken_at
    sorting_Albums_order:            ASC
    imagick:                         1
    skip_duplicates:                 0
    small_max_width:                 0
    small_max_height:                360
    medium_max_width:                1920
    medium_max_height:               1080
    lang:                            fr
    layout:                          1
    image_overlay_type:              desc
    default_license:                 reserved
    compression_quality:             90
    full_photo:                      1
    delete_imported:                 0
    Mod_Frame:                       1
    Mod_Frame_refresh:               30
    thumb_2x:                        1
    small_2x:                        1
    medium_2x:                       1
    landing_page_enable:             0
    landing_owner:                   John Smith
    landing_title:                   John Smith
    landing_subtitle:                Cats, Dogs & Humans Photography
    landing_facebook:                https://www.facebook.com/JohnSmith
    landing_flickr:                  https://www.flickr.com/JohnSmith
    landing_twitter:                 https://www.twitter.com/JohnSmith
    landing_instagram:               https://instagram.com/JohnSmith
    landing_youtube:                 https://www.youtube.com/JohnSmith
    landing_background:              dist/cat.jpg
    site_title:                      Photos
    site_copyright_enable:           1
    site_copyright_begin:            2021
    site_copyright_end:              2022
    additional_footer_text:          
    display_social_in_gallery:       0
    public_search:                   0
    SL_enable:                       0
    SL_for_admin:                    0
    public_recent:                   0
    recent_age:                      1
    public_starred:                  0
    downloadable:                    0
    photos_wraparound:               1
    map_display:                     0
    zip64:                           1
    map_display_public:              0
    map_provider:                    Wikimedia
    force_32bit_ids:                 0
    map_include_subalbums:           0
    update_check_every_days:         3
    has_exiftool:                    0
    share_button_visible:            0
    import_via_symlink:              0
    has_ffmpeg:                      0
    location_decoding:               0
    location_decoding_timeout:       30
    location_show:                   1
    location_show_public:            0
    rss_enable:                      0
    rss_recent_days:                 7
    rss_max_items:                   100
    prefer_available_xmp_metadata:   0
    editor_enabled:                  1
    lossless_optimization:           0
    swipe_tolerance_x:               150
    swipe_tolerance_y:               250
    local_takestamp_video_formats:   .avi|.mov
    log_max_num_line:                1000
    unlock_password_photos_with_url_param: 0
    nsfw_visible:                    1
    nsfw_blur:                       0
    nsfw_warning:                    0
    nsfw_warning_admin:              0
    map_display_direction:           1
    album_subtitle_type:             oldstyle
    upload_processing_limit:         4
    public_photos_hidden:            1
    new_photos_notification:         0

Browser and system

ildyria commented 2 years ago

The id generated for the album is time based.

It is kinda a shitty temporary solution, but there is an advanced setting force_32bit_ids set it to 1 and this should hopefully resolve this bug while waiting for the new ID from @nagmat84 . :)

To set it, you can go Left menu => Settings. At the bottom there is the more button. And this will allow you to change the settings.

YannPl commented 2 years ago

Hi

Thanks for the quick answer, it seem to work for now. Hopefully it will be okay :)