Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private repos are giving 404 after upgrading from 1.1.4 to 1.2.x #2906

Closed
2 of 7 tasks
dafes opened this issue Nov 13, 2017 · 3 comments
Closed
2 of 7 tasks

Private repos are giving 404 after upgrading from 1.1.4 to 1.2.x #2906

dafes opened this issue Nov 13, 2017 · 3 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@dafes
Copy link

dafes commented Nov 13, 2017

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

Description

After upgrading my gitea instance to latest version (1.2.3) i receive a 404 erro when clicking on my private repos.
Initially i upgraded from gogs 0.11.4 to gitea 1.1.*
Also the following line can be found in the log:

[...routers/repo/view.go:274 Home()] [E] Home: Cannot find any unit on this repository which you are allowed to access

xorm.log :

2017/11/13 15:07:54 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `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`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{4}
2017/11/13 15:07:54 [I] [SQL] SELECT count(*) FROM `notification` WHERE user_id = ? AND status = ? []interface {}{4, 0x1}
2017/11/13 15:07:54 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 []interface {}{4, "yahc"}
2017/11/13 15:07:54 [I] [SQL] SELECT count(*) FROM `release` WHERE repo_id=? AND is_draft=? []interface {}{1, false}
2017/11/13 15:07:54 [I] [SQL] SELECT * FROM `user` INNER JOIN `org_user` ON `org_user`.org_id=`user`.id WHERE `org_user`.uid=? AND `org_user`.is_owner=? ORDER BY `user`.`name` ASC []interface {}{4, true}
2017/11/13 15:07:54 [I] [SQL] SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 []interface {}{4, 1}
2017/11/13 15:07:54 [I] [SQL] SELECT `id`, `uid`, `repo_id` FROM `star` WHERE `uid`=? AND `repo_id`=? LIMIT 1 []interface {}{4, 1}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `repo_id`, `type`, `index`, `config`, `created_unix` FROM `repo_unit` WHERE repo_id = ? []interface {}{1}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `repo_id`, `type`, `index`, `config`, `created_unix` FROM `repo_unit` WHERE repo_id = ? []interface {}{1}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `repo_id`, `index`, `poster_id`, `name`, `content`, `milestone_id`, `priority`, `assignee_id`, `is_closed`, `is_pull`, `num_comments`, `deadline_unix`, `created_unix`, `updated_unix` FROM `issue` WHERE `repo_id`=? AND `index`=? LIMIT 1 []interface {}{1, 16}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `size`, `created_unix`, `updated_unix` FROM `repository` WHERE `id`=? LIMIT 1 []interface {}{1}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `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`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{4}
2017/11/13 15:07:55 [I] [SQL] SELECT * FROM `label` LEFT JOIN `issue_label` ON issue_label.label_id = label.id WHERE issue_label.issue_id = ? ORDER BY `label`.`name` ASC []interface {}{17}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `type`, `status`, `issue_id`, `index`, `head_repo_id`, `base_repo_id`, `head_user_name`, `head_branch`, `base_branch`, `merge_base`, `has_merged`, `merged_commit_id`, `merger_id`, `merged_unix` FROM `pull_request` WHERE `issue_id`=? LIMIT 1 []interface {}{17}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `uuid`, `issue_id`, `release_id`, `comment_id`, `name`, `download_count`, `created_unix` FROM `attachment` WHERE issue_id = ? AND comment_id = 0 []interface {}{17}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `type`, `poster_id`, `issue_id`, `label_id`, `old_milestone_id`, `milestone_id`, `old_assignee_id`, `assignee_id`, `old_title`, `new_title`, `commit_id`, `line`, `content`, `created_unix`, `updated_unix`, `commit_sha` FROM `comment` WHERE comment.issue_id=? ORDER BY `comment`.`created_unix` ASC, `comment`.`id` ASC []interface {}{17}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `uuid`, `issue_id`, `release_id`, `comment_id`, `name`, `download_count`, `created_unix` FROM `attachment` WHERE comment_id=? []interface {}{41}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `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`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{4}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `uuid`, `issue_id`, `release_id`, `comment_id`, `name`, `download_count`, `created_unix` FROM `attachment` WHERE comment_id=? []interface {}{42}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `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`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{4}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `user_id`, `issue_id`, `is_watching`, `created_unix`, `updated_unix` FROM `issue_watch` WHERE user_id = ? AND issue_id = ? LIMIT 1 []interface {}{4, 17}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 []interface {}{4, 1}
2017/11/13 15:07:55 [I] [SQL] SELECT `id`, `repo_id`, `type`, `index`, `config`, `created_unix` FROM `repo_unit` WHERE repo_id = ? []interface {}{1}

So as only Gogs until 0.9.146 is supported.. is there a way to "downgrade" the db schema to an supported one for 1.2.x?

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Nov 13, 2017
@lunny
Copy link
Member

lunny commented Nov 13, 2017

duplicated with #1794 I think

@lafriks
Copy link
Member

lafriks commented Nov 13, 2017

Try running sql insert to see if this fixes your issue:

insert into repo_unit ("repo_id", "type", "index", "config") 
select repository.id, types.*, '{}' from repository
left join repo_unit on repository.id=repo_id 
left join (
  select 1,1
  UNION ALL select 2,2
  UNION ALL select 3,3
  UNION ALL select 4,4
  UNION ALL select 5,5) as types on (1=1)
where repo_id is null; 

@dafes
Copy link
Author

dafes commented Nov 13, 2017

Tried the sql insert but this doesn´t work. Have no backuped everything and reinstalled from scratch.

@dafes dafes closed this as completed Nov 13, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

3 participants