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

All releases lost upon upgrading from Gogs to Gitea-1.3.2 #3247

Closed
2 of 7 tasks
strk opened this issue Dec 21, 2017 · 17 comments
Closed
2 of 7 tasks

All releases lost upon upgrading from Gogs to Gitea-1.3.2 #3247

strk opened this issue Dec 21, 2017 · 17 comments

Comments

@strk
Copy link
Member

strk commented Dec 21, 2017

  • Gitea version (or commit ref):1.3.2
  • Git version: 1.7.10
  • Operating system: GNU/Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant (cannot test an upgrade there)

Description

Gogs used to show every tag in the Releases page, upon upgrade all those entries in Releases are gone. I've tried that removing all remote tags and re-pushing them is effective as a work-around, but it is crazy to do this for each and every repository we host.

@lafriks mentioned this synchronization should have happened at migration time but evidently it did not. How to fix now ? I think there should be an admin task to resynchronize those releases or we're stuck forever with this problem.

The problem may or may not be related to git version being < 1.8 - see #1133 (from #1133 (comment))

@lafriks
Copy link
Member

lafriks commented Dec 21, 2017

API method could be added as I don't see where could it be added in admin interface

@strk
Copy link
Member Author

strk commented Dec 21, 2017

I'm doing an ./gitea admin repo-sync-releases-with-tags command. Want to help with that ? I dont' see how am I supposed to get the engine from model, although admin calls models.SetEngine() I don't see any models.GetEngine() function..

@lunny
Copy link
Member

lunny commented Dec 21, 2017

That command should be help and seems it's easy to implementation.

@lunny
Copy link
Member

lunny commented Dec 21, 2017

@strk which version was your Gogs? Maybe you lost some migrations?

@lafriks
Copy link
Member

lafriks commented Dec 21, 2017

You need to call models function that does not require engine or create one

@strk
Copy link
Member Author

strk commented Dec 22, 2017 via email

@strk
Copy link
Member Author

strk commented Dec 22, 2017 via email

@strk
Copy link
Member Author

strk commented Dec 30, 2017

Working more on the PR adding an admin command to re-sync I found more problems: the function used by the migration supposed to synchronize repo tags with releases does not really work. Do you remember who changed the way releases were handled ?

@ethantkoenig
Copy link
Member

@strk I believe it was @lafriks: #2459

@strk
Copy link
Member Author

strk commented Dec 30, 2017

@lafriks can you check if things work for you ? Easy test:

  1. Create test repository
  2. Clone test repository locally (via commandline, from filesystem, not Gitea)
  3. Add a tag, push the tag locally (via commandline, to filesystem, not Gitea)
  4. Verify release tab does not show new tag
  5. Run the ./gitea admin repo-sync-releases command, check output

For me, the final step does not add any new release record in the database, while I believe your migration 42 (from which code in this PR is taken) was meant to do exactly that ?

@lafriks
Copy link
Member

lafriks commented Dec 31, 2017

@ethantkoenig @strk I fixed so that tags are actually displayed in release page and created that sync function but I was not one who broke displaying them in release page as before my PR tags would not be displayed in release page at all. I will try to reproduce your steps

@strk
Copy link
Member Author

strk commented Dec 31, 2017

I fixed so that tags are actually displayed in release page
before my PR tags would not be displayed in release page at all

I don't understand the above two statements. What did you fix ?
What do you expect to see now in releases page ?
Do you have a reference to a ticket describing the problem you (tried to) fix ?

@strk
Copy link
Member Author

strk commented Dec 31, 2017

self-answering the last question: previous ticket was #2154

strk added a commit to strk/gitea that referenced this issue Dec 31, 2017
Will help recovering corrupted database, see go-gitea#3247
lafriks pushed a commit that referenced this issue Dec 31, 2017
* Add repo-sync-releases admin command

Will help recovering corrupted database, see #3247

* Load repos in chunks of 10, exit with error if unable to get a list, scan private repos, fix typo

* Fix debug output about num releases

* Introduce RepositoryListDefaultPageSize constant, set to 64

Use it from the new admin command

* Use RepositoryListDefaultPageSize in more places

* Document RepositoryListDefaultPageSize
@lafriks
Copy link
Member

lafriks commented Dec 31, 2017

@strk can this be closed than?

@strk
Copy link
Member Author

strk commented Dec 31, 2017 via email

@stale
Copy link

stale bot commented Feb 9, 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 stale bot added the issue/stale label Feb 9, 2019
@lunny
Copy link
Member

lunny commented Feb 11, 2019

I'll close this one. Please feel free to reopen it.

@lunny lunny closed this as completed Feb 11, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants