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.41k stars 301 forks source link

Initial setup not successful on shared webhoster: "Installation not complete" and "delete_imported / lang does not exist in config (local)" in logs #1946

Closed NikolausDemmel closed 1 year ago

NikolausDemmel commented 1 year ago

Detailed description of the problem [REQUIRED]

I'm trying to install Lychee for the first time on my webhost, ionos.de, but I'm encountering an internal server error.

In the logs I see such lines:

[2023-07-19 15:15:59] production.CRITICAL: App\Models\Configs::getValue:189 delete_imported does not exist in config (local) !
[2023-07-19 15:16:31] production.CRITICAL: App\Models\Configs::getValue:189 lang does not exist in config (local) !
[2023-07-19 15:16:31] production.DEBUG: App\Exceptions\ConfigurationKeyMissingException: lang does not exist in config! in /homepages/4/d821553753/htdocs/wedding/Lychee/app/Models/Configs.php:191
Stack trace:
[...]

and then at some point:

[2023-07-19 15:16:31] production.ERROR: App\Http\Middleware\InstallationStatus::handle:57 Installation not complete

The latest errors when trying to access the page in the web browser (which shows an internal server error) are:

[2023-07-19 15:24:01] production.CRITICAL: App\Models\Configs::getValue:189 delete_imported does not exist in config (local) !
[2023-07-19 15:24:01] production.ERROR: PDO::__construct:65 SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge'
App\Actions\Diagnostics\Pipes\Checks\AdminUserExistsCheck::handle:12 SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge'; caused by
Illuminate\Database\Connection::runQueryCallback:795 SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge' (Connection: mysql, SQL: select count(*) as aggregate from `users` where `may_administrate` = 1); caused by
App\Actions\Diagnostics\Pipes\Checks\AdminUserExistsCheck::handle:12 SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge' (Connection: mysql, SQL: select count(*) as aggregate from `users` where `may_administrate` = 1); caused by

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Clone repository (latest master branch): git clone https://github.com/LycheeOrg/Lychee.git
  2. cd Lychee
  3. Configure webserver to use PHP 8.2 and configure subdomain to resolve to the public folder
  4. Download composer: curl -sS https://getcomposer.org/installer | php8.2-cli
  5. Install dependencies: php8.2-cli composer.phar install --no-dev
  6. Edit main and database settings in .env:
    
    APP_NAME=Lychee
    APP_ENV=production
    APP_KEY=base64:dvMj1iSet6d2/9j1Q30Ff2cPvEtJK9whQEb5xSP+Af8=
    APP_DEBUG=true
    APP_URL=https://standesamt.nikolaus-demmel.de
    APP_FORCE_HTTPS=false

enable or disable debug bar. By default it is disabled.

Do note that this disable CSP!!

DEBUGBAR_ENABLED=false

enable or disable log viewer. By default it is enabled.

LOG_VIEWER_ENABLED=true

##############################################################################

IMPORTANT: To migrate from Lychee v3 you MUST use the same MySQL/MariaDB

server as v3.

##############################################################################

Table prefix (e.g. lychee_) of a Lychee v3 instance for migration

DB_OLD_LYCHEE_PREFIX=

DB_CONNECTION can be sqlite, mysql or pgsql. For sqlite the other entries are

not required, but an existing sqlite3 database may be specified if desired. In

this case, please use an absolute path. DB_DATABASE may be omitted but should

not be left blank.

DB_CONNECTION=mysql DB_HOST=db5013792226.hosting-data.io DB_PORT=3306

DB_DATABASE=

DB_USERNAME=dbu2964338 DB_PASSWORD=REDACTED DB_LOG_SQL=false DB_LOG_SQL_EXPLAIN=false #only for MySQL

List foreign keys in diagnostic page

DB_LIST_FOREIGN_KEYS=true


