dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Unable to log in with default credentials

Open philskents opened this issue 11 months ago • 10 comments

OS & Hardware VPS running Ubuntu 24 LTS

Version 0.22.1

Describe the bug Default credentials not working to log in

To Reproduce Steps to reproduce the behavior:

  1. Clean install using docker
  2. Go to https://domain.com/users/sign_in
  3. Enter default credentials ([email protected]/password)
  4. Login fails, Incorrect email or password

Expected behavior A clear and concise description of what you expected to happen.

Screenshots N/A

Logs N/A

Additional context N/A

philskents avatar Jan 12 '25 20:01 philskents

Please provide logs

Freika avatar Jan 12 '25 20:01 Freika

Please provide logs

Any logs in particular?

philskents avatar Jan 12 '25 20:01 philskents

Please provide logs

Any logs in particular?

yes, logs from dawarich_app container at the time of the attempt to sign in

Freika avatar Jan 12 '25 20:01 Freika

I'm having the same issue but there is nothing notable in the logs.

I, [2025-01-12T20:47:21.455054 #76]  INFO -- : {"method":"GET","path":"/users/sign_in","format":"html","controller":"Devise::SessionsController","action":"new","status":200,"allocations":5804,"duration":25.42,"view":24.12,"db":0.0}

This is the request from the login attempt, which is the only entry that gets logged when trying to log in.

JojiiOfficial avatar Jan 12 '25 20:01 JojiiOfficial

To add to this: The users table in the DB is empty. I assume this is the cause of the issue as long as the default user is not hardcoded. Is there a workaround to create a new user manually from CLI or encrypt (hash?) a password manually to insert a new user manually.

JojiiOfficial avatar Jan 12 '25 21:01 JojiiOfficial

Investigating further: The issue is/was the 'production' setup variant. The default user only gets created in non-production setups. I'd suggest to note this in the documentation since I'd assume having a 'production' setup, the other setup is just a 'demo'.

@philskents did you use the production setup too?

JojiiOfficial avatar Jan 12 '25 21:01 JojiiOfficial

Investigating further: The issue is/was the 'production' setup variant. The default user only gets created in non-production setups. I'd suggest to note this in the documentation since I'd assume having a 'production' setup, the other setup is just a 'demo'.

@philskents did you use the production setup too?

The production environment, however counter-intuitive it might sound, is not a recommended environment to run Dawarich as of now and was clearly stated in the notes to one of the most recent releases and written here on Github before that.

To create a new user, run on the console:

User.create(email: '[email protected]', password: 'password', admin: true)

Freika avatar Jan 12 '25 21:01 Freika

Thanks for the quck response!

I'm a 'new' user who just discovered dawarich. Neither the readme nor the documentation state anything about the production environment and personally I don't think it is intuitive to look into release notes of older versions to troubleshoot a bug that wasn't caused by upgrading from an older version.

To prevent other people from loosing time on debugging something like this (or not using dawarich at all), I'd still suggest to add a short note regarding the default login in either the documentation, readme or at least the 'production' docker compose file. Also because for me it is intuitive to have a default user or some sort of setup mechanism - even in a production environment.

JojiiOfficial avatar Jan 12 '25 21:01 JojiiOfficial

Yeah my bad, read the docs, not the release notes

philskents avatar Jan 13 '25 01:01 philskents

Yeah my bad, read the docs, not the release notes

You're right, it's not in the docs on the website, I'll add it soon. Thanks!

Freika avatar Jan 13 '25 08:01 Freika

I have also had this problem during setup where the installation doesn't create any users is very confusing for non-technical users. The current solution that I found on other forums of logging into the ruby console and adding an 'admin' user is very confusing for non-technical users.

michaelwheatland avatar Jan 20 '25 03:01 michaelwheatland

I have also had this problem during setup where the installation doesn't create any users is very confusing for non-technical users. The current solution that I found on other forums of logging into the ruby console and adding an 'admin' user is very confusing for non-technical users.

I'm assuming you're either running it on Unraid or in production environment.

The problem is whoever created the Unraid template, used docker-compose.production.yml while it's not intended for usage as of now.

Anyway, 0.22.4 version of Dawarich is now creating the default user even in production env, so I'm closing this.

In the future, I'd love to have contact with the person who's working on the Unraid template and have these issues to be posted there.

Freika avatar Jan 20 '25 13:01 Freika