Gitbucket Releases migration - PANIC whilst trying to do migrate task: runtime error: invalid memory address or nil pointer dereference #14744

Closed
opened 2025-11-02 11:21:48 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @blazej222 on GitHub (Jul 11, 2025).

Description

When trying to migrate a repository from gitbucket to gitea, it fails on Releases step with PANIC whilst trying to do migrate task: runtime error: invalid memory address or nil pointer dereference.

The repo itselfs imports fine, but the problem occurs when trying to import Releases.

Steps to reproduce:

  1. Create docker compose the same as the one I included into this report.
  2. Create an empty repo on gitbucket.
  3. Create a simple test git repo with a single file and a single commit, add a Tag and push it to gitbucket
  4. On gitbucket create a release - attach any random .zip file to the release
  5. Try to migrate the repo to gitea with all options checked (LFS,Wiki,Releases,Labels etc.....)
  6. PANIC whilst trying to do migrate task: runtime error: invalid memory address or nil pointer dereference occurs.

Gitea Version

1.24.2 built with GNU Make 4.4.1, go1.24.4 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/blazej222/6e24e4a49bcd34811054842556adff03

Screenshots

No response

Git Version

2.49.0

Operating System

Windows with Docker

How are you running Gitea?

Docker image, here's the whole docker compose

services:
  db:
    image: postgres:16
    container_name: gitea-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: gitea
      POSTGRES_USER: gitea
      POSTGRES_PASSWORD: xxx
    volumes:
      - ./postgres:/var/lib/postgresql/data
    networks:
      - gitea-net

  gitea:
    image: gitea/gitea:latest
    container_name: gitea
    restart: unless-stopped
    environment:
      DB_TYPE: postgres
      DB_HOST: db:5432
      DB_NAME: gitea
      DB_USER: gitea
      DB_PASSWD: xxx
    volumes:
      - ./gitea:/data
    ports:
      - "3000:3000"  
      - "222:22"   
    networks:
      - gitea-net
    depends_on:
      - db
  gitbucket:
    image: gitbucket/gitbucket:latest
    container_name: gitbucket
    ports:
      - "8080:8080"  
    volumes:
      - ./gitbucket:/gitbucket
    environment:
      - GITBUCKET_HOME=/gitbucket
    restart: unless-stopped
    networks:
      - gitea-net

volumes:
  gitea-db-data:
  gitea-data:

networks:
  gitea-net:
    driver: bridge

Database

PostgreSQL

Originally created by @blazej222 on GitHub (Jul 11, 2025). ### Description When trying to migrate a repository from gitbucket to gitea, it fails on Releases step with `PANIC whilst trying to do migrate task: runtime error: invalid memory address or nil pointer dereference`. The repo itselfs imports fine, but the problem occurs when trying to import Releases. Steps to reproduce: 1. Create docker compose the same as the one I included into this report. 2. Create an empty repo on gitbucket. 3. Create a simple test git repo with a single file and a single commit, add a Tag and push it to gitbucket 4. On gitbucket create a release - attach any random .zip file to the release 5. Try to migrate the repo to gitea with all options checked (LFS,Wiki,Releases,Labels etc.....) 6. PANIC whilst trying to do migrate task: runtime error: invalid memory address or nil pointer dereference occurs. ### Gitea Version 1.24.2 built with GNU Make 4.4.1, go1.24.4 : bindata, timetzdata, sqlite, sqlite_unlock_notify ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://gist.github.com/blazej222/6e24e4a49bcd34811054842556adff03 ### Screenshots _No response_ ### Git Version 2.49.0 ### Operating System Windows with Docker ### How are you running Gitea? Docker image, here's the whole docker compose ``` services: db: image: postgres:16 container_name: gitea-db restart: unless-stopped environment: POSTGRES_DB: gitea POSTGRES_USER: gitea POSTGRES_PASSWORD: xxx volumes: - ./postgres:/var/lib/postgresql/data networks: - gitea-net gitea: image: gitea/gitea:latest container_name: gitea restart: unless-stopped environment: DB_TYPE: postgres DB_HOST: db:5432 DB_NAME: gitea DB_USER: gitea DB_PASSWD: xxx volumes: - ./gitea:/data ports: - "3000:3000" - "222:22" networks: - gitea-net depends_on: - db gitbucket: image: gitbucket/gitbucket:latest container_name: gitbucket ports: - "8080:8080" volumes: - ./gitbucket:/gitbucket environment: - GITBUCKET_HOME=/gitbucket restart: unless-stopped networks: - gitea-net volumes: gitea-db-data: gitea-data: networks: gitea-net: driver: bridge ``` ### Database PostgreSQL
GiteaMirror added the type/bugissue/workaround labels 2025-11-02 11:21:49 -06:00
Author
Owner

