create org, return 404 page #4028

Closed
opened 2025-11-02 05:34:47 -06:00 by GiteaMirror · 17 comments
Owner

Originally created by @ccpwcn on GitHub (Sep 28, 2019).

  • Gitea version (or commit ref): 1.9.3
  • Git version: 2.22.0
  • Operating system: CentOS 7.6 x64
  • Database (use [x]):
    • PostgreSQL
    • Mariadb 10.4
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2019/09/28 10:33:42 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION
2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "s6U7bdkCuu", "SIDpn7bnCJ", "", "", 1569638022, 1569638022, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""}
2019/09/28 10:33:42 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"10", 1569638022, 10}
2019/09/28 10:33:42 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 10
2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 10, false}
2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{10, "owners", "Owners", "", 4, 0, 1}
2019/09/28 10:33:42 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{10, 9, 1, 10, 9, 2, 10, 9, 3, 10, 9, 4, 10, 9, 5, 10, 9, 6, 10, 9, 7}
2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{10, 9, 1}
2019/09/28 10:33:42 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT
2019/09/28 10:33:42 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/28 10:33:42 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/28 10:33:42 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"}
2019/09/28 10:33:42 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]
2019/09/28 10:35:40 ...go-xorm/xorm/rows.go:50:newRows() [I] [SQL] SELECT `id`, `repo_id`, `interval`, `enable_prune`, `updated_unix`, `next_update_unix` FROM `mirror` WHERE (next_update_unix<=?) AND (next_update_unix!=0) []interface {}{1569638140}

Description

When I want to create an organization, return 404 pages, some sql has been executed that the app log showed, but the tables of gitea database is empty, then log showed: GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]

Screenshots

火狐截图_2019-09-28T02-51-12 152Z

I access the gitea from nginx reverse proxy, this error exists, and when I access the gitea from 3000 port direct IP+port, the error exists too.

Originally created by @ccpwcn on GitHub (Sep 28, 2019). - Gitea version (or commit ref): 1.9.3 - Git version: 2.22.0 - Operating system: CentOS 7.6 x64 - Database (use `[x]`): - [ ] PostgreSQL - [x] Mariadb 10.4 - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ```bash 2019/09/28 10:33:42 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION 2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "s6U7bdkCuu", "SIDpn7bnCJ", "", "", 1569638022, 1569638022, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""} 2019/09/28 10:33:42 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"10", 1569638022, 10} 2019/09/28 10:33:42 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 10 2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 10, false} 2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{10, "owners", "Owners", "", 4, 0, 1} 2019/09/28 10:33:42 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{10, 9, 1, 10, 9, 2, 10, 9, 3, 10, 9, 4, 10, 9, 5, 10, 9, 6, 10, 9, 7} 2019/09/28 10:33:42 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{10, 9, 1} 2019/09/28 10:33:42 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT 2019/09/28 10:33:42 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/28 10:33:42 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/28 10:33:42 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"} 2019/09/28 10:33:42 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0] 2019/09/28 10:35:40 ...go-xorm/xorm/rows.go:50:newRows() [I] [SQL] SELECT `id`, `repo_id`, `interval`, `enable_prune`, `updated_unix`, `next_update_unix` FROM `mirror` WHERE (next_update_unix<=?) AND (next_update_unix!=0) []interface {}{1569638140} ``` ## Description When I want to create an organization, return 404 pages, some sql has been executed that the app log showed, but the tables of gitea database is empty, then log showed: **GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]** ## Screenshots ![火狐截图_2019-09-28T02-51-12 152Z](https://user-images.githubusercontent.com/5465756/65810533-e6efad80-e1dd-11e9-9615-377927679893.png) I access the gitea from nginx reverse proxy, this error exists, and when I access the gitea from 3000 port direct IP+port, the error exists too.
GiteaMirror added the type/question label 2025-11-02 05:34:47 -06:00
Author
Owner

@lunny commented on GitHub (Sep 28, 2019):

There is no error info on your log

@lunny commented on GitHub (Sep 28, 2019): There is no error info on your log
Author
Owner

@bagasme commented on GitHub (Sep 28, 2019):

Can you reproduce this issue? If yes, post here the error info on your log.

@bagasme commented on GitHub (Sep 28, 2019): Can you reproduce this issue? If yes, post here the error info on your log.
Author
Owner

