Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Failed to create user with API: PasswordIsRequired #35239

Closed as not planned
Closed as not planned
Labels
issue/not-a-bugThe reported issue is the intended behavior or the problem is not inside Gitea
@cxue112

Description

Description

Hi Dev Team,

I spin up a gitea server and try to automatically create users with API, the response always containing the same problem:

{"message":"PasswordIsRequired","url":"http://<gitea-url>:<gitea-port>/api/swagger"}

My tries:
gitea server version: 1.24.2.
same token can list users, repos, create repos, but can not create users

  • Request to create repo(worked):
curl -X 'POST' \
 'http://<gitea-url>:<gitea-port>/api/v1/admin/users/<admin_user>/repos' \
 -H 'accept: application/json' \
 -H 'Authorization: token <token-created-by-admin>' \
 -H 'Content-Type: application/json' \
 -d '{
 "name": "test_api"
}'
  • Request to create user(NOT worked ):
curl -X 'POST' \
 'http://<gitea-url>:<gitea-port>/api/v1/admin/users' \
 -H 'accept: application/json' \
 -H 'Authorization: token <token-created-by-admin>' \
 -H 'Content-Type: application/json' \
 -d '{
 "email": "user1@example.com",
 "full_name": "user1",
 "login_name": "user1",
 "must_change_password": false,
 "password": "user1",
 "restricted": false,
 "visibility": "public",
 "send_notify": false,
 "username": "user1"
}'

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

2025年08月08日 15:31:03 HTTPRequest [I] router: completed POST /api/v1/admin/users for xx.xxx.xxx.0:xxxxx, 400 Bad Request in 20.0ms @ admin/user.go:55(admin.CreateUser)

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

I followed the official page to deploy gitea on azure vm with docker compose via public ip

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/not-a-bugThe reported issue is the intended behavior or the problem is not inside Gitea

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /