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

Unable to load images; App\Actions\HoneyPot\BasePipe::throwNotFound:40 #2160

Closed joebrands closed 9 months ago

joebrands commented 9 months ago

Detailed description of the problem

After doing a clean install, when I upload any images, they cannot be displayed and the error log shows a lot of:

[2024-01-04 01:16:07] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route {mydomain}/uploads/thumb2x/36/04/134a223c900c63036a432cf7eee9.jpeg could not be found.

[2024-01-04 01:16:09] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route {mydomain}/uploads/small2x/36/04/134a223c900c63036a432cf7eee9.jpg could not be found.

[2024-01-04 01:16:09] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/unsorted/{mydomain}/uploads/medium/36/04/134a223c900c63036a432cf7eee9.jpg could not be found.

But if I go to {mydomain}/uploads/medium/36/04/134a223c900c63036a432cf7eee9.jpg the image displays fine. Ive tried both buitlin SQLite and MySQL DB but no difference. I am accessing the web UI locally but has the same result through the proxy. Lychee is running on Unraid if that makes any difference. I am sure it has to do with my setup somehow but Ive tried everything I know of, any help would be fantastic.

Steps to reproduce the issue

  1. Clean install with builtin SQLite DB
  2. Upload any image

Screenshots Image1 Image2

Output of the diagnostics

Diagnostics
-----------
Warning: /var/www/html/Lychee/public/uploads/ is owned by group lychee, but should be owned by one out of root
Warning: /var/www/html/Lychee/public/uploads/import is owned by group lychee, but should be owned by one out of root
Warning: /var/www/html/Lychee/public/uploads/medium is owned by group lychee, but should be owned by one out of root
Warning: /var/www/html/Lychee/public/uploads/medium/36 is owned by group lychee, but should be owned by one out of root
Warning: /var/www/html/Lychee/public/uploads/medium/36/04 is owned by group lychee, but should be owned by one out of root
Warning: 21 more directories with wrong owner
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.
Error: APP_URL does not match the current url. This will break WebAuthn authentication.
Error: APP_URL does not match the current url. This will prevent images to be properly displayed.
Info: Latest version of PHP is 8.3
Warning: git (software) is not available.
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:                                America/New_York
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:                      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:                                    en
image_overlay_type:                      desc
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:                              John Smith
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:                    2019
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:                            1
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:                                  justified
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

Browser: Edge and Firefox System: Win 10

ildyria commented 9 months ago

My guess is a reverse proxy or rewrite rule mis-configuration. It seems that the rewrite rule you are using is slightly incorrect because it is considering images as php scripts and sending those paths to the index.php (hence why you get the HoneyPot errors).

joebrands commented 9 months ago

Okay that would make sense but it also does it when I access locally and not through any proxy.

ildyria commented 9 months ago

stupid question, does your APP_URL start with http or https ?

joebrands commented 9 months ago

Nope, I left that off the url. Should I include that?

EDIT: Added https (http removes the errors but then it still doesnt work) to the url and it seems to work behind the proxy now, although it still shows: Error: APP_URL does not match the current url. This will break WebAuthn authentication. Error: APP_URL does not match the current url. This will prevent images to be properly displayed. But access locally still doesnt work. Upload doesnt work but Im assuming that has to do with my nginx config

ildyria commented 9 months ago

if you are using https in your reverse proxy but feeding http to your docker instance, you can use APP_FORCE_HTTPS=true to enforce https.

vvrc5 commented 9 months ago

But access locally still doesnt work.

I think you are using 2 different URLs while accessing locally and via proxy (correct me if I am wrong), so your APP_URL set for proxy access is "wrong" when accessing it locally and vice versa. When you update the APP_URL to reflect your local URL, be it an IP address or a local name, your proxy setup will not work properly. but local access works in this scenario - is this the case?

ttrvl commented 9 months ago

Same problem: produce 4 error messages in logs each time while trying to display any image. Error messages for 1st try: [2024-01-06 12:58:47] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/o_E8QN-NLOBtlhL6ZQoXPzFs/uploads/medium/cb/4d/bbe46fa871857cd3c8d9ba6bc27e.jpg could not be found. [2024-01-06 12:58:47] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/o_E8QN-NLOBtlhL6ZQoXPzFs/uploads/medium/cb/4d/bbe46fa871857cd3c8d9ba6bc27e.jpg could not be found. [2024-01-06 12:58:47] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/o_E8QN-NLOBtlhL6ZQoXPzFs/uploads/thumb/5d/e4/cf392a7ea12ff1a0f48c3caadcac.jpeg could not be found. [2024-01-06 12:58:47] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/o_E8QN-NLOBtlhL6ZQoXPzFs/uploads/thumb/e2/47/1235932db793b67b716c3d3c858c.jpeg could not be found.

Error messages for 2st try (another image): [2024-01-06 13:04:01] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/be5DxR9r9J0l-CPANn1MIOiS/uploads/medium/82/42/6a03cec634b86701833a91f468af.jpg could not be found. [2024-01-06 13:04:01] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/be5DxR9r9J0l-CPANn1MIOiS/uploads/medium/82/42/6a03cec634b86701833a91f468af.jpg could not be found. [2024-01-06 13:04:01] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/be5DxR9r9J0l-CPANn1MIOiS/uploads/thumb/03/4f/439f26421345939a2ecde87aaffb.jpeg could not be found. [2024-01-06 13:04:01] production.ERROR: App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/be5DxR9r9J0l-CPANn1MIOiS/uploads/thumb/51/54/d945eb8807b6c7fe9027f9021889.jpeg could not be found.

