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.42k stars 303 forks source link

Logs full of 'No query results for model [App\Models\Page]' #1343

Closed vjuliano closed 2 years ago

vjuliano commented 2 years ago

Detailed description of the problem [REQUIRED]

Logs are full of routing errors. This does not seem to have an impact functionally but pollutes the logs, as they use the 'error' logging level.

2022-05-23 18:38:40 UTC -- error -- App\Http\Controllers\PageController::page -- 44 -- No query results for model [App\Models\Page].; caused by 2022-05-23 18:38:39 UTC -- error -- Illuminate\Database\Eloquent\Builder::firstOrFail -- 527 -- No query results for model [App\Models\Page]. 2022-05-23 18:38:39 UTC -- error -- App\Http\Controllers\PageController::page -- 44 -- No query results for model [App\Models\Page].; caused by 2022-05-23 18:38:37 UTC -- error -- Illuminate\Routing\AbstractRouteCollection::handleMatchedRoute -- 43 -- 2022-05-23 18:38:37 UTC -- error -- App\Http\Middleware\FixStatusCode::handle -- 31 -- ; caused by 2022-05-23 18:38:36 UTC -- error -- Illuminate\Routing\AbstractRouteCollection::methodNotAllowed -- 117 -- The POST method is not supported for this route. Supported methods: GET, HEAD. 2022-05-23 18:38:36 UTC -- error -- App\Http\Middleware\FixStatusCode::handle -- 31 -- The POST method is not supported for this route. Supported methods: GET, HEAD.; caused by 2022-05-23 18:38:35 UTC -- error -- Illuminate\Database\Eloquent\Builder::firstOrFail -- 527 -- No query results for model [App\Models\Page].

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Open 'Show Logs' in sidebar

Screenshots Screen Shot 2022-05-23 at 3 12 10 PM

Output of the diagnostics [REQUIRED]

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.

System Information
--------------
Lychee Version (git):            master (7e9cf7c) --  - Up to date (1 days ago).
DB Version:                      4.5.1

composer install:                dev
APP_ENV:                         production
APP_DEBUG:                       true

System:                          Linux
PHP Version:                     8.1
PHP User agent:                  Lychee/4 (https://lycheeorg.github.io/)
Timezone:                        America/Los_Angeles
Max uploaded file size:          500M
Max post size:                   500M
Max execution time:              200
MySQL Version:                   10.6.7-MariaDB-2ubuntu1

Imagick:                         1
Imagick Active:                  1
Imagick Version:                 1691
GD Version:                      2.3.0

Config Information
--------------
version:                         040501
check_for_updates:               1
sorting_photos_col:              created_at
sorting_photos_order:            DESC
sorting_albums_col:              max_taken_at
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
layout:                          1
image_overlay_type:              none
default_license:                 CC-BY-NC-ND-4.0
compression_quality:             90
full_photo:                      1
delete_imported:                 1
Mod_Frame:                       1
Mod_Frame_refresh:               30
thumb_2x:                        1
small_2x:                        1
medium_2x:                       1
landing_page_enable:             1
landing_owner:                   Vincent Juliano
landing_title:                   Life on 35mm
landing_subtitle:                Click top right to continue.  Next page top left to login
landing_facebook:                
landing_flickr:                  
landing_twitter:                 
landing_instagram:               
landing_youtube:                 
landing_background:              /uploads/medium/3d4bf4e35e5ea06853d7983c88efb6a2.jpg
site_title:                      Vince Juliano's Photo Gallery
site_copyright_enable:           1
site_copyright_begin:            2021
site_copyright_end:              2022
additional_footer_text:          "Alex's Photos" copyright Alex Panicacci 2022
display_social_in_gallery:       0
public_search:                   0
SL_enable:                       0
SL_for_admin:                    0
public_recent:                   0
recent_age:                      60
public_starred:                  0
downloadable:                    1
photos_wraparound:               1
map_display:                     1
zip64:                           1
map_display_public:              1
map_provider:                    Wikimedia
force_32bit_ids:                 0
map_include_subalbums:           1
update_check_every_days:         3
has_exiftool:                    1
share_button_visible:            1
import_via_symlink:              0
has_ffmpeg:                      1
location_decoding:               1
location_decoding_timeout:       30
location_show:                   1
location_show_public:            1
rss_enable:                      0
rss_recent_days:                 7
rss_max_items:                   100
prefer_available_xmp_metadata:   0
editor_enabled:                  1
lossless_optimization:           1
swipe_tolerance_x:               150
swipe_tolerance_y:               250
local_takestamp_video_formats:   .avi|.mov
log_max_num_line:                10000
unlock_password_photos_with_url_param: 0
nsfw_visible:                    0
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:         1
legacy_id_redirection:           1

About

Browser and system

Client: Firefox 100.0.2 Mac Os 12.4 Server: Ubuntu 22.04

qwerty287 commented 2 years ago
  1. I believe you can safely ignore this.
  2. This happens when trying to get any page in the root path (e.g. http://domain.tld/abcdef) which is not the index page, /api or other paths that are used internally. Maybe you have something (a script?) that requests an URL like this.
  3. If this doesn't help and you would like to prevent errors like this, you can remove the last line in routes/web.php. This should fix the issue (this route is unused right now, but might get a function in a later release).
qwerty287 commented 2 years ago

@jln646v can you verify that my suggestions are working?

qwerty287 commented 2 years ago

@jln646v pleaso reopen if you need it.