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

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

Open
MikaelKW opened this issue Feb 3, 2025 · 11 comments
Open

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

MikaelKW opened this issue Feb 3, 2025 · 11 comments

Comments

@MikaelKW
Copy link

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

@MikaelKW
Copy link
Author

MikaelKW commented 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: knex/knex#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
Copy link
Member

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.

@MikaelKW
Copy link
Author

MikaelKW commented 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

@meltyshev
Copy link
Member

Ah, please try putting the [DATABASE_URL] in quotes like this: psql "[DATABASE_URL]" -c "SELECT * FROM user_account;".

@MikaelKW
Copy link
Author

MikaelKW commented Feb 4, 2025

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

Image

Image

@meltyshev
Copy link
Member

My bad, it should be in single quotes 🙈

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

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

@MikaelKW
Copy link
Author

MikaelKW commented Feb 4, 2025

Got it!

Image

@meltyshev
Copy link
Member

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='[email protected]' DEFAULT_ADMIN_PASSWORD='demo' DEFAULT_ADMIN_NAME='Demo Demo' DEFAULT_ADMIN_USERNAME='demo' npm run db:init

@MikaelKW
Copy link
Author

MikaelKW commented 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

@meltyshev
Copy link
Member

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

@MikaelKW
Copy link
Author

MikaelKW commented Feb 5, 2025

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

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

2 participants