@blazej222 commented on GitHub (Jul 11, 2025):

Forgot to mention I added the following into app.ini

[migrations]
ALLOW_LOCALNETWORKS = true
SKIP_TLS_VERIFY = true
ALLOWED_DOMAINS = *
BLOCKED_DOMAINS = 
@blazej222 commented on GitHub (Jul 11, 2025): Forgot to mention I added the following into `app.ini` ``` [migrations] ALLOW_LOCALNETWORKS = true SKIP_TLS_VERIFY = true ALLOWED_DOMAINS = * BLOCKED_DOMAINS = ```
Author
Owner

@wxiaoguang commented on GitHub (Jul 11, 2025):

It seems that you chose "github" downloader, does it work for gitbucket?

@wxiaoguang commented on GitHub (Jul 11, 2025): It seems that you chose "github" downloader, does it work for gitbucket?
Author
Owner

@blazej222 commented on GitHub (Jul 11, 2025):

I chose "gitbucket" downloader on the site - I am 100% sure of that and I was able to reproduce it every time by using the steps I described. When you choose "github" downloader it asks you for access token, but when you select "gitbucket" downloader it asks you for a login and password.

I was also surprised to see that stack trace mentioned github.go, but I assumed it's because gitbucket claims to implement the same API as github.

The problem must be connected somehow with Releases, because when I try to import repo without releases, everything works fine.

So I am 100% positive it does NOT work for gitbucket.

@blazej222 commented on GitHub (Jul 11, 2025): I chose "gitbucket" downloader on the site - I am 100% sure of that and I was able to reproduce it every time by using the steps I described. When you choose "github" downloader it asks you for access token, but when you select "gitbucket" downloader it asks you for a login and password. I was also surprised to see that stack trace mentioned `github.go`, but I assumed it's because gitbucket claims to implement the same API as github. The problem must be connected somehow with Releases, because when I try to import repo without releases, everything works fine. So I am 100% positive it does **NOT** work for gitbucket.
Author
Owner

@wxiaoguang commented on GitHub (Jul 11, 2025):

OK, let's skip this "assets downloading" then no panic.

A simple fix, so #35046 together

@wxiaoguang commented on GitHub (Jul 11, 2025): OK, let's skip this "assets downloading" then no panic. A simple fix, so #35046 together
Author
Owner

@wxiaoguang commented on GitHub (Jul 11, 2025):

By the way, as a workaround, you can skip the "releases", then there should be no panic.

It seems that GitHub API doesn't work with GitBucket's "releases"

@wxiaoguang commented on GitHub (Jul 11, 2025): By the way, as a workaround, you can skip the "releases", then there should be no panic. It seems that GitHub API doesn't work with GitBucket's "releases"
Author
Owner

@blazej222 commented on GitHub (Jul 11, 2025):

By the way, as a workaround, you can skip the "releases", then there should be no panic.

It seems that GitHub API doesn't work with GitBucket's "releases"

That's essentially what I did today, as the repos I was migrating didn't have that many releases (maybe 10-20 per repo), so I just imported them without releases and then manually recreated those releases on Gitea.

Still, I suppose it could be a problem when migrating multiple repos that have, let's say 100 releases per repo, so I reported this issue here 😄

@blazej222 commented on GitHub (Jul 11, 2025): > By the way, as a workaround, you can skip the "releases", then there should be no panic. > > It seems that GitHub API doesn't work with GitBucket's "releases" That's essentially what I did today, as the repos I was migrating didn't have that many releases (maybe 10-20 per repo), so I just imported them without releases and then manually recreated those releases on Gitea. Still, I suppose it could be a problem when migrating multiple repos that have, let's say 100 releases per repo, so I reported this issue here 😄
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14744