[Bug]: Not able to log in after installation #645

Closed
opened 2026-02-04 20:40:36 +03:00 by OVERLORD · 15 comments
Owner

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

  1. Install Ubuntu Server 24.04.
  2. Follow this guide: https://docs.planka.cloud/docs/installation/manual_installation/debian_ubuntu, but change DEFAULT_ADMIN_EMAIL, DEFAULT_ADMIN_PASSWORD, DEFAULT_ADMIN_NAME and DEFAULT_ADMIN_USERNAME to something else then demo
  3. Try to login on the web interface

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. 😅

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 1. Install Ubuntu Server 24.04. 2. Follow this guide: https://docs.planka.cloud/docs/installation/manual_installation/debian_ubuntu, but change DEFAULT_ADMIN_EMAIL, DEFAULT_ADMIN_PASSWORD, DEFAULT_ADMIN_NAME and DEFAULT_ADMIN_USERNAME to something else then demo 3. Try to login on the web interface ### 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. :sweat_smile:
Author
Owner

@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

@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=<value> 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
Author
Owner

@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.

Side question, can i still add hashtags to comments on github without them looking like this?

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.

@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. > Side question, can i still add hashtags to comments on github without them looking like this? 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.
Author
Owner

@MikaelKW 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.

Side question, can i still add hashtags to comments on github without them looking like this?

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.

When i run "npm run db:init && npm start --prod" i get the following output:

> db:init
> node db/init.js

> start
> nodemon

[nodemon] 3.1.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node app.js`

And when i run "npm run db:init", i only get the following:

> db:init
> node db/init.js

I've tried running the Postgre command but only getting this output:

-bash: !@localhost/planka: event not found

Probably something that i've not done correct

@MikaelKW 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. > > > Side question, can i still add hashtags to comments on github without them looking like this? > > 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. When i run "npm run db:init && npm start --prod" i get the following output: ``` > db:init > node db/init.js > start > nodemon [nodemon] 3.1.7 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting `node app.js` ``` And when i run "npm run db:init", i only get the following: ``` > db:init > node db/init.js ``` I've tried running the Postgre command but only getting this output: ``` -bash: !@localhost/planka: event not found ``` Probably something that i've not done correct
Author
Owner

@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;".

@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;"`.
Author
Owner

@MikaelKW commented on GitHub (Feb 5, 2025):

Hmm... Seems like i still get the same output:

Image

Image