@ccpwcn commented on GitHub (Sep 28, 2019):

On this page:
TIM截图20190928215350

click the button 创建组织, then I have these logs:

2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/28 21:51:44 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE (id!=?) AND `lower_name`=? LIMIT 1 []interface {}{0, "band_of_brothers"}
2019/09/28 21:51:44 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION
2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "gPYOtoCQ5Q", "Zj6KTKR5oV", "", "", 1569678704, 1569678704, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""}
2019/09/28 21:51:44 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"12", 1569678704, 12}
2019/09/28 21:51:44 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 12
2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 12, false}
2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{12, "owners", "Owners", "", 4, 0, 1}
2019/09/28 21:51:44 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{12, 11, 1, 12, 11, 2, 12, 11, 3, 12, 11, 4, 12, 11, 5, 12, 11, 6, 12, 11, 7}
2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{12, 11, 1}
2019/09/28 21:51:44 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT
2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/28 21:51:44 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"}
2019/09/28 21:51:44 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]
2019/09/28 21:51:45 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/28 21:51:45 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/28 21:51:46 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/28 21:51:46 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}

then, the 404 page occured:
TIM截图20190928215649

This 404 page must be there, 100% reproduce

@ccpwcn commented on GitHub (Sep 28, 2019): On this page: ![TIM截图20190928215350](https://user-images.githubusercontent.com/5465756/65817521-85116100-e23a-11e9-861f-7500d4b88b26.jpg) click the button **创建组织**, then I have these logs: ``` 2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/28 21:51:44 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE (id!=?) AND `lower_name`=? LIMIT 1 []interface {}{0, "band_of_brothers"} 2019/09/28 21:51:44 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION 2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "gPYOtoCQ5Q", "Zj6KTKR5oV", "", "", 1569678704, 1569678704, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""} 2019/09/28 21:51:44 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"12", 1569678704, 12} 2019/09/28 21:51:44 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 12 2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 12, false} 2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{12, "owners", "Owners", "", 4, 0, 1} 2019/09/28 21:51:44 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{12, 11, 1, 12, 11, 2, 12, 11, 3, 12, 11, 4, 12, 11, 5, 12, 11, 6, 12, 11, 7} 2019/09/28 21:51:44 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{12, 11, 1} 2019/09/28 21:51:44 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT 2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/28 21:51:44 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/28 21:51:44 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"} 2019/09/28 21:51:44 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0] 2019/09/28 21:51:45 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/28 21:51:45 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/28 21:51:46 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/28 21:51:46 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} ``` then, the 404 page occured: ![TIM截图20190928215649](https://user-images.githubusercontent.com/5465756/65817542-e6393480-e23a-11e9-8825-5c3da4df2f2d.jpg) **This 404 page must be there, 100% reproduce**
Author
Owner

@ccpwcn commented on GitHub (Sep 28, 2019):

There is no error info on your log

This 404 page will appear 100% of the time, I tried to access the service through nginx, and I tried to access the service directly (IP+ port number), but it didn't work.

@ccpwcn commented on GitHub (Sep 28, 2019): > There is no error info on your log This 404 page will appear 100% of the time, I tried to access the service through nginx, and I tried to access the service directly (IP+ port number), but it didn't work.
Author
Owner

@ccpwcn commented on GitHub (Sep 28, 2019):

I don't know what the problem is, I don't know how to solve it, and right now, I can't use gitea, so I'm very miserable.

@ccpwcn commented on GitHub (Sep 28, 2019): I don't know what the problem is, I don't know how to solve it, and right now, I can't use gitea, so I'm very miserable.
Author
Owner

@guillep2k commented on GitHub (Sep 28, 2019):

2019/09/28 21:51:44 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]

I think this is the error in his log. No idea of why it happens.

@ccpwcn some questions:

  1. Have you been able to create orgs before in this particular installation?
  2. Can you still create normal users?
  3. Is this a new installation (i.e. it has never been upgraded)?

Try changing you app.ini to log with more detail:

[log]
LEVEL            = Trace
@guillep2k commented on GitHub (Sep 28, 2019): ``` 2019/09/28 21:51:44 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0] ``` I think this is the error in his log. No idea of why it happens. @ccpwcn some questions: 1. Have you been able to create orgs before in this particular installation? 2. Can you still create normal users? 3. Is this a new installation (i.e. it has never been upgraded)? Try changing you `app.ini` to log with more detail: ``` [log] LEVEL = Trace ```
Author
Owner

