Skip to content

Failed migration leaves database in a bad state #7039

@rfwatson

Description

@rfwatson
  • Gitea version (or commit ref): df255783
  • Git version: 2.17.1
  • Operating system: Linux x86_64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:

Description

Failed migration does not rollback database properly.

To recreate:

  1. Visit https://try.gitea.io/repo/migrate
  2. Enter clone URL https://github.com/nope/nope.git and repo name nope
  3. Leave clone authentication blank
  4. Submit form

**Expected behaviour: **

See error message Authentication failed: Clone: exit status 128 - fatal: could not read Username for 'https://github.com': No such device or address and no repo is created in the database

Actual behaviour

Error message above is displayed but an empty repo is also created in the database, shows on the user's profile and generates a 500 when visited.

Note that deleting the repo from the DB is not enough to clean this up, there are also entries in the action table too (and possibly elsewhere)

Screenshots

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions