create-tenant get 400 error #9687

Closed
opened 2026-02-21 18:37:44 -05:00 by yindo · 0 comments
Owner

Originally created by @Nu11Point on GitHub (Mar 6, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

langgenius/dify-api:0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

postgre accout is empty

dify=# select * from accounts;
id | name | email | password | password_salt | avatar | interface_language | interface_theme | timezone | last_login_at | last_login_ip | status | initialized_at | created_at | updated_at | last_active_at
----+------+-------+----------+---------------+--------+--------------------+-----------------+----------+---------------+---------------+--------+----------------+------------+------------+----------------
(0 rows)

dify=#
so i want create a user in command line, but it got a 400 error

docker exec -it docker_api_1 flask create-tenant --email 'admin@local.com' --name "Custom Tenant" --language 'zh-Hans'

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
2025-03-07 02:45:18.674 INFO [MainThread] [utils.py:160] - NumExpr defaulting to 8 threads.
2025-03-07 02:45:25.472 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
2025-03-07 02:45:32.242 ERROR [MainThread] [account_service.py:893] - Register failed
Traceback (most recent call last):
File "/app/api/services/account_service.py", line 865, in register
account = AccountService.create_account(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/account_service.py", line 209, in create_account
raise AccountNotFound()
controllers.console.error.AccountNotFound: 400 Bad Request: Account not found.
Traceback (most recent call last):
File "/app/api/services/account_service.py", line 865, in register
account = AccountService.create_account(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/account_service.py", line 209, in create_account
raise AccountNotFound()
controllers.console.error.AccountNotFound: 400 Bad Request: Account not found.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/api/.venv/bin/flask", line 8, in
sys.exit(main())
^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
cli.main()
File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/commands.py", line 564, in create_tenant
account = RegisterService.register(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/account_service.py", line 894, in register
raise AccountRegisterError(f"Registration failed: {e}") from e
services.errors.account.AccountRegisterError: Registration failed: 400 Bad Request: Account not found.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Nu11Point on GitHub (Mar 6, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version langgenius/dify-api:0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce postgre accout is empty dify=# select * from accounts; id | name | email | password | password_salt | avatar | interface_language | interface_theme | timezone | last_login_at | last_login_ip | status | initialized_at | created_at | updated_at | last_active_at ----+------+-------+----------+---------------+--------+--------------------+-----------------+----------+---------------+---------------+--------+----------------+------------+------------+---------------- (0 rows) dify=# so i want create a user in command line, but it got a 400 error # docker exec -it docker_api_1 flask create-tenant --email 'admin@local.com' --name "Custom Tenant" --language 'zh-Hans' None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. 2025-03-07 02:45:18.674 INFO [MainThread] [utils.py:160] - NumExpr defaulting to 8 threads. 2025-03-07 02:45:25.472 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK" 2025-03-07 02:45:32.242 ERROR [MainThread] [account_service.py:893] - Register failed Traceback (most recent call last): File "/app/api/services/account_service.py", line 865, in register account = AccountService.create_account( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/services/account_service.py", line 209, in create_account raise AccountNotFound() controllers.console.error.AccountNotFound: 400 Bad Request: Account not found. Traceback (most recent call last): File "/app/api/services/account_service.py", line 865, in register account = AccountService.create_account( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/services/account_service.py", line 209, in create_account raise AccountNotFound() controllers.console.error.AccountNotFound: 400 Bad Request: Account not found. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 564, in create_tenant account = RegisterService.register( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/services/account_service.py", line 894, in register raise AccountRegisterError(f"Registration failed: {e}") from e services.errors.account.AccountRegisterError: Registration failed: 400 Bad Request: Account not found. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:37:44 -05:00
yindo closed this issue 2026-02-21 18:37:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#9687