@ccpwcn commented on GitHub (Sep 28, 2019):

I set the log level is "trace", then create org again, 404 page still there, when I click button 创建组织, I have some trace logs:

2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63
2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ==
2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE (id!=?) AND `lower_name`=? LIMIT 1 []interface {}{0, "band_of_brothers"}
2019/09/29 00:18:10 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION
2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "q6jhejDETL", "eP4BBQos7B", "", "", 1569687490, 1569687490, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""}
2019/09/29 00:18:10 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"15", 1569687490, 15}
2019/09/29 00:18:10 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 15
2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 15, false}
2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{15, "owners", "Owners", "", 4, 0, 1}
2019/09/29 00:18:10 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{15, 14, 1, 15, 14, 2, 15, 14, 3, 15, 14, 4, 15, 14, 5, 15, 14, 6, 15, 14, 7}
2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{15, 14, 1}
2019/09/29 00:18:10 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT
2019/09/29 00:18:10 routers/org/org.go:72:CreatePost() [T] Organization created: band_of_brothers
2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63
2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ==
2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"}
2019/09/29 00:18:10 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0]
2019/09/29 00:18:10 ...s/context/context.go:137:HTML() [D] Template: status/404
2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63
2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ==
2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/29 00:18:10 ...s/context/context.go:137:HTML() [D] Template: pwa/manifest_json
2019/09/29 00:18:12 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1}
2019/09/29 00:18:12 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63
2019/09/29 00:18:12 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ==
2019/09/29 00:18:12 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1}
2019/09/29 00:18:12 ...s/context/context.go:137:HTML() [D] Template: pwa/serviceworker_js
@ccpwcn commented on GitHub (Sep 28, 2019): I set the log level is "trace", then create org again, 404 page still there, when I click button **创建组织**, I have some trace logs: ``` 2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63 2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ== 2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE (id!=?) AND `lower_name`=? LIMIT 1 []interface {}{0, "band_of_brothers"} 2019/09/29 00:18:10 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] BEGIN TRANSACTION 2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `user` (`lower_name`,`name`,`full_name`,`email`,`keep_email_private`,`passwd`,`must_change_password`,`login_type`,`login_source`,`login_name`,`type`,`location`,`website`,`rands`,`salt`,`language`,`description`,`created_unix`,`updated_unix`,`last_login_unix`,`last_repo_visibility`,`max_repo_creation`,`is_active`,`is_admin`,`allow_git_hook`,`allow_import_local`,`allow_create_organization`,`prohibit_login`,`avatar`,`avatar_email`,`use_custom_avatar`,`num_followers`,`num_following`,`num_stars`,`num_repos`,`num_teams`,`num_members`,`visibility`,`diff_view_style`,`theme`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"band_of_brothers", "band_of_brothers", "", "", false, "", false, 0, 0, "", 1, "", "", "q6jhejDETL", "eP4BBQos7B", "", "", 1569687490, 1569687490, 0, false, -1, true, false, false, false, false, false, "", "", true, 0, 0, 0, 0, 1, 1, 0, "", ""} 2019/09/29 00:18:10 ...rm/session_update.go:375:Update() [I] [SQL] UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=? []interface {}{"15", 1569687490, 15} 2019/09/29 00:18:10 models/user.go:354:generateRandomAvatar() [I] New random avatar created: 15 2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `org_user` (`uid`,`org_id`,`is_public`) VALUES (?, ?, ?) []interface {}{1, 15, false} 2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team` (`org_id`,`lower_name`,`name`,`description`,`authorize`,`num_repos`,`num_members`) VALUES (?, ?, ?, ?, ?, ?, ?) []interface {}{15, "owners", "Owners", "", 4, 0, 1} 2019/09/29 00:18:10 ...rm/session_insert.go:264:innerInsertMulti() [I] [SQL] INSERT INTO `team_unit` (`org_id`, `team_id`, `type`) VALUES (?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?),(?, ?, ?) []interface {}{15, 14, 1, 15, 14, 2, 15, 14, 3, 15, 14, 4, 15, 14, 5, 15, 14, 6, 15, 14, 7} 2019/09/29 00:18:10 ...rm/session_insert.go:513:innerInsert() [I] [SQL] INSERT INTO `team_user` (`org_id`,`team_id`,`uid`) VALUES (?, ?, ?) []interface {}{15, 14, 1} 2019/09/29 00:18:10 ...xorm/xorm/session.go:845:saveLastSQL() [I] [SQL] COMMIT 2019/09/29 00:18:10 routers/org/org.go:72:CreatePost() [T] Organization created: band_of_brothers 2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63 2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ== 2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 []interface {}{"band_of_brothers"} 2019/09/29 00:18:10 ...dules/context/org.go:54:HandleOrgAssignment() [E] GetUserByName: user does not exist [uid: 0, name: band_of_brothers, keyid: 0] 2019/09/29 00:18:10 ...s/context/context.go:137:HTML() [D] Template: status/404 2019/09/29 00:18:10 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/29 00:18:10 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63 2019/09/29 00:18:10 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ== 2019/09/29 00:18:10 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/29 00:18:10 ...s/context/context.go:137:HTML() [D] Template: pwa/manifest_json 2019/09/29 00:18:12 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} 2019/09/29 00:18:12 ...s/context/context.go:328:func1() [D] Session ID: 9f074a14b550bd63 2019/09/29 00:18:12 ...s/context/context.go:329:func1() [D] CSRF Token: 3PTc2ZIHZPUZYc7p2HHi9kZDpOs6MTU2OTY4NzQ1NzEyNTczNDEwNQ== 2019/09/29 00:18:12 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} 2019/09/29 00:18:12 ...s/context/context.go:137:HTML() [D] Template: pwa/serviceworker_js ```
Author
Owner

@guillep2k commented on GitHub (Sep 28, 2019):

Thank you, @ccpwcn. What about the three questions?

  1. Have you been able to create orgs before in this particular installation?
  2. Can you still create normal users?
  3. Is this a new installation (i.e. it has never been upgraded)?
@guillep2k commented on GitHub (Sep 28, 2019): Thank you, @ccpwcn. What about the three questions? 1. Have you been able to create orgs before in this particular installation? 2. Can you still create normal users? 3. Is this a new installation (i.e. it has never been upgraded)?
Author
Owner

@ccpwcn commented on GitHub (Sep 29, 2019):

Thank you, @ccpwcn. What about the three questions?

  1. Have you been able to create orgs before in this particular installation?
  2. Can you still create normal users?
  3. Is this a new installation (i.e. it has never been upgraded)?
  1. I've never succeeded in create an organization
  2. I can create normal user, I succeeded, Just now, another one was created
  3. This a new installation, But this is a complex problem.
    About a month ago, I was using gogs and I couldn't create an organization on it. I also returned a 404 page. I searched a lot of information on the Internet, but could not solve it. To my despair, this problem still exists when I has a new installation of gitea and there is still no way to solve it, which is why I am here to ask the question.
@ccpwcn commented on GitHub (Sep 29, 2019): > Thank you, @ccpwcn. What about the three questions? > > 1. Have you been able to create orgs before in this particular installation? > 2. Can you still create normal users? > 3. Is this a new installation (i.e. it has never been upgraded)? 1. I've never succeeded in create an organization 2. I can create normal user, I succeeded, Just now, another one was created 3. This a new installation, But this is a complex problem. **About a month ago, I was using gogs and I couldn't create an organization on it. I also returned a 404 page. I searched a lot of information on the Internet, but could not solve it. To my despair, this problem still exists when I has a new installation of gitea and there is still no way to solve it, which is why I am here to ask the question.**
Author
Owner

@guillep2k commented on GitHub (Sep 29, 2019):

This sounds very suspicious. Can you access the database and try the insert yourself?

START TRANSACTION;
INSERT INTO user (lower_name, name, full_name, email, keep_email_private, passwd, must_change_password, login_type, login_source, login_name, type, location, website, rands, salt, language, description, created_unix, updated_unix, last_login_unix, last_repo_visibility, max_repo_creation, is_active, is_admin, allow_git_hook, allow_import_local, allow_create_organization, prohibit_login, avatar, avatar_email, use_custom_avatar, num_followers, num_following, num_stars, num_repos, num_teams, num_members, visibility, diff_view_style, theme) VALUES ('band_of_brothers', 'band_of_brothers', '', '', false, '', false, 0, 0, '', 1, '', '', 's6U7bdkCuu', 'SIDpn7bnCJ', '', '', 1569638022, 1569638022, 0, false, -1, true, false, false, false, false, false, '', '', true, 0, 0, 0, 0, 1, 1, 0, '', '');
ROLLBACK;

Do not commit the transaction, as that insert will not create the organization properly. It's only to see if the INSERT fails in any way.

@guillep2k commented on GitHub (Sep 29, 2019): This sounds very suspicious. Can you access the database and try the insert yourself? ``` START TRANSACTION; INSERT INTO user (lower_name, name, full_name, email, keep_email_private, passwd, must_change_password, login_type, login_source, login_name, type, location, website, rands, salt, language, description, created_unix, updated_unix, last_login_unix, last_repo_visibility, max_repo_creation, is_active, is_admin, allow_git_hook, allow_import_local, allow_create_organization, prohibit_login, avatar, avatar_email, use_custom_avatar, num_followers, num_following, num_stars, num_repos, num_teams, num_members, visibility, diff_view_style, theme) VALUES ('band_of_brothers', 'band_of_brothers', '', '', false, '', false, 0, 0, '', 1, '', '', 's6U7bdkCuu', 'SIDpn7bnCJ', '', '', 1569638022, 1569638022, 0, false, -1, true, false, false, false, false, false, '', '', true, 0, 0, 0, 0, 1, 1, 0, '', ''); ROLLBACK; ``` **Do not** commit the transaction, as that insert will not create the organization properly. It's only to see if the INSERT fails in any way.
Author
Owner

@ccpwcn commented on GitHub (Sep 29, 2019):

ROLLBACK;

I did as you said and there was no error message that could not insert data.

微信截图_20190929235341

@ccpwcn commented on GitHub (Sep 29, 2019): > ROLLBACK; I did as you said and there was no error message that could not insert data. ![微信截图_20190929235341](https://user-images.githubusercontent.com/5465756/65835076-8adb7500-e314-11e9-8fa3-b194b1fdd7bd.png)
Author
Owner

@guillep2k commented on GitHub (Sep 30, 2019):

I'm really at loss here. The insert works, the log shows no errors, but yet the row is missing right after that. I've created the org myself in my own installation, no problem (just out of desperation, in case the name 'band_of_brothers' had a problem). My test:

image

image

@guillep2k commented on GitHub (Sep 30, 2019): I'm really at loss here. The insert works, the log shows no errors, but yet the row is missing right after that. I've created the org myself in my own installation, no problem (just out of desperation, in case the name 'band_of_brothers' had a problem). My test: ![image](https://user-images.githubusercontent.com/18600385/65844030-e7399700-e30a-11e9-8a9b-44d93e611e77.png) ![image](https://user-images.githubusercontent.com/18600385/65844053-01737500-e30b-11e9-85b5-566fbec6e12b.png)
Author
Owner

@lunny commented on GitHub (Sep 30, 2019):

I have tested in my local with mariadb 10.4. Cannot reproduce it.

@lunny commented on GitHub (Sep 30, 2019): I have tested in my local with mariadb 10.4. Cannot reproduce it.
Author
Owner

@ccpwcn commented on GitHub (Sep 30, 2019):

@lunny I used chinese version, Could it be that?

and I used two steps to verify for login.

@ccpwcn commented on GitHub (Sep 30, 2019): @lunny I used chinese version, Could it be that? and I used two steps to verify for login.
Author
Owner

@lunny commented on GitHub (Sep 30, 2019):

@ccpwcn we have no Chinese version. About 20+ languages could be changed on UI on almost all the Gitea versions. If you speak Chinese, you could go to QQ Qun 328432459 to get a further help.

@lunny commented on GitHub (Sep 30, 2019): @ccpwcn we have no Chinese version. About 20+ languages could be changed on UI on almost all the Gitea versions. If you speak Chinese, you could go to QQ Qun 328432459 to get a further help.
Author
Owner

@stale[bot] commented on GitHub (Nov 29, 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 (Nov 29, 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.
Author
Owner

@ccpwcn commented on GitHub (Nov 29, 2019):

I had exported all databases, then yum remove mariadb-server, then yum install mariadb-server, then import all databases files that named *.sql, finally, the problem does not appeared.

@ccpwcn commented on GitHub (Nov 29, 2019): I had exported all databases, then `yum remove mariadb-server`, then `yum install mariadb-server`, then import all databases files that named *.sql, finally, the problem does not appeared.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4028