Skip to content

Migration failure #34280

Closed
Closed
@Luke-li-Chen

Description

@Luke-li-Chen

Description

I tried to migrate a git repository from a bare git server to gitea, (both are on my LAN). I use the feature "Migrate a repository only from any Git service.", but it failed, and the gitea webpage shows that:

Migrating from git://10.42.1.55/Obj.268.git failed.

migration failed: clone error: exit status 128 - fatal: 
unable to look up luke:xxxxxx@10.42.1.55 (port 9418)
 (Name does not resolve)

The gitea container log shows that:

2025/04/24 21:24:28 ...ices/task/migrate.go:60:func1() [E] runMigrateTask[3] by DoerID[1] to RepoID[4] for OwnerID[1] failed: migration failed: clone error: exit status 128 - fatal: unable to look up luke:xxxxxx@10.42.1.55 (port 9418) (Name does not resolve)
2025/04/24 21:24:28 ...ervices/task/task.go:53:handler() [E] Run task failed: migration failed: clone error: exit status 128 - fatal: unable to look up luke:xxxxxx@10.42.1.55 (port 9418) (Name does not resolve)

The source git server (10.42.1.55) does not run any services like gitlab, gitea, only git and git-daemon.
I have added

[migrations]       
ALLOWED_DOMAINS = 127.0.0.1, 10.42.1.55
ALLOW_LOCALNETWORKS = true 

to /data/gitea/conf/app.ini.

What should I do to achieve a successful migration?

Thank you very much.

Gitea Version

1.23.7

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Git Version

2.47.2

Operating System

AlmaLinux 9.5

How are you running Gitea?

I run from docker 28.1.1, the docker-compose.yml file is:

version: '3.9'

services:
  server:
    container_name: gitea
    image: gitea/gitea:1.23.7
    ports:
      - "3000:3000"
      - "222:22"
    networks:
      - gitea
    volumes:
      - ~/Docker_Data/Gitea/gitea_data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea_db
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=xxxxxx
    restart: always
    depends_on:
      - db

  db:
    container_name: postgres_ea
    image: postgres:17.4
    ports:
      - '5432:5432'
    networks:
      - gitea
    volumes:
      - ~/PGdata:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=xxxxxx
      - POSTGRES_DB=gitea_db
    # restart: always

networks:
  gitea:
    external: false

Database

PostgreSQL

Activity

added
topic/repo-migrationMigrate repos from other platforms to Gitea, or from Gitea to them
on Apr 24, 2025
wxiaoguang

wxiaoguang commented on Apr 24, 2025

@wxiaoguang
Contributor

How do you serve that git repo? Usually it should be ssh://git@server/repo.git or http://server/repo.git, are you sure git://10.42.1.55/Obj.268.git is right?


IIRC only http://server/repo.git is supported.

added
issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail
on Apr 24, 2025
eeyrjmr

eeyrjmr commented on Apr 24, 2025

@eeyrjmr
Contributor

if it is just a bare repository, you could copying it into the gitea-repositories directory (some subdirectory as you see fit) and from the admin webui "adopt" the bare repository

lunny

lunny commented on Apr 24, 2025

@lunny
Member

Only http/https should have been supported at the moment.

http/https/git should have been supported but the problem is the DNS or network.

Luke-li-Chen

Luke-li-Chen commented on Apr 25, 2025

@Luke-li-Chen
Author

How do you serve that git repo? Usually it should be ssh://git@server/repo.git or http://server/repo.git, are you sure git://10.42.1.55/Obj.268.git is right?

IIRC only http://server/repo.git is supported.

When I use a ssh:// url, the webpage said that:
The provided URL is invalid. Only http(s):// or git:// locations can be used for mirroring.

wxiaoguang

wxiaoguang commented on Apr 25, 2025

@wxiaoguang
Contributor

git:// locations can be used for mirroring.

IIRC "git" is for a local repo on local system only. I do not think it is well supported or should be used.

So you still need to use "http" or "https", or just use "adopt" (#34280 (comment))

lunny

lunny commented on Apr 25, 2025

@lunny
Member

How do you serve that git repo? Usually it should be ssh://git@server/repo.git or http://server/repo.git, are you sure git://10.42.1.55/Obj.268.git is right?
IIRC only http://server/repo.git is supported.

When I use a ssh:// url, the webpage said that: The provided URL is invalid. Only http(s):// or git:// locations can be used for mirroring.

Protocol ssh haven't been supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detailtopic/repo-migrationMigrate repos from other platforms to Gitea, or from Gitea to themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lunny@wxiaoguang@eeyrjmr@Luke-li-Chen@kemzeb

        Issue actions

          Migration failure · Issue #34280 · go-gitea/gitea