Workaround for failed default administrator account

I would just like to copy what I sent as a reportbug to github, as it could benefit users who do not want to redo their docker setup.

I believe this is a bug, but I am not 100% sure whether this is considered as part of a deployment problem, so I will post the copy here:

[ original post: docker image fails to create default administrator account · Issue #17630 · go-gitea/gitea · GitHub ]

### Description

When the user opts not to create a new administrator on the first wizard web pages (first login), the system fails to create any new user.

There is a note on the wizard that a "default" administrator account would be created on the page where the database settings are --- however it fails to create one.

The only system user(bash shell) that can facilitate creating a new gitea user is going to a shell via the gitea docker container and creating the account from there:: (it's a workaround for anyone who is stuck in the first-run setup)

the work-around I used:

on the docker host,
`docker exec -it gitea bash`

once in the gitea container,
`su -l git`
(otherwise there are errors with when trying to update things as the root user)

`gitea -c /data/gitea/conf/app.ini admin user list`

^ the user needs to specify "-c /data/gitea/conf/app.ini", otherwise the configuration path defaults to elsewhere. This should be improved -- from what I can tell this does not occur while using the root account within the gitea container..

create an administration account,
`gitea admin user create --name _admin_name_ --password _password_ --email useremail@somewhere.net --admin -c /data/gitea/conf/app.ini`

the new administator account now shows in the user list,
`gitea -c /data/gitea/conf/app.ini admin user list`

exit the container,
type `exit` , exits the "git" user login
type `exit` again , exits the gitea container bash session

^ users can use this as a workaround, if they do not have any default user account(which should also be an administrator account with the "--admin" option)

is this considered a deployment issue/feature-request or I suppose it looks most to me as a bug.

I’m new trying out gitea, and it installed on my first try, however it lacks creating a default administrator account…

thanks

1 Like