misskey icon indicating copy to clipboard operation
misskey copied to clipboard

First user did not receive admin rights

Open belatedly opened this issue 3 years ago • 7 comments

💡 Summary

I am moving my instance from one VPS to another on a different service. I did a fresh install on the new VPS and created the first account. It did not receive admin rights and it is the only user showing. Can someone advise how I can set the account as admin in the command line?

🥰 Expected Behavior

First account should become admin.

🤬 Actual Behavior

First account is just a regular account.

📝 Steps to Reproduce

  1. Point domain at new IP
  2. Install Misskey
  3. Register first user

📌 Environment

Misskey version: 12.110.1 Your OS: Debian 10 Your browser: Safari and Firefox

belatedly avatar May 15 '22 13:05 belatedly

You can manually mark a user as admin by issuing this SQL query:

UPDATE "user" SET "isAdmin" = TRUE WHERE "id" = '<id>';

Replace <id> with the ID of the user (leave the single quotes). You can find the ID of a user by going to their profile page, click the three dots next to the follow button and select the "About" menu entry.

Johann150 avatar May 15 '22 14:05 Johann150

Are you absolutely sure that there is no other account? You can check by running

SELECT COUNT(1) FROM "user" WHERE "host" IS NULL;

Johann150 avatar May 15 '22 14:05 Johann150

Thank you! The instance.actor account is there in addition to the one I created but I wouldn't think it gave that one admin. I will check once the domain propagates back to the new VPS.

belatedly avatar May 15 '22 14:05 belatedly

It might be a race condition if the instance.actor account is created first. The auto-admin part checks the total local user count so if any of the system users gets created first, this might be an issue. https://github.com/misskey-dev/misskey/blob/1c67c26bd87aae64fe0f2ef45140e12a78564699/packages/backend/src/server/api/common/signup.ts#L88-L90 Since system accounts will always be created as a non-admin user (see below) adding isAdmin: true as a condition to the above could resolve this problem. https://github.com/misskey-dev/misskey/blob/1c67c26bd87aae64fe0f2ef45140e12a78564699/packages/backend/src/services/create-system-user.ts#L43

Johann150 avatar May 15 '22 15:05 Johann150

It just propagated, the instance.actor account is not set as admin either. I am guessing the lack of admin has something to do with the instance having already been established and running for nearly 2 years - even though it had propagated on my machine maybe it was still floating between the two IPs when the install was completed.

belatedly avatar May 15 '22 15:05 belatedly

これ修正したんだっけ

tamaina avatar Mar 26 '23 13:03 tamaina

same problem in v13 installed by docker UPDATE "user" SET "isAdmin" = TRUE WHERE "id" = ''; showed : ERROR: column "isAdmin" of relation "user" does not exist

binary3141 avatar Jul 05 '23 03:07 binary3141

same problem in v13 installed by docker UPDATE "user" SET "isAdmin" = TRUE WHERE "id" = ''; showed : ERROR: column "isAdmin" of relation "user" does not exist

same trouble

DarkShyMW avatar Jul 18 '23 20:07 DarkShyMW

I did some digging. The new command is:

UPDATE public.user SET "isRoot" = TRUE WHERE "id" = '<id>';

After that, reboot to let everything settle.

melerva avatar Nov 03 '23 04:11 melerva