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

Missing album cover picture after migration from 4.13.0 to 5.0.3 #2192

Closed LudovicRousseau closed 9 months ago

LudovicRousseau commented 9 months ago

Detailed description of the problem

I migrated a system from Lychee 4.13.0 to 5.0.3. I can see my albums but they all lost their cover picture. The albums all still have a favorite picture but this picture is no more used as the cover picture. I need to select a picture as album cover picture to have a cover picture.

I note that I did not get this problem on another server. Maybe that is because I updated Lychee more frequently and the database was updated correctly.

For the problematic server the upgrade said:


                           APPLICATION IN PRODUCTION.                           

 ┌ Are you sure you want to run this command? ──────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

   INFO  Application key set successfully.  

                           APPLICATION IN PRODUCTION.                           

 ┌ Are you sure you want to run this command? ──────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

   INFO  Running migrations.  

  2023_09_24_110932_add_date_display_configurations ................ 12ms DONE
  2023_09_24_223901_add_config_livewire_chunk_size .................. 1ms DONE
  2023_09_24_233717_refactor_type_layout_livewire ................... 2ms DONE
  2023_09_25_123925_config_blur_nsfw ................................ 1ms DONE
  2023_10_01_143159_config_map_provider ............................. 1ms DONE
  2023_12_18_191723_config_public_search ............................ 3ms DONE
  2023_12_18_232500_config_pagination_search_limit .................. 4ms DONE
  2023_12_19_115547_search_characters_limit ......................... 1ms DONE
  2023_12_19_122408_add_positive_requirements ....................... 1ms DONE
  2023_12_20_180854_add_setting_height_width_gallery ................ 2ms DONE
  2023_12_23_160356_bump_version050000 .............................. 2ms DONE
  2023_12_25_115454_add_setting_display_thumb_overlay ............... 2ms DONE
  2023_12_27_163004_bump_version050001 .............................. 2ms DONE
  2023_12_28_144906_bump_version050002 .............................. 1ms DONE
  2023_12_28_165358_add_subalbum_sorting_per_album ................. 24ms DONE
  2023_12_30_220515_add_thumbs_albums_aspect_ratio .................. 1ms DONE
  2023_12_30_221215_add_thumbs_albums_aspect_ratio_per_album ........ 8ms DONE
  2024_01_03_154055_add_album_no_header_setting ..................... 2ms DONE
  2024_01_08_155917_bump_version050003 .............................. 1ms DONE
  2024_01_08_163328_left_right_login_and_back ....................... 1ms DONE

I also discover that if a picture is the album cover picture I now see a new icon on the picture. On the 1st server that still have the album cover picture correctly configured I do NOT have this new icon. I only have the favorite icon and the picture is selected as the album cover picture.

On the 2nd server I see pictures with the favorite icon on them but they are NOT selected as album cover picture.

The 2 servers have different configuration:

Steps to reproduce the issue

It may be related to the previous state of my SQL database. I don't know how to reproduce.

Screenshots If applicable, add screenshots to help explain your problem.

