mirror of
https://github.com/plankanban/planka.git
synced 2026-02-24 19:08:59 +03:00
[Bug]: Not able to log in after installation #645
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MikaelKW on GitHub (Feb 3, 2025).
Where is the problem occurring?
I encountered the problem while using the application (Frontend)
What browsers are you seeing the problem on?
Firefox, Chrome, Brave
Current behaviour
After installation (following this guide: https://docs.planka.cloud/docs/installation/manual_installation/debian_ubuntu) of Planka on a Ubuntu Server VM, i'm not able to login using the default admin username, og default admin password that i have provided in the .env file. I get the following error message: Invalid credentials
Desired behaviour
To be able to login with the credentials that i've provided in the .env file
DEFAULT_ADMIN_EMAIL
DEFAULT_ADMIN_PASSWORD
DEFAULT_ADMIN_NAME
DEFAULT_ADMIN_USERNAME
Steps to reproduce
Other information
I consider myself pretty good with Windows, but i don't have that confidence when it comes to Linux. Please be patient with me if there's some things i don't understand. 😅
@MikaelKW commented on GitHub (Feb 3, 2025):
Here's the .env file with credentials removed , and hastags removed (side question, can i still add hashtags to comments on github without them looking like this?: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)
Required
BASE_URL=http://192.168.150.9:1337
DATABASE_URL=postgresql://planka:[custom]@localhost/planka
SECRET_KEY=[custom]
Optional
LOG_FILE=
TRUST_PROXY=0
TOKEN_EXPIRES_IN=365 # In days
related: https://github.com/knex/knex/issues/2354
As knex does not pass query parameters from the connection string we
have to use environment variables in order to pass the desired values, e.g.
PGSSLMODE=
Configure knex to accept SSL certificates
KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
DEFAULT_ADMIN_EMAIL=[custom] # Do not remove if you want to prevent this user from being edited/deleted
DEFAULT_ADMIN_PASSWORD=[custom]
DEFAULT_ADMIN_NAME=[custom]
DEFAULT_ADMIN_USERNAME=[custom]
SHOW_DETAILED_AUTH_ERRORS=false # Set to true to show more detailed authentication error messages. It should not be enabled without a rate limiter for security reasons.
ALLOW_ALL_TO_CREATE_PROJECTS=true
S3_ENDPOINT=
S3_REGION=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET=
S3_FORCE_PATH_STYLE=true
OIDC_ISSUER=
OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
OIDC_ID_TOKEN_SIGNED_RESPONSE_ALG=
OIDC_USERINFO_SIGNED_RESPONSE_ALG=
OIDC_SCOPES=openid email profile
@meltyshev commented on GitHub (Feb 4, 2025):
Hi! Is there any output in the console when you try to run
npm run db:init?You can also check if the user was created by running
psql [DATABASE_URL] -c 'SELECT * FROM user_account;'.This will help us determine whether the issue is with account creation or the login process.
I usually wrap everything related to code or variables in a code block: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks.
@MikaelKW commented on GitHub (Feb 4, 2025):
When i run "npm run db:init && npm start --prod" i get the following output:
And when i run "npm run db:init", i only get the following:
I've tried running the Postgre command but only getting this output:
Probably something that i've not done correct
@meltyshev commented on GitHub (Feb 4, 2025):
Ah, please try putting the
[DATABASE_URL]in quotes like this:psql "[DATABASE_URL]" -c "SELECT * FROM user_account;".@MikaelKW commented on GitHub (Feb 5, 2025):
Hmm... Seems like i still get the same output:
@meltyshev commented on GitHub (Feb 5, 2025):
My bad, it should be in single quotes 🙈
Btw, the second variant is correct, no
[]needed.@MikaelKW commented on GitHub (Feb 5, 2025):
Got it!
@meltyshev commented on GitHub (Feb 5, 2025):
It seems that, for some reason, Planka isn't recognizing your environment variables. It's difficult to say exactly what the problem might be, but here are a few things to check:
.env. Try runningcat .envto confirm that it outputs the expected content.DEFAULT_ADMIN_*variables may still be commented out. Make sure they do NOT have a#at the beginning of each line.If everything appears correct, you can try creating an initial user by specifying these variables before running the init command:
@MikaelKW commented on GitHub (Feb 5, 2025):
Would this be the correct config for .env?:
@meltyshev commented on GitHub (Feb 5, 2025):
Yep, but it's better to remove the spaces before
DEFAULT_ADMIN_*variables, though it shouldn't affect anything.@MikaelKW commented on GitHub (Feb 5, 2025):
Thanks for your help so far. I'll test this later today or tomorrow. 😃
@baur commented on GitHub (Mar 17, 2025):
Same porblem, user_account is empty
Winidows manual
Planka: v1.25.1
Node: v22.12.0
DB: PostgreSQL 16.1, compiled by Visual C++ build 1937, 64-bit
DB located in another IP, running in local via http://localhost:1337
@baur commented on GitHub (Mar 18, 2025):
maybe related with this?
direct run cmd:
@meltyshev commented on GitHub (Mar 18, 2025):
Hi @baur!
First of all, I noticed that your
.envfile hasDEFAULT_ADMIN_EMAILcommented out. It should be uncommented and set to the admin account's email address.Next, you need to initialize the database:
After that, you can remove the password from the
.envfile and comment out otherDEFAULT_ADMIN_*variables if needed.I also recommend using this script to start Planka, simply create a
start.shfile with the following content:This ensures the database is properly initialized and migrated before starting the application. Additionally, it removes the debug message you screenshotted.
@baur commented on GitHub (Mar 20, 2025):
@meltyshev
Yes, this helped me. The login page allowed login via either username or email, but in my case, SMTP was not configured, so I had omitted it.
thank you!