Cannot create admin user #47

Open
opened 2026-03-30 22:12:37 +00:00 by jeppebundsgaard · 1 comment

I think I have done everything correct. But when running:
abra app cmd domain.dk app admin -- username user@email.tld
I get this:

Cannot find user role with that name
No such account
FATA

I have tried to run user generation this way:

abra app cmd domain.dk app bash

RAILS_ENV=production bin/tootctl accounts create user --email user@email.tld --confirmed --role Owner (from https://docs.joinmastodon.org/admin/setup/)
But I get:

Mastodon now requires that these variables are set:

  • ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY
  • ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT
  • ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY

Run bin/rails db:encryption:init to generate new secrets and then assign the environment variables.
Do not change the secrets once they are set, as doing so may cause data loss and other issues that will be difficult or impossible to recover from.

I don't know how to set these variables.

Any suggestions?

I think I have done everything correct. But when running: `abra app cmd domain.dk app admin -- username user@email.tld` I get this: > Cannot find user role with that name > No such account > FATA > I have tried to run user generation this way: `abra app cmd domain.dk app bash` `RAILS_ENV=production bin/tootctl accounts create user --email user@email.tld --confirmed --role Owner` (from https://docs.joinmastodon.org/admin/setup/) But I get: > Mastodon now requires that these variables are set: > > - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY > - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT > - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY > > Run `bin/rails db:encryption:init` to generate new secrets and then assign the environment variables. > Do not change the secrets once they are set, as doing so may cause data loss and other issues that will be difficult or impossible to recover from. I don't know how to set these variables. Any suggestions?
Owner

@jeppebundsgaard

Hmmmmm, I assume you're getting No such account because you don't have a user created with the email user@email.tld? However, perhaps, I'm missing something.

The reason you're seeing those env vars errors is because when you run abra app cmd ... this gets injected into the environment:

abra.sh Lines 37 to 49 in 414f5acc71
environment() {
# for sidekiq service bundle exec env var threading
file_env "DB_PASS"
file_env "OTP_SECRET"
file_env "SECRET_KEY_BASE"
file_env "VAPID_PRIVATE_KEY"
file_env "AWS_SECRET_ACCESS_KEY"
file_env "ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY"
file_env "ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT"
file_env "ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY"
declare -x RAILS_ENV=production
}

I haven't run this recipe in ages but I'd probably just cat this file once I abra app bash in.

compose.yml Line 26 in 414f5acc71
target: /usr/local/bin/entrypoint.sh

And then copy/pasta the file_env machinery so I can expose all those env vars manually in my shell session. Annnnd finally run the command. Which will perhaps give you the same error 😛

Good luck!

@jeppebundsgaard Hmmmmm, I assume you're getting `No such account` because you don't have a user created with the email `user@email.tld`? However, perhaps, I'm missing something. The reason you're seeing those env vars errors is because when you run `abra app cmd ...` this gets injected into the environment: https://git.coopcloud.tech/coop-cloud/mastodon/src/commit/414f5acc71b2bb52779b45c33b080f4560a94bb2/abra.sh#L37-L49 I haven't run this recipe in ages but I'd probably just cat this file once I `abra app bash` in. https://git.coopcloud.tech/coop-cloud/mastodon/src/commit/414f5acc71b2bb52779b45c33b080f4560a94bb2/compose.yml#L26 And then copy/pasta the `file_env` machinery so I can expose all those env vars manually in my shell session. Annnnd finally run the command. Which will perhaps give you the same error 😛 Good luck!
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coop-cloud/mastodon#47
No description provided.