Output of the diagnostics

    Diagnostics
    -----------
        Warning: /home/rousseau/Serveurs_web/images.apdu.fr/Lychee/public/uploads/ has permissions 0775, but should have 2775
        Warning: /home/rousseau/Serveurs_web/images.apdu.fr/Lychee/public/uploads/thumb has permissions 0775, but should have 2775
        Warning: /home/rousseau/Serveurs_web/images.apdu.fr/Lychee/public/uploads/medium has permissions 0775, but should have 2775
        Warning: /home/rousseau/Serveurs_web/images.apdu.fr/Lychee/public/uploads/import has permissions 0775, but should have 2775
        Warning: /home/rousseau/Serveurs_web/images.apdu.fr/Lychee/public/uploads/big has permissions 0775, but should have 2775
        Warning: 3 more directories with wrong permissions
        Warning: Dropbox import not working. dropbox_key is empty.
        Warning: You may experience problems when uploading a photo of large size. Take a look in the FAQ for details.
        Warning: You may experience problems when uploading a photo of large size. Take a look in the FAQ for details.
        Warning: You may experience problems when uploading a photo of large size or handling many/large albums. Take a look in the FAQ for details.
        Info: Latest version of PHP is 8.3

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

        composer install:                        --no-dev
        APP_ENV:                                 production
        APP_DEBUG:                               false
        APP_URL:                                 set
        APP_DIR:                                 set
        LOG_VIEWER_ENABLED:                      true
        LIVEWIRE_ENABLED:                        true

        System:                                  Linux
        PHP Version:                             8.2.7
        PHP User agent:                          Lychee/4 (https://lycheeorg.github.io/)
        Timezone:                                Europe/Paris
        Max uploaded file size:                  2M
        Max post size:                           8M
        Livewire chunk size:                     2.00 MB
        Max execution time:                      30
        MySQL Version:                           10.11.4-MariaDB-1~deb12u1

        exec() Available:                        yes
        Imagick Available:                       1
        Imagick Enabled:                         1
        Imagick Version:                         1691
        GD Version:                              2.3.3
        Number of foreign key:                   11 found.

    Config Information
    ------------------
        version:                                 050003
        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
        image_overlay_type:                      desc
        default_license:                         reserved
        compression_quality:                     90
        grants_full_photo_access:                1
        delete_imported:                         0
        mod_frame_enabled:                       1
        mod_frame_refresh:                       30
        thumb_2x:                                1
        small_2x:                                1
        medium_2x:                               1
        landing_page_enable:                     0
        site_owner:                              Ludovic Rousseau
        landing_title:                           John Smith
        landing_subtitle:                        Cats, Dogs & Humans Photography
        sm_facebook_url:                         https://www.facebook.com/JohnSmith
        sm_flickr_url:                           https://www.flickr.com/JohnSmith
        sm_twitter_url:                          https://www.twitter.com/JohnSmith
        sm_instagram_url:                        https://instagram.com/JohnSmith
        sm_youtube_url:                          https://www.youtube.com/JohnSmith
        landing_background:                      dist/cat.webp
        site_title:                              Lychee v5
        footer_show_copyright:                   1
        site_copyright_begin:                    2012
        site_copyright_end:                      2019
        footer_additional_text:                  
        footer_show_social_media:                0
        search_public:                           0
        SL_enable:                               0
        SL_for_admin:                            0
        recent_age:                              1
        grants_download:                         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:                              1
        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
        nsfw_banner_override:                    
        map_display_direction:                   1
        album_subtitle_type:                     oldstyle
        upload_processing_limit:                 4
        new_photos_notification:                 0
        legacy_id_redirection:                   1
        zip_deflate_level:                       6
        SA_enabled:                              1
        default_album_protection:                1
        album_decoration:                        layers
        album_decoration_orientation:            row
        allow_username_change:                   1
        auto_fix_orientation:                    1
        use_job_queues:                          0
        random_album_id:                         starred
        use_last_modified_date_when_no_exif_date: 0
        ffmpeg_path:                             /usr/bin/ffmpeg
        ffprobe_path:                            /usr/bin/ffprobe
        layout:                                  square
        date_format_photo_thumb:                 M j, Y, g:i:s A e
        date_format_photo_overlay:               M j, Y, g:i:s A e
        date_format_sidebar_uploaded:            M j, Y, g:i:s A e
        date_format_sidebar_taken_at:            M j, Y, g:i:s A e
        date_format_hero_min_max:                F Y
        date_format_hero_created_at:             M j, Y, g:i:s A T
        date_format_album_thumb:                 M Y
        upload_chunk_size:                       0
        nsfw_banner_blur_backdrop:               0
        search_pagination_limit:                 1000
        search_minimum_length_required:          4
        photo_layout_justified_row_height:       320
        photo_layout_masonry_column_width:       300
        photo_layout_grid_column_width:          250
        photo_layout_square_column_width:        200
        photo_layout_gap:                        12
        display_thumb_album_overlay:             always
        display_thumb_photo_overlay:             hover
        default_album_thumb_aspect_ratio:        1/1
        use_album_compact_header:                0
        login_button_position:                   left
        back_button_enabled:                     0
        back_button_text:                        Return to Home
        back_button_url:                         /

Browser and system

ildyria commented 9 months ago

The albums all still have a favorite picture but this picture is no more used as the cover picture.

That sounds like a big hint.

LudovicRousseau commented 9 months ago

The albums all still have a favorite picture but this picture is no more used as the cover picture.

That sounds like a big hint.

I don't know what is the expected behaviour.

Having 2 concepts: favorites pictures and album cover picture is a good idea. I guess a database upgrade did not worked as expected.

ildyria commented 9 months ago

Expected behavior should be:

LudovicRousseau commented 9 months ago

OK. So we have a problem. I have albums with NO cover picture at all.

In storage/logs/errors.log I have:

[2024-01-13 16:12:35] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route public/uploads/big could not be found.
[2024-01-13 16:12:40] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route public/uploads/medium could not be found.
[2024-01-13 16:13:19] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route public/uploads/thumb could not be found.

Does that help?

ildyria commented 9 months ago

Can you see if you can replace line 43 of app/Models/Extensions/Thumb.php with this:

            $svAlbumThumbs = [SizeVariantType::SMALL, SizeVariantType::SMALL2X, SizeVariantType::THUMB, SizeVariantType::THUMB2X];

instead of:

            $svAlbumThumbs = [SizeVariantType::SMALL, SizeVariantType::SMALL2X];

if that fixes it ?

LudovicRousseau commented 9 months ago

Yes, problem fixed with your change.

ildyria commented 9 months ago

Great then it means that those pictures did not have a small generated for them (which I find surprising). The thumb is a failover.