Gitea: Repos not showing properly under dashboard after migration from Gogs

Created on 10 Jul 2020  ·  5Comments  ·  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.12.1
  • Git version: 2.26.0
  • Operating system: OpenSUSE Tumbleweed
  • Database (use [x]):

    • [ ] PostgreSQL

    • [x] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [x] No

    • [ ] Not relevant

  • Log gist:
    tail -n 10 log/gitea.log
2020/07/10 15:44:14 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `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`, `is_restricted`, `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`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 [plugin] - 5.903063ms
2020/07/10 15:44:14 routers/repo/http.go:104:HTTP() [E] GetUserByName: user does not exist [uid: 0, name: plugin, keyid: 0]
2020/07/10 15:44:14 routers/repo/http.go:104:HTTP() [E] GetUserByName: user does not exist [uid: 0, name: plugin, keyid: 0]
2020/07/10 15:44:18 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND updated_unix < ?) AND status = ? GROUP BY user_id [1594395846 1594395856 1] - 7.720299ms
2020/07/10 15:44:24 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `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`, `is_restricted`, `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`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 [plugin] - 6.10551ms
2020/07/10 15:44:24 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `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`, `is_restricted`, `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`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`=? LIMIT 1 [plugin] - 6.494937ms
2020/07/10 15:44:24 routers/repo/http.go:104:HTTP() [E] GetUserByName: user does not exist [uid: 0, name: plugin, keyid: 0]
2020/07/10 15:44:24 routers/repo/http.go:104:HTTP() [E] GetUserByName: user does not exist [uid: 0, name: plugin, keyid: 0]
2020/07/10 15:44:28 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND updated_unix < ?) AND status = ? GROUP BY user_id [1594395856 1594395866 1] - 8.035351ms
2020/07/10 15:44:38 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT user_id, count(*) AS count FROM notification WHERE user_id IN (SELECT user_id FROM notification WHERE updated_unix >= ? AND updated_unix < ?) AND status = ? GROUP BY user_id [1594395866 1594395876 1] - 6.482281ms

Description

I am in the process of migrating my Gogs instance to Gitea. I updated all of the relevant config files (I think) and started on Gitea 1.0.2 and once I made sure everything worked I ran every major version up to 1.12.1. Everything worked fine except one thing: On my dashboard on 1.12.1 my repo count is correct but they aren't showing. This issue isn't present on 1.11.6

Screenshots

1.11.6:
1.11.16 example

1.12.1:
1.12.1 example

Most helpful comment

I was able to resolve the problem by running UPDATE repository SET is_archived=false;

All 5 comments

I actually just finished the same upgrade and I notice that toggling the “Archive” checkbox under the filter icon on and off works. Can’t get it to stay consistently though.

@ryan77627 could you visit the repositories home page directly?

I was able to resolve the problem by running UPDATE repository SET is_archived=false;

@lunny Do you mean the explore page with all the repos? In that case yes, that page works just fine, it's just what's shown in the screenshots above with the issue.

@awkspace I tried your solution and it did indeed work. I guess that flag isn't being set or migrated properly, because I made a new repo in the meantime before I did the fix and it was showing up just fine. I ran the query and got the following response:
New Image

So it's definitely a migration issue if 3 of 4 repos were affected (three were the old ones, the fourth was the new one made after the migration)

Thanks @awkspace for finding this!

Thank you!

MariaDB [(none)]> USE gitea;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [gitea]> UPDATE repository SET is_archived=false;
Query OK, 16 rows affected (0.070 sec)
Rows matched: 16  Changed: 16  Warnings: 0

MariaDB [gitea]>

Works now, finally. 🎉

Was this page helpful?
0 / 5 - 0 ratings