### Output of the diagnostics  [REQUIRED]
*(Settings => Diagnostics or https://example.com/Diagnostics or `php artisan lychee:diagnostics`)*

`https://example.com/Diagnostics` shows "Internal Server Error".

(uiserver):u100395024:~/wedding/Lychee$ php8.1-cli artisan lychee:diagnostics

In Connection.php line 795:

SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge' (Connection: mysql, SQL: select count(*) as aggregate from users where may_administrate = 1)

In Connector.php line 65:

SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge'


### Browser and system

Server: Shared webhosting at ionos.de

$ uname -a Linux infong-eu156 4.4.302-icpu-092 #2 SMP Wed Mar 22 08:55:29 UTC 2023 x86_64 GNU/Linux

d7415 commented 1 year ago

My first note is that

SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge'

does not match

DB_USERNAME=dbu2964338

You probably also want to set DB_DATABASE if you're using mysql.

NikolausDemmel commented 1 year ago

Thanks for the reply. Good point about DB_DATABASE, I missed setting that, since it was commented out initally.

I did set it now, and that part of the error message changed. In the log I now see some errors about the tables not existing in the database.

[2023-07-21 13:29:07] production.ERROR: PDO::prepare:416 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbs11543189.users' doesn't exist
App\Actions\Diagnostics\Pipes\Checks\AdminUserExistsCheck::handle:12 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbs11543189.users' doesn't exist; caused by
Illuminate\Database\Connection::runQueryCallback:795 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbs11543189.users' doesn't exist (Connection: mysql, SQL: select count(*) as aggregate from `users` where `may_administrate` = 1); caused by
App\Actions\Diagnostics\Pipes\Checks\AdminUserExistsCheck::handle:12 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbs11543189.users' doesn't exist (Connection: mysql, SQL: select count(*) as aggregate from `users` where `may_administrate` = 1); caused by

But I also still see the initial set of errors (which were there from the start, even when the database was still configured to sqlite):

[2023-07-21 13:28:59] production.ERROR: App\Http\Middleware\InstallationStatus::handle:57 Installation not complete

[2023-07-21 13:29:07] production.CRITICAL: App\Models\Configs::getValue:189 lang does not exist in config (local) !  
[2023-07-21 13:29:07] production.DEBUG: App\Exceptions\ConfigurationKeyMissingException: lang does not exist in config! in /homepages/4/d821553753/htdocs/wedding/Lychee/app/Models/Configs.php:191

[...]

[2023-07-21 13:29:07] production.CRITICAL: App\Models\Configs::getValue:189 delete_imported does not exist in config (local) !  

I'm woundering if that is the original issue that prevents / prevented the setup from completing.

d7415 commented 1 year ago

But I also still see the initial set of errors (which were there from the start, even when the database was still configured to sqlite):

That's a pretty unusual circumstance.

I'd suggest you clear the database and start over. Watch out for any log entries (particularly from the installer) about anything that goes wrong.

NikolausDemmel commented 1 year ago

What do you mean with clearing the database? Deleting all tables? Or resetting the config to the initial SQLite setting?

By „running the installer“ you mean the composer install command, right?

d7415 commented 1 year ago

What do you mean with clearing the database? Deleting all tables? Or resetting the config to the initial SQLite setting?

Deleting tables.

By „running the installer“ you mean the composer install command, right?

No, Lychee's installer. It will run when you first load Lychee if the database is empty

NikolausDemmel commented 1 year ago

Ok, thanks. The database was empty, there were no tables to delete.

I went to the URL in the Browser (I changed the subdomain compared to the initial config posted above) https://lychee.nikolaus-demmel.de/, which forwards me to https://lychee.nikolaus-demmel.de/install, but that gives the same 500 internal server error that I've seen from the start.

The database is still empty after this.

The log entries corresponding to that one opening of the installer page are:

[2023-07-22 11:20:24] production.CRITICAL: App\Models\Configs::getValue:189 lang does not exist in config (local) !  
[2023-07-22 11:20:24] production.DEBUG: App\Exceptions\ConfigurationKeyMissingException: lang does not exist in config! in /homepages/4/d821553753/htdocs/wedding/Lychee/app/Models/Configs.php:191
Stack trace:
#0 /homepages/4/d821553753/htdocs/wedding/Lychee/app/Models/Configs.php(208): App\Models\Configs::getValue()
#1 /homepages/4/d821553753/htdocs/wedding/Lychee/app/Providers/AppServiceProvider.php(99): App\Models\Configs::getValueAsString()
#2 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\AppServiceProvider->boot()
#3 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#5 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#6 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#7 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1006): Illuminate\Container\Container->call()
#8 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(987): Illuminate\Foundation\Application->bootProvider()
#9 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}()
#10 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(988): array_walk()
#11 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#12 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(261): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()
#13 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(186): Illuminate\Foundation\Application->bootstrapWith()
#14 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Foundation\Http\Kernel->bootstrap()
#15 /homepages/4/d821553753/htdocs/wedding/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#16 /homepages/4/d821553753/htdocs/wedding/Lychee/public/index.php(74): Illuminate\Foundation\Http\Kernel->handle()
#17 {main}  
[2023-07-22 11:20:24] production.ERROR: App\Http\Middleware\InstallationStatus::handle:57 Installation not complete

Running php8.1-cli artisan lychee:diagnostics still shows the Base table or view not found: 1146 Table 'dbs11543189.users' doesn't exist that I posted above from the logs.

Could it be related to my webhoster's configuration? I've configured the subdomain to use PHP 8.1 (initially I tried with PHP 8.2 with the same outcome). Composer wasn't installed, so I used the curl -sS https://getcomposer.org/installer | php8.2-cli command to download it. The php8.1-cli composer.phar install --no-dev command seemed to have run fine without errors, just some warnings about abandoned packages. If I now rerun it, the output is:

Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan optimize --clever --dont-confirm=assume-no

   INFO  Clearing cached bootstrap files.

  events .................................................................................................................................. 0ms DONE
  views ................................................................................................................................... 2ms DONE
  cache ................................................................................................................................... 0ms DONE
  route ................................................................................................................................... 0ms DONE
  config .................................................................................................................................. 0ms DONE
  compiled ................................................................................................................................ 1ms DONE

> @php artisan package:discover

   INFO  Discovering packages.

  bepsvpt/secure-headers ...................................................................................................................... DONE
  laragear/webauthn ........................................................................................................................... DONE
  lychee-org/nestedset ........................................................................................................................ DONE
  nesbot/carbon ............................................................................................................................... DONE
  nunomaduro/termwind ......................................................................................................................... DONE
  opcodesio/log-viewer ........................................................................................................................ DONE
  spatie/laravel-feed ......................................................................................................................... DONE
  spatie/laravel-image-optimizer .............................................................................................................. DONE

> @php scripts/install_files.php

creating file for CSS personalization

creating file for JS personalization

creating default SQLite database

setting up hooks for git pull and git commits

To disable the call of composer and migration on pull add
a file named '.NO_AUTO_COMPOSER_MIGRATE' in this directory.
70 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
> @php artisan key:generate --no-override
> @php artisan vendor:publish --tag=log-viewer-assets

   INFO  Publishing [log-viewer-assets] assets.

  Copying directory [vendor/opcodesio/log-viewer/public] to [public/vendor/log-viewer] ........................................................ DONE
d7415 commented 1 year ago

One other option would be to run: php artisan key:generate and php artisan migrate which (with the .env that you've already done) effectively bypasses the installer. If nothing else it may spit out different errors.

NikolausDemmel commented 1 year ago

Interesting, thanks for the tips. I ran the two commands, which did run seemingly without error, even if the log file still showed similar errors at the timestamp when the commands were run.

Now, it seems the database got populated. Opening the webpage still showed a 500, with this in the logs:

[2023-07-23 01:41:25] production.ERROR: App\Http\Middleware\AdminUserStatus::handle:57 Admin user not found

Diagnostics now runs and also showed:

Error: User Admin not found in database. Please run: "php lychee:create_user {username} {password}"

So I ran

php8.1-cli artisan lychee:create_user Admin REDACTED

which made this error disappear. However, opening the webpage https://lychee.nikolaus-demmel.de/ now shows "Error: error" with no log entry in storage/logs.

Diagnostics now shows (click me) ``` Diagnostics ----------- Warning: /homepages/4/d821553753/htdocs/wedding/Lychee/public/uploads/ has permissions 0705, but should have 2775 Warning: /homepages/4/d821553753/htdocs/wedding/Lychee/public/uploads/import has permissions 0705, but should have 2775 Warning: /homepages/4/d821553753/htdocs/wedding/Lychee/public/uploads/medium has permissions 0705, but should have 2775 Warning: /homepages/4/d821553753/htdocs/wedding/Lychee/public/uploads/medium2x has permissions 0705, but should have 2775 Warning: /homepages/4/d821553753/htdocs/wedding/Lychee/public/uploads/original has permissions 0705, but should have 2775 Warning: 6 more directories with wrong permissions 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: Pictures that are rotated lose their metadata! Please install Imagick to avoid that. Info: Latest version of PHP is 8.2 Foreign key: access_permissions.user_id → users.id : CASCADE Foreign key: albums.parent_id → albums.id : NO ACTION Foreign key: albums.id → base_albums.id : NO ACTION Foreign key: albums.cover_id → photos.id : CASCADE 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): master (66a20a3) -- 1 commits behind 2d899a1 (10 minutes ago) DB Version: 4.9.4 composer install: --no-dev APP_ENV: production APP_DEBUG: true System: Linux PHP Version: 8.1.20 PHP User agent: Lychee/4 (https://lycheeorg.github.io/) Timezone: Europe/Berlin Max uploaded file size: 64M Max post size: 64M Max execution time: 0 MySQL Version: 8.0.32 exec() Available: yes Imagick Available: - Imagick Enabled: 1 Imagick Version: - GD Version: 2.2.5 Number of foreign key: 11 found. Config Information ------------------ version: 040904 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 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 v4 footer_show_copyright: 1 site_copyright_begin: 2019 site_copyright_end: 2019 footer_additional_text: footer_show_social_media: 0 public_search: 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: 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 nsfw_banner_override: map_display_direction: 1 album_subtitle_type: oldstyle upload_processing_limit: 4 public_photos_hidden: 1 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 ```
d7415 commented 1 year ago

So I ran

:+1:

"Error: error" with no log entry in storage/logs.

Unfortunately my next step there would generally be to see if the httpd or php are reporting anything, which is probably above your access level.

NikolausDemmel commented 1 year ago

I see these server (apache?) logs from accessing the main page now:

185.23.145.0 - - [23/Jul/2023:02:12:21 +0200] "GET / HTTP/1.1" 200 71515 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
185.23.145.0 - - [23/Jul/2023:02:12:21 +0200] "GET /dist/frontend.css HTTP/1.1" 200 91255 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
185.23.145.0 - - [23/Jul/2023:02:12:21 +0200] "GET /dist/user.css?1690018324 HTTP/1.1" 200 - lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
185.23.145.0 - - [23/Jul/2023:02:12:21 +0200] "GET /dist/custom.js?1690018324 HTTP/1.1" 200 - lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
185.23.145.0 - - [23/Jul/2023:02:12:21 +0200] "GET /dist/frontend.js HTTP/1.1" 200 1030755 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
185.23.145.0 - - [23/Jul/2023:02:12:22 +0200] "POST /api/Session::init HTTP/1.1" 500 645 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"

Is the error 500 on api/Session::init a useful hint?

NikolausDemmel commented 1 year ago

It seems to me that from the shell everything is fine, but in the browser, nothing works. I don't know much about php, but could it be that the webserver doesn't find the libraries installed by composer? Maybe there is some php.ini or htaccess config that needs to be set...

ildyria commented 1 year ago

Can you edit your .env and set APP_DEBUG to true ? this will give way better debugging info in the error.

ildyria commented 1 year ago

also this one is failing for some reason: https://lychee.nikolaus-demmel.de/phpinfo instead of giving you this kind of error: https://photography.viguier.nl/phpinfo

NikolausDemmel commented 1 year ago

Can you edit your .env and set APP_DEBUG to true ? this will give way better debugging info in the error.

It is already set to true. Still no logs in storage/logs when accessing via browser now.

also this one is failing for some reason: https://lychee.nikolaus-demmel.de/phpinfo

Yeah, also internal server error 500. Let me check the access logs from the webhoster (takes a few minutes to update).

instead of giving you this kind of error: https://photography.viguier.nl/phpinfo

You mean a 403 access denied? (That's what I get).

ildyria commented 1 year ago

It is already set to true. Still no logs in storage/logs when accessing via browser now.

No this should not impacts on the logs, debug should give you nice errror messages on crashes like 500 instead of a white page. This leads me to believe that there is something wrong with your webhoster. It is also possible that your .env is cached and ignored.

Can you try to run these 3.

php artisan cache:clear
php artisan config:cache
php artisan route:cache
ildyria commented 1 year ago

You mean a 403 access denied? (That's what I get).

yes.

NikolausDemmel commented 1 year ago

Can you try to run these 3.

They ran successfully, but no change in behaviour.

This leads me to believe that there is something wrong with your webhoster.

Yeah, I also have the feeling that the way PHP is run from the webserver is not right. I'm not sure what else I can configure there. There is a config for selecting the PHP version, which I've set to 8.1, but I haven't seen any other PHP-related global settings...

ildyria commented 1 year ago

can you create a php file:

<?php

phpinfo();

and try to access it from your server ? You should get some data on what is actually going on with your php version.

NikolausDemmel commented 1 year ago

I've created a phpinfo.php in the public folder with content

<?php phpinfo(); ?>

Not sure if that helps: https://lychee.nikolaus-demmel.de/phpinfo.php

NikolausDemmel commented 1 year ago

Haha, some thought at the same time 🙈

ildyria commented 1 year ago

Can you check the right access on the storage folder and sub folders ? they should be writable.

NikolausDemmel commented 1 year ago
(uiserver):u100395024:~/wedding/Lychee/public$ ls -la storage
lrwxrwxrwx 1 u100395024 ftpusers 21 Jul 19 15:15 storage -> ../storage/app/public
(uiserver):u100395024:~/wedding/Lychee/public$ ls -la ../storage/app/public
total 4
drwx---r-x 2 u100395024 ftpusers 23 Jul 19 15:15 .
drwx---r-x 3 u100395024 ftpusers 36 Jul 19 15:15 ..
-rw----r-- 1 u100395024 ftpusers 14 Jul 19 15:15 .gitignore
(uiserver):u100395024:~/wedding/Lychee/public$ ls -la ../storage/
total 8
drwx---r-x  7 u100395024 ftpusers   74 Jul 19 15:15 .
drwx---r-x 18 u100395024 ftpusers 4096 Jul 23 20:15 ..
drwx---r-x  3 u100395024 ftpusers   36 Jul 19 15:15 app
drwx---r-x  3 u100395024 ftpusers   18 Jul 19 15:15 bootstrap
drwx---r-x  2 u100395024 ftpusers   23 Jul 19 15:15 debugbar
drwx---r-x  6 u100395024 ftpusers   76 Jul 19 15:15 framework
drwx---r-x  2 u100395024 ftpusers 4096 Jul 23 01:37 logs

It's writable for user. I'm not sure how the webhoster manages permissions w.r.t. the apache process.

ildyria commented 1 year ago

Okay, so I am pretty convinced that your .env is ignored. I guess the only way forward for you is to actually edit the config files. You will mostly need to have a look at those two for now: https://github.com/LycheeOrg/Lychee/blob/master/config/app.php https://github.com/LycheeOrg/Lychee/blob/master/config/database.php

For example you can force debug mode in app.php and that will give us a bit more visibility on the error 500 hopefully.

NikolausDemmel commented 1 year ago

Hm... I'm not sure... The behaviour changed when changing the .env file.

I now set 'debug' => (bool) env('APP_DEBUG', true) in app.php, but opening the page still looks the same. No entries in Lychee's logs. The server access logs still show:

2a02:3033:400:: - - [27/Jul/2023:14:31:16 +0200] "GET /index.php HTTP/1.1" 200 71525 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"
2a02:3033:400:: - - [27/Jul/2023:14:31:17 +0200] "POST /api/Session::init HTTP/1.1" 500 645 lychee.nikolaus-demmel.de "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "-"

https://lychee.nikolaus-demmel.de/Diagnostics also just shows an error 500.

ildyria commented 1 year ago

@NikolausDemmel sorry for going back at you so late. Honestly at that point, I don't know what to advise you. Clearly there is a php configuration problem, but I don't know what it is. :(

cwchristoffersen commented 1 year ago

I have similar if not exactly the same issue. My environment is completely new and from scratch:

  1. Oracle Linux 8.8 running SELinux
  2. Apache httpd server 2.4
  3. PHP 8.2.9
  4. MariaDB 10.3.35
  5. Lychee v4.11.0

I have done all the semanage configurations needed so there's no errors/blockages in that area. I'm convinced the install problem is related to this error: ==> errors.log <== CRITICAL: App\Models\Configs::getValue:189 lang does not exist in config (local) !

and then it simply end up with: ERROR: App\Http\Middleware\InstallationStatus::handle:57 Installation not complete Can you give some advice on how to get rid of the lang error? @ildyria, you have been fantastic with some good advice in some of the other issues I have read :-) FYI. I also tried with sqlite, but no difference.

ildyria commented 1 year ago

CRITICAL: App\Models\Configs::getValue:189 lang does not exist in config (local) !

If the DB does not exists, this error will always be here. This is not a problem because we have a mechanism to handle that specific case. See here: https://github.com/LycheeOrg/Lychee/blob/master/app/Providers/AppServiceProvider.php#L99

My intuition is more in that maybe the .env file is not being able to be loaded. There are similar problems on 000webhost : https://www.000webhost.com/forum/t/deploy-laravel-project-on-000webhost/127323 maybe SeLinux prevents php env variables to be modified? :shrug:

NikolausDemmel commented 1 year ago

@NikolausDemmel sorry for going back at you so late. Honestly at that point, I don't know what to advise you. Clearly there is a php configuration problem, but I don't know what it is. :(

Thanks. Regardless, I really appreciate the support and suggestions!

In the meantime I have moved on to a different project, so I'll close this issue.