@MikaelKW commented on GitHub (Feb 5, 2025): Hmm... Seems like i still get the same output: ![Image](https://github.com/user-attachments/assets/1881fa0d-bf17-492d-9f9a-089c815246c1) ![Image](https://github.com/user-attachments/assets/56039c8e-4bfd-4fe8-badf-7971d6bb84d4)
Author
Owner

@meltyshev commented on GitHub (Feb 5, 2025):

My bad, it should be in single quotes 🙈

psql '[DATABASE_URL]' -c 'SELECT * FROM user_account;'

Btw, the second variant is correct, no [] needed.

@meltyshev commented on GitHub (Feb 5, 2025): My bad, it should be in single quotes 🙈 ``` psql '[DATABASE_URL]' -c 'SELECT * FROM user_account;' ``` Btw, the second variant is correct, no `[]` needed.
Author
Owner

@MikaelKW commented on GitHub (Feb 5, 2025):

Got it!

Image

@MikaelKW commented on GitHub (Feb 5, 2025): Got it! ![Image](https://github.com/user-attachments/assets/9320091c-51e6-46dc-97ff-8400f5f3f7fa)
Author
Owner

@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:

  • Ensure the environment variable file is named exactly .env. Try running cat .env to confirm that it outputs the expected content.
  • The 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:

DEFAULT_ADMIN_EMAIL='demo@demo.demo' DEFAULT_ADMIN_PASSWORD='demo' DEFAULT_ADMIN_NAME='Demo Demo' DEFAULT_ADMIN_USERNAME='demo' npm run db:init
@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: - Ensure the environment variable file is named exactly `.env`. Try running `cat .env` to confirm that it outputs the expected content. - The `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: ``` DEFAULT_ADMIN_EMAIL='demo@demo.demo' DEFAULT_ADMIN_PASSWORD='demo' DEFAULT_ADMIN_NAME='Demo Demo' DEFAULT_ADMIN_USERNAME='demo' npm run db:init ```
Author
Owner

@MikaelKW commented on GitHub (Feb 5, 2025):

Would this be the correct config for .env?:

## 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=<value>

# 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
@MikaelKW commented on GitHub (Feb 5, 2025): Would this be the correct config for .env?: ``` ## 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=<value> # 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 ```
Author
Owner

@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.

...
# 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
...
@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. ``` ... # 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 ... ```
Author
Owner

@MikaelKW commented on GitHub (Feb 5, 2025):

Thanks for your help so far. I'll test this later today or tomorrow. 😃

@MikaelKW commented on GitHub (Feb 5, 2025): Thanks for your help so far. I'll test this later today or tomorrow. :smiley:
Author
Owner

@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

BASE_URL=http://localhost:1337
DATABASE_URL=postgresql://postgres:[secret]@[IP]/planka
SECRET_KEY=[secret]
...
PGSSLMODE=disable
...
# DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
DEFAULT_ADMIN_PASSWORD=[secret]
DEFAULT_ADMIN_NAME=Baur
DEFAULT_ADMIN_USERNAME=Baur
...
@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 ```env BASE_URL=http://localhost:1337 DATABASE_URL=postgresql://postgres:[secret]@[IP]/planka SECRET_KEY=[secret] ... PGSSLMODE=disable ... # DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted DEFAULT_ADMIN_PASSWORD=[secret] DEFAULT_ADMIN_NAME=Baur DEFAULT_ADMIN_USERNAME=Baur ... ```
Author
Owner

@baur commented on GitHub (Mar 18, 2025):

maybe related with this?

direct run cmd:

Image

@baur commented on GitHub (Mar 18, 2025): maybe related with this? direct run cmd: ![Image](https://github.com/user-attachments/assets/47417c6f-cd90-4153-ab95-f310067f7ecd)
Author
Owner

@meltyshev commented on GitHub (Mar 18, 2025):

Hi @baur!

First of all, I noticed that your .env file has DEFAULT_ADMIN_EMAIL commented out. It should be uncommented and set to the admin account's email address.

Next, you need to initialize the database:

node db/init.js

After that, you can remove the password from the .env file and comment out other DEFAULT_ADMIN_* variables if needed.

I also recommend using this script to start Planka, simply create a start.sh file with the following content:

#!/bin/bash
export NODE_ENV=production && set -e && node db/init.js && node app.js --prod

This ensures the database is properly initialized and migrated before starting the application. Additionally, it removes the debug message you screenshotted.

@meltyshev commented on GitHub (Mar 18, 2025): Hi @baur! First of all, I noticed that your `.env` file has `DEFAULT_ADMIN_EMAIL` commented out. It should be uncommented and set to the admin account's email address. Next, you need to initialize the database: ```sh node db/init.js ``` After that, you can remove the password from the `.env` file and comment out other `DEFAULT_ADMIN_*` variables if needed. I also recommend using this script to start Planka, simply create a `start.sh` file with the following content: ```sh #!/bin/bash export NODE_ENV=production && set -e && node db/init.js && node app.js --prod ``` This ensures the database is properly initialized and migrated before starting the application. Additionally, it removes the debug message you screenshotted.
Author
Owner

@baur commented on GitHub (Mar 20, 2025):

@meltyshev

First of all, I noticed that your .env file has DEFAULT_ADMIN_EMAIL commented out. It should be uncommented and set to the admin account's email address.

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!

@baur commented on GitHub (Mar 20, 2025): @meltyshev > First of all, I noticed that your .env file has DEFAULT_ADMIN_EMAIL commented out. It should be uncommented and set to the admin account's email address. 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#645