Migration failure #14407

Closed
opened 2025-11-02 11:12:07 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @Luke-li-Chen on GitHub (Apr 24, 2025).

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

Originally created by @Luke-li-Chen on GitHub (Apr 24, 2025). ### 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](https://github.com/user-attachments/assets/71aae612-2fd1-4faa-a482-83ed073853a6) ### 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
GiteaMirror added the topic/repo-migrationtype/bugissue/needs-feedback labels 2025-11-02 11:12:07 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Apr 24, 2025):

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.

@wxiaoguang commented on GitHub (Apr 24, 2025): 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.
Author
Owner

@eeyrjmr commented on GitHub (Apr 24, 2025):

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

@eeyrjmr commented on GitHub (Apr 24, 2025): 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
Author
Owner

@lunny commented on GitHub (Apr 24, 2025):

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.

@lunny commented on GitHub (Apr 24, 2025): ~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.
Author
Owner

@Luke-li-Chen commented on GitHub (Apr 25, 2025):

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.

@Luke-li-Chen commented on GitHub (Apr 25, 2025): > 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.`
Author
Owner

@wxiaoguang commented on GitHub (Apr 25, 2025):

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" (https://github.com/go-gitea/gitea/issues/34280#issuecomment-2828118022)

@wxiaoguang commented on GitHub (Apr 25, 2025): > 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" (https://github.com/go-gitea/gitea/issues/34280#issuecomment-2828118022)
Author
Owner

@lunny commented on GitHub (Apr 25, 2025):

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.

@lunny commented on GitHub (Apr 25, 2025): > > 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14407