Install fails if admin username is invalid #590

Closed
opened 2025-11-02 03:29:10 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @PatrickMennig on GitHub (Mar 29, 2017).

  • Gitea version (or commit ref): 1.1.0
  • Git version: 2.1.4
  • Operating system: Debian 8
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When installing gitea I created a new admin user (name: master) via the web interface (:3000/install) and set a password containing an exclamation mark ("!"). The install page never redirected me to the main page, after a while I just opened the main page in another browser window and tried to log in. It always failed saying wrong username / password. I confirmed that the password was correct several times. I then changed install_lock to false, revisited /install and gave a password without special chars, this worked like a charm.

...

Screenshots

bildschirmfoto 2017-03-29 um 22 50 17
Originally created by @PatrickMennig on GitHub (Mar 29, 2017). - Gitea version (or commit ref): 1.1.0 - Git version: 2.1.4 - Operating system: Debian 8 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When installing gitea I created a new admin user (name: master) via the web interface (:3000/install) and set a password containing an exclamation mark ("!"). The install page never redirected me to the main page, after a while I just opened the main page in another browser window and tried to log in. It always failed saying wrong username / password. I confirmed that the password was correct several times. I then changed install_lock to false, revisited /install and gave a password without special chars, this worked like a charm. ... ## Screenshots <img width="761" alt="bildschirmfoto 2017-03-29 um 22 50 17" src="https://cloud.githubusercontent.com/assets/12029456/24476014/214c8d44-14d2-11e7-9654-3f8ccfee6f2b.png">
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 03:29:11 -06:00
Author
Owner

@pgaskin commented on GitHub (Apr 2, 2017):

I had this issue, but even though it hung on the redirect, it still worked afterwards.

@pgaskin commented on GitHub (Apr 2, 2017): I had this issue, but even though it hung on the redirect, it still worked afterwards.
Author
Owner

@bkcsoft commented on GitHub (Apr 18, 2017):

Sounds like we need more tests :trollface:

@bkcsoft commented on GitHub (Apr 18, 2017): Sounds like we need more tests :trollface:
Author
Owner

@Avalancs commented on GitHub (May 11, 2017):

Yesterday I did an install of 1.1.1 and didn't use any special characters in the password (used something very similar to Password123) and didn't get redirected. When I navigated to the login page manually and tried to log in I would get invalid username/password.

I looked into the database, and the user was actually not created. As a workaround I created the user by command line of gitea-1.1.1-amd64...exe So it might not necessarily be the password?

The specs:
Gitea version (or commit ref): 1.1.1
Git version: git2.12.2.windows.2
Operating system: Windows 10
Database: MySQL

@Avalancs commented on GitHub (May 11, 2017): Yesterday I did an install of 1.1.1 and didn't use any special characters in the password (used something very similar to Password123) and didn't get redirected. When I navigated to the login page manually and tried to log in I would get invalid username/password. I looked into the database, and the user was actually not created. As a workaround I created the user by command line of gitea-1.1.1-amd64...exe So it might not necessarily be the password? The specs: Gitea version (or commit ref): 1.1.1 Git version: git2.12.2.windows.2 Operating system: Windows 10 Database: MySQL
Author
Owner

@Avalancs commented on GitHub (May 23, 2017):

Specs:
Gitea version (or commit ref): 1.1.1
Git version: git2.12.2.windows.2
Operating system: Windows Server 2016 Standard
Database: MySQL

Did another install for reproducing another issue, and I've noticed that when you try to create a user called "admin" from the admin panel, it says "Username 'admin' is reserved." But this warning does not come up in the install page if you try to name the new user "admin". This should be the reason why I did not get the user created in my last post, because I named it admin.

@Avalancs commented on GitHub (May 23, 2017): Specs: Gitea version (or commit ref): 1.1.1 Git version: git2.12.2.windows.2 Operating system: Windows Server 2016 Standard Database: MySQL Did another install for reproducing another issue, and I've noticed that when you try to create a user called "admin" from the admin panel, it says "Username 'admin' is reserved." But this warning does not come up in the install page if you try to name the new user "admin". This should be the reason why I did not get the user created in my last post, because I named it admin.
Author
Owner

@hargut commented on GitHub (Dec 9, 2017):

Same here, tried to install 1.3.0 with postgres database backend on a separate db server, and create the admin user during the install with a special char in the password.
The redirect did not work and the user was not created. Creating the user as first user after refreshing the page worked.

It seems that the 'admin' name is with 1.3.0 also blocked when trying to register the first user. The 'admin' name did also not work during the setup process. Both ways a message appeared that the "Username 'admin' is reserved."

@hargut commented on GitHub (Dec 9, 2017): Same here, tried to install 1.3.0 with postgres database backend on a separate db server, and create the admin user during the install with a special char in the password. The redirect did not work and the user was not created. Creating the user as first user after refreshing the page worked. It seems that the 'admin' name is with 1.3.0 also blocked when trying to register the first user. The 'admin' name did also not work during the setup process. Both ways a message appeared that the "Username 'admin' is reserved."
Author
Owner

@stale[bot] commented on GitHub (Feb 25, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 25, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#590