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

install errors #1323

Closed sunosv closed 2 years ago

sunosv commented 2 years ago

Steps to reproduce the issue Steps to reproduce the behavior:

download zip Run composer install --no-dev to install dependencies Copy .env.example as .env and edit it to match your parameters Generate your secret key with php artisan key:generate Go to web http://server/Lychee/public/install First screen shows Lychee-installer -> click on Next button Second screen shows error: "Please fix the errors before going to the next step." But all the checks are 'green' Clicking Re-check button does not help

Diagnostics

php artisan lychee:diagnostics

In Connection.php line 712:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lychee.users' do esn't exist (SQL: select * from users where users.id = 0 limit 1)

In Connection.php line 368:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lychee.users' do esn't exist

System Information Lychee Version (git): master Default

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

System: win PHP Version: 8.1

Browser and system Server: Fedora 35/Apache Client: Windows 10 Browser: any

QQ截图20220514001949.png Where did I go wrong?

I tried to php artisan migrate then I could not open the page QQ截图20220514015700.png

and nginx REWRITE :

if (!-e $request_filename)
{
    rewrite ^/(.*)$ /index.php?/$1 last;
    break;
}

QQ截图20220514020406.png

Diagnostics

Warning: 'D:\phpEnv\www\Lychee\public\dist\user.css' does not exist or has insufficient read/write privileges. Warning: Dropbox import not working. dropbox_key is empty. Warning: zend.assertions is enabled although Lychee is not in debug mode. Outside of debugging, code generation for assertions is recommended to be disabled for efficiency reasons

System Information

Lychee Version (release): 4.5.1 DB Version: 4.5.1

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

