Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] Error 500 on Albums::get() when using a user account. #635

Closed
Tracked by #634
JustinGutsche opened this issue Jun 24, 2020 · 11 comments
Closed
Tracked by #634
Labels
bug Something isn't working

Comments

@JustinGutsche
Copy link

JustinGutsche commented Jun 24, 2020

Detailed description of the problem [REQUIRED]

A clear and concise description of what the bug is.
After a fresh install I just can do the /install Part on my Website and after it says I'm finished, i want to go on the main page and nothing shows up. I just can see the error. Reinstalled for about 3-4 times, but still not working

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. fresh install of Lychee v4
  2. done the /install Part on Website and then after Migration, I can't use the normal site.

Screenshots
If applicable, add screenshots to help explain your problem.
The only thing, that the site says.
https://i.imgur.com/jhR9ZXp.png

Output of the diagnostics [REQUIRED]

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

Diagnostics
-----------
Error: username empty or not set in database
Error: password empty or not set in database
Warning: Dropbox import not working. dropbox_key is empty.
Warning: You may experience problems when uploading a large amount of photos. Take a look in the FAQ for details.
Warning: Pictures that are rotated lose their metadata! Please install Imagick to avoid that.

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

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

System:                     Linux
PHP Version:                7.4
MySQL Version:              5.7.29

Imagick:                    -
Imagick Active:             1
Imagick Version:            -
GD Version:                 2.2.5

Config Information
------------------
version:                    040006
check_for_updates:          0
sorting_Photos_col:         takestamp
sorting_Photos_order:       ASC
sorting_Albums_col:         max_takestamp
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
layout:                     1
image_overlay:              1
image_overlay_type:         desc
default_license:            none
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:                 Lychee v4
site_copyright_enable:      1
site_copyright_begin:       2019
site_copyright_end:         2019
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

Browser and system

Latest Firefox, Lychee hosted on Debian with NGINX

@d7415
Copy link
Contributor

d7415 commented Jun 24, 2020

Please try this. Hopefully it will give some more clues.

@ildyria ildyria added the More info required Issue which will be closed under 14 days if not replied by the author label Jun 26, 2020
@JustinGutsche
Copy link
Author

JustinGutsche commented Jun 27, 2020

Please try this. Hopefully it will give some more clues.

I've tried is, so I found out that the I've got redirected to saaltofreak.de/php/index.php, but in my /public directory isn't a /php folder.
Also nginx error.log says:

2020/06/27 12:16:59 [error] 3646#3646: *1 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/var/www/html/Lychee/public/bootstrap/PanicAttack.php): failed to open stream: No such file or directory in /var/www/html/Lychee/public/php/index.php on line 21
PHP message: PHP Fatal error: require_once(): Failed opening required '/var/www/html/Lychee/public/php/../bootstrap/PanicAttack.php' (include_path='.:/usr/share/php') in /var/www/html/Lychee/public/php/index.php on line 21" while reading response header from upstream

But I've nothing changed, it's just a fresh install

@ildyria
Copy link
Member

ildyria commented Jun 27, 2020

Sorry to tell you that, but this is not us (Lychee), this is you.
Something is wrong with your Nginx configuration.

require_once(/var/www/html/Lychee/public/bootstrap/PanicAttack.php)
should be require_once(/var/www/html/Lychee/bootstrap/PanicAttack.php)

Basically, your configuration append a php inside your public path, which breaks all further includes etc.

The query to php/index.php is fine even if such file does not exist in your public folder. This is handled by lychee without troubles. What is messing it, is your rewrite rules not being properly set.

Please have a look at this: https://lycheeorg.github.io/docs/upgrade.html#using-nginx

PS: I am surprised that the /install worked if the ajax query does not.

@JustinGutsche
Copy link
Author

Sorry to tell you that, but this is not us (Lychee), this is you.
Something is wrong with your Nginx configuration.

require_once(/var/www/html/Lychee/public/bootstrap/PanicAttack.php)
should be require_once(/var/www/html/Lychee/bootstrap/PanicAttack.php)

Basically, your configuration append a php inside your public path, which breaks all further includes etc.

The query to php/index.php is fine even if such file does not exist in your public folder. This is handled by lychee without troubles. What is messing it, is your rewrite rules not being properly set.

Please have a look at this: https://lycheeorg.github.io/docs/upgrade.html#using-nginx

PS: I am surprised that the /install worked if the ajax query does not.

Found the error and resolved it.
But the next error isn't far away, after creating an admin user, I can upload pictures and do everything with the admin account, but if I create a normal user, I always get the same error. Developer Tools says : https://i.imgur.com/aybDnuW.png

If you want to test it: saaltofreak.de user & pass is test. App debug is on true.

@ildyria
Copy link
Member

ildyria commented Jun 28, 2020

But the next error isn't far away, after creating an admin user, I can upload pictures and do everything with the admin account, but if I create a normal user, I always get the same error. Developer Tools says : https://i.imgur.com/aybDnuW.png

Now that is something I'm "happy" to see. 👍 .

Can you scroll down in the list ? because I cannot see where this issue is coming from in the backtrace.

@JustinGutsche
Copy link
Author

But the next error isn't far away, after creating an admin user, I can upload pictures and do everything with the admin account, but if I create a normal user, I always get the same error. Developer Tools says : https://i.imgur.com/aybDnuW.png

Now that is something I'm "happy" to see. 👍 .

Can you scroll down in the list ? because I cannot see where this issue is coming from in the backtrace.

sure, I will link you the full backtrace as an pastebin would be too many screenshots ^^
https://pastebin.com/6FXbFuvG

@ildyria
Copy link
Member

ildyria commented Jun 28, 2020

Line 163 and further is where the stack starts to be interesting:

      {
            "file": "/var/www/html/Lychee/app/ModelFunctions/AlbumFunctions.php",
            "line": 312,
            "function": "get",
            "class": "Illuminate\\Database\\Eloquent\\Builder",
            "type": "->"
        },
        {
            "file": "/var/www/html/Lychee/app/ModelFunctions/AlbumsFunctions.php",
            "line": 230,
            "function": "customSort",
            "class": "App\\ModelFunctions\\AlbumFunctions",
            "type": "->"
        },
        {
            "file": "/var/www/html/Lychee/app/Http/Controllers/AlbumsController.php",
            "line": 64,
            "function": "getToplevelAlbums",
            "class": "App\\ModelFunctions\\AlbumsFunctions",
            "type": "->"
        },

@JustinGutsche
Copy link
Author

My files are the same as the git repository files, nothing changed in this files
How can I help you? ^^

@ildyria
Copy link
Member

ildyria commented Jun 28, 2020

I managed to reproduce. I'll try to get that fixed soon.

@JustinGutsche
Copy link
Author

Nice, thank you.

ildyria added a commit that referenced this issue Jun 28, 2020
@ildyria
Copy link
Member

ildyria commented Jun 28, 2020

Found. fixed in the next PR.

@ildyria ildyria changed the title Server error or API not found on fresh install [Regression] Error 500 on Albums::get() when using a user account. Jun 28, 2020
@ildyria ildyria added bug Something isn't working and removed More info required Issue which will be closed under 14 days if not replied by the author labels Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants