Closed NikolausDemmel closed 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.
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.
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.
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?
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
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
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.
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
.
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.
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?
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...
Can you edit your .env
and set APP_DEBUG to true ? this will give way better debugging info in the error.
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
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).
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
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...
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.
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
Haha, some thought at the same time 🙈
Can you check the right access on the storage folder and sub folders ? they should be writable.
(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.
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.
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.
@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. :(
I have similar if not exactly the same issue. My environment is completely new and from scratch:
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.
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 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.
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:
and then at some point:
The latest errors when trying to access the page in the web browser (which shows an internal server error) are:
Steps to reproduce the issue
Steps to reproduce the behavior:
master
branch):git clone https://github.com/LycheeOrg/Lychee.git
cd Lychee
public
foldercurl -sS https://getcomposer.org/installer | php8.2-cli
php8.2-cli composer.phar install --no-dev
.env
: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
(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
wheremay_administrate
= 1)In Connector.php line 65:
SQLSTATE[HY000] [1044] Access denied for user 'o11543189'@'%' to database 'forge'
$ uname -a Linux infong-eu156 4.4.302-icpu-092 #2 SMP Wed Mar 22 08:55:29 UTC 2023 x86_64 GNU/Linux