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.27k stars 295 forks source link

Diagnostics is showing "Loading ..." indefinitely #2152

Closed sigulete closed 6 months ago

sigulete commented 7 months ago

Detailed description of the problem [REQUIRED]

I have updated my instance to v5.0.2 (from v4.13.0) and the output from Diagnostics stays as Loading for ever.

Also the Max uploaded file size and Max post size are not being updated based on the nginx.conf file mounted in the container.

Using the base from nginx.conf, the following sentence is not picked up:

fastcgi_param PHP_VALUE "post_max_size=5G
                max_execution_time=3600
                upload_max_filesize=5G
                memory_limit=256M"

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Login to Lychee 5.0.2
  2. Click on 'Settings => Diagnostics'
  3. It will show Loading... indefinitely.

Output of the diagnostics [REQUIRED]

(Settings => Diagnostics or https://example.com/Diagnostics or php artisan lychee:diagnostics)

Diagnostics

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. Info: Latest version of PHP is 8.3 Warning: Online updates are disabled by configuration Foreign key: access_permissions.user_id → users.id : CASCADE Foreign key: albums.id → base_albums.id : NO ACTION Foreign key: base_albums.owner_id → users.id : NO ACTION Foreign key: jobs_history.owner_id → users.id : NO ACTION Foreign key: photos.album_id → albums.id : NO ACTION Foreign key: photos.owner_id → users.id : NO ACTION Foreign key: size_variants.photo_id → photos.id : NO ACTION Foreign key: sym_links.size_variant_id → size_variants.id : NO ACTION Foreign key: tag_albums.id → base_albums.id : NO ACTION

System Information

Lychee Version (git): ?? (33354a2) -- Could not compare. DB Version: 5.0.2

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

System: Linux PHP Version: 8.2.7 PHP User agent: Lychee/4 (https://lycheeorg.github.io/) Timezone: Australia/Melbourne Max uploaded file size: 2M Max post size: 8M Livewire chunk size: 0.00 B Max execution time: 0 SQLite Version: 3.40.1

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

Config Information

version: 050002 check_for_updates: 0 sorting_photos_col: taken_at sorting_photos_order: ASC sorting_albums_col: title sorting_albums_order: DESC imagick: 1 skip_duplicates: 1 small_max_width: 0 small_max_height: 360 medium_max_width: 1920 medium_max_height: 1080 lang: en image_overlay_type: date default_license: none 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: Owner landing_title: Title landing_subtitle: Family Photos sm_facebook_url: sm_flickr_url: sm_twitter_url: sm_instagram_url: sm_youtube_url: landing_background: dist/cat.webp site_title: Photos footer_show_copyright: 0 site_copyright_begin: 2000 site_copyright_end: 3000 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: 1 zip64: 1 map_display_public: 0 map_provider: OpenStreetMap.org force_32bit_ids: 0 map_include_subalbums: 0 update_check_every_days: 3 has_exiftool: 0 share_button_visible: 1 import_via_symlink: 0 has_ffmpeg: 1 location_decoding: 1 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: 8 new_photos_notification: 0 legacy_id_redirection: 1 zip_deflate_level: 6 SA_enabled: 1 default_album_protection: 1 album_decoration: all 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: /bin/ffmpeg ffprobe_path: /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

Browser and system

d7415 commented 7 months ago

Using the base from nginx.conf, the following sentence is not picked up:

fastcgi_param PHP_VALUE "post_max_size=5G
                max_execution_time=3600
                upload_max_filesize=5G
                memory_limit=256M"

Is there a semicolon at the end of that line that you missed copy-pasting? (i.e. 256M";) If not, try adding it.

sigulete commented 7 months ago

Hi d7415,

Yes, the semicolon is included. I'm showing the full section.

 # Serve /index.php through PHP
        location = /index.php {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;

            try_files $uri $document_root$fastcgi_script_name =404;

            # Mitigate https://httpoxy.org/ vulnerabilities
            fastcgi_param HTTP_PROXY "";

            fastcgi_pass unix:/run/php/php8.2-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PHP_VALUE "post_max_size=5G
                max_execution_time=3600
                upload_max_filesize=5G
                memory_limit=256M";
            fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
            include fastcgi_params;
        }
sigulete commented 7 months ago

Additional information to this problem. I'm attaching a screenshot of Diagnostics as appears in the browser. It remains loading and eventually there is a message related to Proxy Error.

Screenshot from 2024-01-04 00-01-23

Interestingly, the values for Post Max Size and Upload Max File Size are showing correctly in the web, unlike the manually generated diagnostic using command line. I'm using a Docker container. So, I was running php artisan.. inside the container.

Screenshot from 2024-01-03 23-40-55

ildyria commented 7 months ago

Can you check this: https://lycheeorg.github.io/docs/advanced-setups.html#configure-env

It sounds like to me it is going through your tree structure and trying to figure out whether access are rights or not.

sigulete commented 7 months ago

I can confirm that I have used the following setup:

SKIP_DIAGNOSTICS_CHECKS=BasicPermissionCheck

My guess is that this property is not being queried in the latest v5 release.

ildyria commented 7 months ago

My guess is that this property is not being queried in the latest v5 release.

Does not make sense, because the code is pretty much the same. See here for the collection of data: https://github.com/LycheeOrg/Lychee/blob/master/app/Actions/Diagnostics/Errors.php#L55

And here for the call: https://github.com/LycheeOrg/Lychee/blob/master/app/Livewire/Components/Modules/Diagnostics/Errors.php#L33

ildyria commented 7 months ago

Do you observe different behaviour when you access https://example.com/Diagnostics notice the capital D instead of a lower case one.

sigulete commented 7 months ago

Using the link with capital letter (Diagnostics) works flawless. Output is produced immediately (no delays).

d7415 commented 7 months ago

Interestingly, the values for Post Max Size and Upload Max File Size are showing correctly in the web, unlike the manually generated diagnostic using command line.

That part makes sense - the command line isn't running through nginx, so doesn't know anything about the php settings there.

sigulete commented 6 months ago

This is resolved using:

https://example.com/Diagnostics notice the capital D instead of a lower case one.