Unable to use ./bin/accountadmin to make a new administrator

Reproduction Instructions

  1. Install Phabricator on Ubuntu 18.04.3 LTS with the install script linked from the official installation guide.
  2. Set up Apache per the config guide linked at the bottom of the installation guide
  3. Set a password for the MySQL root user per StackExchange
  4. Visit your new Phabricator site and use the config command there to make Phabricator aware of your MySQL root password
  5. Run ./bin/storage upgrade from Phabricator directory
  6. Create an admin account after Step 5 completes
  7. Enable the username and password auth provider
  8. Use ./bin/auth recover <adminusername> to set a password for the admin account
  9. Log out of your admin account and create a account via the Web UI of your choosing.
  10. Approve the account of your choosing via the Web UI
  11. Use ./bin/accountadmin to make the account of your choosing an admin

Expected behaviour: Phabricator updates the account of your choosing. The account becomes an administrator’

Current behaviour: An error is thrown (see below code box for the error

Code box
[2019-08-18 08:41:37] EXCEPTION: (Error) Call to undefined method PhabricatorUserEditor::updateUser() at [<phabricator>/scripts/user/account_admin.php:200]
arcanist(head=master, ref.master=d92fa96366c0), phabricator(head=master, ref.master=d890c03ac348), phutil(head=master, ref.master=b416093386a2)
PHP Fatal error:  Uncaught Exception: Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction(). in /srv/phab/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}
  thrown in /srv/phab/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Fatal error: Uncaught Exception: Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction(). in /srv/phab/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}
  thrown in /srv/phab/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Phabricator/Arcanist Version
phabricator = d890c03ac348b3f9ced3ca73077e5934f18b7a6e (Fri, Aug 16)
arcanist = d92fa96366c0ed50e4257508148aa75192d4fb1f (Jun 21 2019)
phutil = b416093386a225b1d9a2de906899b94cbf4babcb (Jul 9 2019)

This looks like a legit bug (The function was removed in rP4fd473e7 but the call is still there), but why are you trying to use bin/accountadmin?

The expected flow is that after running ./bin/storage upgrade, the UI will guide you into creating an admin account with a password.

I’m only using ./bin/accountadmin as my workflow on this instance is very CLI based.

In a more “standard” workflow, people may need to be empowered via this feature if an admin chooses to use the CLI.

I can get that not too many people use this feature. Please consider pulling out the feature if no longer required.

Thanks, I filed this upstream as https://secure.phabricator.com/T13382.

See https://secure.phabricator.com/D20724 and https://secure.phabricator.com/D20725.

I removed bin/accountadmin, bin/people, and scripts/user/add_user.php.

I added bin/user empower and bin/user enable. These are now focused on restoring access to an install if you’ve managed to lock yourself out by accidentally destroying all the administrator accounts.

The recommended way to turn a user into an administrator is to go to their profile in the web UI, then select “Manage” > “Make Administrator”.