All was working fine until updating from 4.13.0 to 5.0.2 APP_URL set to https APP_FORCE_HTTPS=true or false doesnt change anything System: Linux Debian, apache VirtualHost, no proxy, no rewrite rules

Diagnostics
-----------
    Warning: Dropbox import not working. dropbox_key is empty.
    Warning: zend.assertions is disabled although Lychee is in debug mode. For easier debugging code generation for assertions should be enabled.
    Info: Latest version of PHP is 8.3

System Information
------------------
    Lychee Version (git):                    master (f29efc5) -- Up to date (2 days ago).
    DB Version:                              5.0.2

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

    System:                                  Linux
    PHP Version:                             8.2.7
    PHP User agent:                          Lychee/4 (https://lycheeorg.github.io/)
    Timezone:                                Europe/Moscow
    Max uploaded file size:                  200M
    Max post size:                           100M
    Livewire chunk size:                     12.00 MB
    Max execution time:                      300
    MySQL Version:                           10.11.4-MariaDB-1~deb12u1-log

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

Same problem: produce 4 error messages in logs each time while trying to display any image.

What do you mean by that ? Is it by opening an image ? Is it by browsing through the albums ? Do the images shows on the thumbs ? Can you check what the html looks like when you try to load that said image, i.e. what is the address ?

ttrvl commented 9 months ago

Same problem: produce 4 error messages in logs each time while trying to display any image.

What do you mean by that ? Is it by opening an image ? Is it by browsing through the albums ? Do the images shows on the thumbs ? Can you check what the html looks like when you try to load that said image, i.e. what is the address ?

That is happening while trying to open any image in any type of album (public/private/nsfw) and it is no matter logged in user or not (same result in incognito-mode). Just like that: open site, see list of albums (works fine), open any of albums - see list of images (works fine), try to open any of image - black screen without any images (original and thumbs of left-right navigation), only navigation buttons present (and working as intended).

You can see all that here: https://blog.kagura.ru

Thank you!

Just checked files, mentioned in error message - they all present in said paths, with right access permissions.

joebrands commented 9 months ago

Sorry for the delay as I am traveling but I changed my APP_URL to include https and behind the proxy and it displays the images fine now but I have some minor issues still. I played with APP_FORCE_HTTPS but left it off because I have my proxy doing that.

If I access it on the local address, it does not display images but allows me to upload fine so I have been uploading through the local address.

ildyria commented 9 months ago

(or swiped on mobile).

There is a fix incomming.

hnconsulting commented 9 months ago

Same problem: produce 4 error messages in logs each time while trying to display any image.

What do you mean by that ? Is it by opening an image ? Is it by browsing through the albums ? Do the images shows on the thumbs ? Can you check what the html looks like when you try to load that said image, i.e. what is the address ?

That is happening while trying to open any image in any type of album (public/private/nsfw) and it is no matter logged in user or not (same result in incognito-mode). Just like that: open site, see list of albums (works fine), open any of albums - see list of images (works fine), try to open any of image - black screen without any images (original and thumbs of left-right navigation), only navigation buttons present (and working as intended).

You can see all that here: https://blog.kagura.ru

Thank you!

Just checked files, mentioned in error message - they all present in said paths, with right access permissions.

Same issues here ... as described, everything seems fine, apart from honeypot hitting when opening a single picture. All album overviews work flawlessly, even throughout nested albums. Downloading the corresponding photo in different sizes also works flawlessly ... it's only the viewing of an individual photo that is corrupted and rewarded with the display of a 'broken file' icon.

[edit_1] An additional example to Tonys website above, can be found here: https://medienknubbel.de [/edit_1]

[edit_2] For reference, here anexample of the same kind of error messages as already stated:

Error 2024-01-09 17:14:39 production App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/miLro7G4wf697j9ROlIk1W6r/uploads/medium/25/0c/f0dc43a02878551b9955ee6dc86a.jpg could not be found. Error 2024-01-09 17:14:39 production App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/miLro7G4wf697j9ROlIk1W6r/uploads/medium2x/25/0c/f0dc43a02878551b9955ee6dc86a.jpg could not be found. Error 2024-01-09 17:14:39 production App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/miLro7G4wf697j9ROlIk1W6r/uploads/thumb/16/63/7fa1489aa9cec3e84876c190533c.jpeg could not be found. Error 2024-01-09 17:14:39 production App\Actions\HoneyPot\BasePipe::throwNotFound:40 The route gallery/miLro7G4wf697j9ROlIk1W6r/uploads/thumb/97/f0/09acb47053034e5589f1f76814be.jpeg could not be found. [/edit_2]

[edit_3] By the way, same effect with newly uploaded files. [/edit_3]

[edit_4] Temporary workaround is to set "LIVEWIRE_ENABLED=false" in lychee/.env in order to disable v5 layout and return to the old, working layout with correct display of photographs. [/edit_4]

ttrvl commented 9 months ago

[edit_4] Temporary workaround is to set "LIVEWIRE_ENABLED=false" in lychee/.env in order to disable v5 layout and return to the old, working layout with correct display of photographs. [/edit_4]

Confirming, after disabling LIVEWIRE in .env all images are correctly displayed. Tnx @abscondita Hope, that will help narrowing down reason of that issue.

ildyria commented 9 months ago

Hopefully after 5.0.3 this should be easier to debug as we added quite a few more diagnostics tests.

mjechow commented 9 months ago

LIVEWIRE_ENABLED=false did the trick for me as well. Thanks that saved a lot of time.

ildyria commented 9 months ago

This should be resolved with 5.0.3

mjechow commented 9 months ago

Solved it for me. Had to uncomment LYCHEE_UPLOADS_URL in .env