Error 404 and 403 on big update #1886

Closed
opened 2025-11-02 04:16:32 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @Chouchen on GitHub (Jun 6, 2018).

  • Gitea version (or commit ref): Gitea version 1.4.2 built with: bindata, sqlite (from binaries)
  • Operating system: debian 9.4
  • Git version: git version 2.11.0
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

2 kinds of error:

[...routers/repo/view.go:295 Home()] [E] Home: Cannot find any unit on this repository which you are allowed to access
[...ules/context/repo.go:691 func1()] [E] CheckUnit: You are not allowed to visit this repository unit: 1

Description

I migrated from Gogs a time ago with Gitea version 1.1.2 built with: bindata, sqlite and switched back to gogs afterwards for a moment.

Now, I want to fully migrate to Gitea, so, I reactivated this gitea which works well.

Then, I tried to upgrade to Gitea version 1.4.2 built with: bindata, sqlite by replacing the old binaries with the new one. Everything seems to work well for new repo but all the old ones gives 404 or 403.

My guess is this comes from the database ; as if some migrations were not done. Do I need to upgrade from version to version (like 1.1.2 -> 1.1.3 -> 1.1.4 -> 1.2.0 -> etc)?

Screenshots

firefox_2018-06-06_22-17-27

Originally created by @Chouchen on GitHub (Jun 6, 2018). - Gitea version (or commit ref): Gitea version 1.4.2 built with: bindata, sqlite (from binaries) - Operating system: debian 9.4 - Git version: git version 2.11.0 - Database: - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: 2 kinds of error: ``` [...routers/repo/view.go:295 Home()] [E] Home: Cannot find any unit on this repository which you are allowed to access [...ules/context/repo.go:691 func1()] [E] CheckUnit: You are not allowed to visit this repository unit: 1 ``` ## Description I migrated from Gogs a time ago with Gitea version 1.1.2 built with: bindata, sqlite and switched back to gogs afterwards for a moment. Now, I want to fully migrate to Gitea, so, I reactivated this gitea which works well. Then, I tried to upgrade to Gitea version 1.4.2 built with: bindata, sqlite by replacing the old binaries with the new one. Everything seems to work well for new repo but all the old ones gives 404 or 403. My guess is this comes from the database ; as if some migrations were not done. Do I need to upgrade from version to version (like 1.1.2 -> 1.1.3 -> 1.1.4 -> 1.2.0 -> etc)? ## Screenshots ![firefox_2018-06-06_22-17-27](https://user-images.githubusercontent.com/383673/41062998-e6377e08-69c6-11e8-81d0-3f7cac82fe5f.png)
GiteaMirror added the type/question label 2025-11-02 04:16:32 -06:00
Author
Owner

@lafriks commented on GitHub (Jun 8, 2018):

Yes, when upgrading from gogs upgrade path should be gogs -> 1.0.2 -> 1.1.4 -> 1.2.3 -> 1.3.4 -> 1.4.2

This error can be related to: https://github.com/go-gitea/gitea/issues/1794#issuecomment-348717495

@lafriks commented on GitHub (Jun 8, 2018): Yes, when upgrading from gogs upgrade path should be `gogs -> 1.0.2 -> 1.1.4 -> 1.2.3 -> 1.3.4 -> 1.4.2` This error can be related to: https://github.com/go-gitea/gitea/issues/1794#issuecomment-348717495
Author
Owner

@Chouchen commented on GitHub (Jun 8, 2018):

I guess I did gogs → 1.0.2 → 1.1.2 back then. So I'll try migrating from 1.1.2 → 1.1.4 → 1.2.3 → 1.3.4 → 1.4.2.

Is there any documentation about those steps? I didn't see it anywhere.

I tried the SQL query from that comment and the ones above id and it didn't work (mysql error for missing fields or syntax).

@Chouchen commented on GitHub (Jun 8, 2018): I guess I did `gogs → 1.0.2 → 1.1.2` back then. So I'll try migrating from `1.1.2 → 1.1.4 → 1.2.3 → 1.3.4 → 1.4.2`. Is there any documentation about those steps? I didn't see it anywhere. I tried the SQL query from that comment and the ones above id and it didn't work (mysql error for missing fields or syntax).
Author
Owner

@Chouchen commented on GitHub (Jun 8, 2018):

Alright, first of all, it must be 1.3.3 instead of 1.3.4 (which doesn't exist).

But anyway, from 1.1.4 (which works) to 1.2.3, I got the same error. My test repository goes 404 :(

@Chouchen commented on GitHub (Jun 8, 2018): Alright, first of all, it must be 1.3.3 instead of 1.3.4 (which doesn't exist). But anyway, from 1.1.4 (which works) to 1.2.3, I got the same error. My test repository goes 404 :(
Author
Owner

@Chouchen commented on GitHub (Jun 8, 2018):

OK, running https://github.com/go-gitea/gitea/issues/1794#issuecomment-347831784 made it works on 1.2.3. Continuing the migration process…

@Chouchen commented on GitHub (Jun 8, 2018): OK, running https://github.com/go-gitea/gitea/issues/1794#issuecomment-347831784 made it works on 1.2.3. Continuing the migration process…
Author
Owner

@Chouchen commented on GitHub (Jun 8, 2018):

Alright, other migrations went well afterwards. I have to repo with error 500 which is not associated with this ticket.

My question here is still relevant. It would have save me a lot of time…

@Chouchen commented on GitHub (Jun 8, 2018): Alright, other migrations went well afterwards. I have to repo with error 500 which is not associated with this ticket. My question [here](https://github.com/go-gitea/gitea/issues/4163#issuecomment-395688369) is still relevant. It would have save me a lot of time…
Author
Owner

@lafriks commented on GitHub (Jun 8, 2018):

No there is not but it would be great if you could update gogs -> gitea migration manual in docs and submit PR, any help with docs are really appreciated.

@lafriks commented on GitHub (Jun 8, 2018): No there is not but it would be great if you could update gogs -> gitea migration manual in docs and submit PR, any help with docs are really appreciated.
Author
Owner

@Chouchen commented on GitHub (Jan 11, 2019):

The documentation has been added.

@Chouchen commented on GitHub (Jan 11, 2019): The documentation has been added.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1886