System: WINNT PHP Version: 8.1 PHP User agent: Lychee/4 (https://lycheeorg.github.io/) Timezone: Asia/Shanghai Max uploaded file size: 200M Max post size: 256M Max execution time: 0 MySQL Version: 5.7.28

Imagick: 1 Imagick Active: 1 Imagick Version: 1808 GD Version: bundled (2.1.0 compatible)

Config Information

version: 040501 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 layout: 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 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 map_display_direction: 1 album_subtitle_type: oldstyle upload_processing_limit: 4 public_photos_hidden: 1 new_photos_notification: 0 legacy_id_redirection: 1

kamil4 commented 2 years ago

Note: you did not follow the bug reporting template. However, see if the solution from #1304 works for you.

sunosv commented 2 years ago

Note: you did not follow the bug reporting template. However, see if the solution from #1304 works for you.

sorry about that ,but there is no file .NO_SECURE_KEY ,and the APP_KEY=base64:5gu6ZvC+ObsmUZfvBYuhZKrwIMyXZwHwsNi1Lnb2gIU= was set

sunosv commented 2 years ago

Help me, Please

sunosv commented 2 years ago

Note: you did not follow the bug reporting template. However, see if the solution from #1304 works for you.

didn't work for me

kamil4 commented 2 years ago

Thank you for providing the missing information! Unfortunately, it's too late for me to look into it today, but just to make sure that I understand:

Are you downloading a zip file of the current git master and installing that?

Are you installing from scratch or updating? You had a Lychee installation in the past if I remember correctly?

And this is an installation on a Windows server? That's an environment that none of us developers uses so it may prove tricky to reproduce.

Have you tried not using the web installer? It's use isn't really mandatory...

sunosv commented 2 years ago

@kamil4 Yes, It's the current git master.and I'm installing it from scratch. It is true that I have installed it before, and I have also submitted some problems, and you are very enthusiastic to help solve them.I remember the first part of the big refactoring. There is a master branch that was installable. I've been waiting for a full refactor and then trying to install the latest. But now I have this problem, even though I am using win server it was working fine before

sunosv commented 2 years ago

Thank you for providing the missing information! Unfortunately, it's too late for me to look into it today, but just to make sure that I understand:

Are you downloading a zip file of the current git master and installing that?

Are you installing from scratch or updating? You had a Lychee installation in the past if I remember correctly?

And this is an installation on a Windows server? That's an environment that none of us developers uses so it may prove tricky to reproduce.

Have you tried not using the web installer? It's use isn't really mandatory...

I have tried not using the web, like: Run composer install --no-dev to install dependencies Copy .env.example as .env and edit it to match your parameters Generate your secret key with php artisan key:generate php artisan migrate

But As described above, can't open lychee

qwerty287 commented 2 years ago

If you run the commands to install (composer install --no-dev...), are there any errors? Especially if you run the composer or the php artisan migratecommand? Is there any error, warning or something like this in the output of the command?

sunosv commented 2 years ago

If you run the commands to install (composer install --no-dev...), are there any errors? Especially if you run the composer or the php artisan migratecommand? Is there any error, warning or something like this in the output of the command?

php artisan migrate no warning or error, omposer install --no-dev did has some error. But in the previous version, although there are errors, it doesn't matter much, and lychee can run normally, probably because win does not support sh scripts

sunosv commented 2 years ago

If you run the commands to install (composer install --no-dev...), are there any errors? Especially if you run the composer or the php artisan migratecommand? Is there any error, warning or something like this in the output of the command?

QQ截图20220514141953.png QQ截图20220514143519.png could you see the pic?

qwerty287 commented 2 years ago

Thanks! That should be pretty helpful! The issue is that https://github.com/LycheeOrg/Lychee/blob/master/composer.json#L88-L90 is not compatible with windows. My idea to solve this for you (not a real fix):

  1. Remove the lines mentioned above from composer.json (also remove the comma in line 87) and remove line 86 and the comma in line 85
  2. Rerun composer install --no-dev
  3. Run the steps of the problematic file manually:
    touch public/dist/user.css
    touch database/database.sqlite
  4. Follow the other steps of the installation
nagmat84 commented 2 years ago

My idea on solving this: can we replace the *.sh scripts by PHP scripts? For obvious reasons PHP scripts should be able to be interpreted by every host environment, even Windows. This might affect more than only this sh file, but all sh files which a normal ueer may bump into.

I haven't checked if there are even any other scripts, so it might as well as be that this is rhe only one. "Touching" two files is trivial in PHP, that's nothing which requires sh.

I don't care for scripts which are only used by developers , because I believe it is fair to assume that every developer is using Linux.

sunosv commented 2 years ago

Thanks! That should be pretty helpful! The issue is that https://github.com/LycheeOrg/Lychee/blob/master/composer.json#L88-L90 is not compatible with windows. My idea to solve this for you (not a real fix):

  1. Remove the lines mentioned above from composer.json (also remove the comma in line 87) and remove line 86 and the comma in line 85
  2. Rerun composer install --no-dev
  3. Run the steps of the problematic file manually:
touch public/dist/user.css
touch database/database.sqlite
  1. Follow the other steps of the installation

still not working,Rerun composer install --no-dev no waring and error

this is php artisan migrate result lychee_3.png lycjee_1.png lychee_2.png

Still can't open the page of Lychee

sunosv commented 2 years ago

markdown-support

I tried this branch , web installer is ok, So What went wrong with the current master

nagmat84 commented 2 years ago

I don't have a Windows system (at least no usable not to speak of the missing web server). But if the bug has been introduced by the current master, it is highly likely that I am responsible for it. :cry: Let me see, if I can reproduce the problem on Linux, but first I must read our own user guidance to find out what I am supposed to do :grinning:

sunosv commented 2 years ago

I don't have a Windows system (at least no usable not to speak of the missing web server). But if the bug has been introduced by the current master, it is highly likely that I am responsible for it. 😢 Let me see, if I can reproduce the problem on Linux, but first I must read our own user guidance to find out what I am supposed to do 😀

Thank you, That would be great.😁

nagmat84 commented 2 years ago

Do I assume correctly that your took the most recent ZIP archive from https://github.com/LycheeOrg/Lychee/releases ? I am just asking, because some posts earlier you asked what went wrong with current master. The ZIP archive is not current master. This is fine for me, but I want to ensure that I am actually looking at the same version as you. I would like to avoid potentially spending hours on hunting a bug and then just realized that I haven looking at the wrong version.

nagmat84 commented 2 years ago

Ah, and did you download the full sources or only the stripped down version, i.e.

? As you see, I am looking at our own download page for the first time of my life :grinning:

sunosv commented 2 years ago

Ah, and did you download the full sources or only the stripped down version, i.e.

? As you see, I am looking at our own download page for the first time of my life 😀

I downloaded from here.I don't know if I am right or wrong

this link https://github.com/LycheeOrg/Lychee/archive/refs/heads/master.zip QQ截图20220514190200.png

nagmat84 commented 2 years ago

I can reproduce the error on Linux, too. I have not yet started to trace the bug, but it is there. I get the same error page.

nagmat84 commented 2 years ago

OK, I guess I have found the problem. My step debugger guided me through the requirements checker and the blade template which unveiled the problem.

I introduced the bug in my attempt to make Lychee more type safe. There is a variable errors which initially is a boolean, inside the requirements checker it is (silently) converted into an integer - using digits 0 and 1 - and the final blade template tests for unset($errors). :cursing_face:

The more underlying problem is that all the requirement tests and results are transferred in an associative error which is inherently not type-safe. Most of this stuff has already been replaced by a so-called DTO (data transfer object) during my re-factoring but I tried to avoid the web installer as far as possible. Obviously, it was not far enough.

I will only post a quick patch for it. Improving the installer from ground up is on my long term to-do list.

sunosv commented 2 years ago

OK, I guess I have found the problem. My step debugger guided me through the requirements checker and the blade template which unveiled the problem.

I introduced the bug in my attempt to make Lychee more type safe. There is a variable errors which initially is a boolean, inside the requirements checker it is (silently) converted into an integer - using digits 0 and 1 - and the final blade template tests for unset($errors). 🤬

The more underlying problem is that all the requirement tests and results are transferred in an associative error which is inherently not type-safe. Most of this stuff has already been replaced by a so-called DTO (data transfer object) during my re-factoring but I tried to avoid the web installer as far as possible. Obviously, it was not far enough.

I will only post a quick patch for it. Improving the installer from ground up is on my long term to-do list.

👍Good job, Thanks When can I get this fixed version 😊

nagmat84 commented 2 years ago

We follow a four-eyes principle for our PRs on master. As soon as some of my fellow developers has revised the code, it will be merged. In this case don't expect the review to take a long time, because it is only a couple of lines with wrong comparison operators which needed to be changed. So I guess it is going to happen during the weekend.

If you are in a real hurry, you can try to fix it on your local copy using a text editor. Just change the lines as in the diff report of the PR. It is not difficult to do.

sunosv commented 2 years ago

We follow a four-eyes principle for our PRs on master. As soon as some of my fellow developers has revised the code, it will be merged. In this case don't expect the review to take a long time, because it is only a couple of lines with wrong comparison operators which needed to be changed. So I guess it is going to happen during the weekend.

If you are in a real hurry, you can try to fix it on your local copy using a text editor. Just change the lines as in the diff report of the PR. It is not difficult to do.

Thanks again 😁