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

Error 500 - personal_access_tokens table remains empty #105

Open
Extarys opened this issue Oct 25, 2021 · 5 comments
Open

Error 500 - personal_access_tokens table remains empty #105

Extarys opened this issue Oct 25, 2021 · 5 comments

Comments

@Extarys
Copy link

Extarys commented Oct 25, 2021

After installation I ssh inside the container and ran php artisan koel:init --no-assets which created a bunch of tables inside the database. I can see the default admin user inside the users table, personal_access_tokens table is empty.

When I try to log in I get error 500 and this is the log:

[2021-10-25 21:53:22] production.ERROR: SQLSTATE[08006] [7] FATAL:  password authentication failed for user "koel" (SQL: select * from "personal_
access_tokens" where "token" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1) {"exception":"[object] (Illuminate\\Data
base\\QueryException(code: 7): SQLSTATE[08006] [7] FATAL:  password authentication failed for user \"koel\" (SQL: select * from \"personal_access
_tokens\" where \"token\" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1) at /var/www/html/vendor/laravel/framework/s
rc/Illuminate/Database/Connection.php:692)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(652): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(360): Illuminate\\Database\\Connection->run()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2350): Illuminate\\Database\\Connection->select()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2338): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2872): Illuminate\\Database\\Query\\Builder->Illuminate\\Data
base\\Query\\{closure}()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2339): Illuminate\\Database\\Query\\Builder->onceWithColumns(
)
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(602): Illuminate\\Database\\Query\\Builder->get()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(586): Illuminate\\Database\\Eloquent\\Builder->getModels()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(259): Illuminate\\Database\\Eloquent\\Builder->get()

It looks like it cannot create the token or something - although the error is different maybe it is related somehow to #54 ?
Since artisan was able to create the tables I doubt it's a read/write permission issue, but to be safe I make the koel user a superuser.

I'm using Postgresql on a Pi 4. This pulled the latest docker version - not sure which one. If you need more info please ask.

@Hyzual
Copy link
Collaborator

Hyzual commented Dec 30, 2021

Hi, sorry for the delay, I haven't tried reproducing since I use MySQL. Does it still occur on the latest version ?

@Extarys
Copy link
Author

Extarys commented Jan 9, 2022

Hi! No worries I also didn't have the patience or the time to test 😄
I restarted from the beginning. I uses DB_* environment variable in my docker compose. It does seem to create some tables, or is it when I run the initial artisan command, I'm not sure but still.

When I run php artisan koel:init --no-assets:

From koel docker I get:

Migrating database
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
😥 Sorry for this. You deserve better.

From postgres I get:

	Connection matched pg_hba.conf line 99: "host all all all md5"
2022-01-09 20:14:18.078 UTC [90] ERROR:  cannot drop index artists_name_unique because constraint artists_name_unique on table artists requires it
2022-01-09 20:14:18.078 UTC [90] HINT:  You can drop constraint artists_name_unique on table artists instead.
2022-01-09 20:14:18.078 UTC [90] STATEMENT:  drop index "artists_name_unique"
2022-01-09 20:14:18.080 UTC [90] ERROR:  current transaction is aborted, commands ignored until end of transaction block
2022-01-09 20:14:18.080 UTC [90] STATEMENT:  DEALLOCATE pdo_stmt_00000058

Maybe my previous mistake was that I tried to connect without seeing that error above, therefore login attemps might return code 500.

Between every try, I do:

DROP DATABASE koel;
CREATE DATABASE koel;
GRANT CONNECT ON DATABASE koel TO koel;

As for the settings, I use host postgres with port 5432 user and db koel and it's password.

Koel image:
ID: ba74268b845d64bdc0acee5e8955dceaeffb6eddf824f7012f9cf400958dc6cd
Date: 2021-12-30 23:04:16
Arch: arm64

I use Postgres version 12. Everything is managed inside Portainer.

@Extarys
Copy link
Author

Extarys commented Jan 9, 2022

Might be the same issue as koel/koel#1401

@DySprozin
Copy link

just

docker exec -it koel_koel_1 bash
chown -R www-data:www-data
exit

and

docker exec --user www-data -it koel_koel_1 bash
php artisan koel:init --no-assets

@Archpanda
Copy link

docker exec -it koel_koel_1 bash
chown -R www-data:www-data
exit

Isn't there a missing argument for the 'chown' call ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants