openproject-deploy icon indicating copy to clipboard operation
openproject-deploy copied to clipboard

Default admin password is not working

Open inkerinmaa opened this issue 1 year ago • 4 comments

I am using TAG=14-slim (used TAG=14 as well) and cannot login with admin - admin password. I get error: Invalid user or password or the account is blocked due to multiple failed login attempts. If so, it will be unblocked automatically in a short time. I tried to reset password using this instruction: https://www.openproject.org/docs/installation-and-operations/operation/faq/ But it also doesn't work, I get error: irb(main):004> u.save! (irb):4:in `

': Validation failed: Username has already been taken. (ActiveRecord::RecordInvalid)

I tried to add root user to docker containers a someone suggested - same result.

inkerinmaa avatar Oct 16 '24 18:10 inkerinmaa

I have the same problem. :/ Instead of the stable/14 branch, I use stable/13. It is not up to date, but works for testing.

Weltii avatar Oct 23 '24 18:10 Weltii

I have the same problem. :/ Instead of the stable/14 branch, I use stable/13. It is not up to date, but works for testing.

I found (think so) the root cause. In docker compose file they bind directories inside container to the directory on host, where user has no write permissions. I just created docker volumes instead and replaced assignment in docker compose file (also, it is possible to chown for that binded folder).

inkerinmaa avatar Oct 23 '24 18:10 inkerinmaa

I have the same problem. :/ Instead of the stable/14 branch, I use stable/13. It is not up to date, but works for testing.

I found (think so) the root cause. In docker compose file they bind directories inside container to the directory on host, where user has no write permissions. I just created docker volumes instead and replaced assignment in docker compose file (also, it is possible to chown for that binded folder).

I experienced the same issue, and following the above solution worked for me too. Here are the steps I took:

  1. Run cp .env.example .env.
  2. Leave PGDATA= and OPDATA= empty in the .env file. This automatically creates Docker volumes, and the setup works smoothly.

yuki-shimoda-crypto avatar Oct 30 '24 06:10 yuki-shimoda-crypto

this work for me,

To resolve the issue with administrator access in OpenProject when the default admin - admin login doesn’t work, follow these steps:

  1. Create a user account in the OpenProject web application:

    • Access OpenProject in your browser and create a new user account without administrator privileges. This account will serve as a base to grant administrative access.
  2. Access the database container in Docker:

    • Enter the PostgreSQL container that holds the OpenProject database:
      docker exec -it openproject-db-1 psql -U postgres -d openproject
      
  3. Verify the account's administrator status:

    • Run the following query to check if the account is set as an administrator:
      SELECT id, login, admin, status FROM users WHERE login = 'your_username';
      
    • Replace 'your_username' with the username you created in step 1.
  4. Promote the account to administrator (if necessary):

    • If the admin field is set to false (f), update it to true (t) to grant administrator privileges:
      UPDATE users SET admin = true WHERE login = 'your_username';
      
  5. Activate the account:

    • Ensure the status field is set to allow access (typically, status = 1 indicates an active account in OpenProject). If the status is different, activate it with this query:
      UPDATE users SET status = 1 WHERE login = 'your_username';
      
  6. Confirm and exit:

    • Confirm that the admin status is set to true and that status is 1. Then exit the psql session:
      \q
      

With these steps, the account should now have administrator permissions and be fully activated, allowing you to access OpenProject with administrative privileges. This method enables you to manually create an administrator account without relying on the default admin - admin credentials.

cebberus avatar Nov 12 '24 02:11 cebberus

Apparently the seeder is not creating the admin user. I've checked it directly via the ruby console in the web-worker:

open-project(prod)> User.all
=> 
[#<AnonymousUser:0x00007fabf2b45898
  id: 1,
  login: "",
  firstname: "",
  lastname: "Anonymous",
  mail: "",
  admin: false,
  status: "active",
  last_login_on: nil,
  language: "",
  ldap_auth_source_id: nil,
  created_at: "2025-10-29 19:59:42.614725000 +0000",
  updated_at: "2025-10-29 19:59:42.614725000 +0000",
  type: "AnonymousUser",
  first_login: true,
  force_password_change: false,
  failed_login_count: 0,
  last_failed_login_on: nil,
  consented_at: nil,
  webauthn_id: nil>]
open-project(prod)>

Workaround: Create admin user manually via Rails console

To access the Ruby console, execute on the docker-host system:

docker compose exec web bash
RAILS_ENV=production bundle exec rails c

Then create the user in the Ruby console:

user = User.new(
  login: 'admin',
  firstname: 'OpenProject',
  lastname: 'Admin',
  mail: '[email protected]',
  admin: true,
  status: 'active',
  language: 'en'
)
user.password = user.password_confirmation = 'admin'
user.save!

The big advantage: you get datatype checks and value checks, so you can only add valid user-data.

ellmau avatar Oct 29 '25 20:10 ellmau

Hi! Maybe my suggested solution will be helpful to someone. I only had one user named Anonymous in the users table, but that wasn't very helpful. On the login screen, I clicked on the “Create new account” link and created a new user. Then I logged into the database and changed the admin and status fields. The password has been already created in the ui when I created a new account.

Here my steps:

connect to db: docker exec -it openproject-db-1 psql -U postgres -d openproject

change status and admin field update users set status = 1 where login = 'myuser'; update users set admin = true where login = 'myuser';

Here you can find the password_hash: select * from user_passwords;

I hope my method helps someone.

nivkoviceu avatar Nov 24 '25 20:11 nivkoviceu