GitHub 마이그레이션 문제 해결
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
GitHub에서 GitLab으로 프로젝트를 가져올 때 다음 문제가 발생할 수 있습니다. 일부 경우 GitHub 가져오기 프로세스에서 저장소 가져오기에 실패할 수 있습니다. 콘솔에서 다음 일련의 명령을 실행합니다: GitLab 16.5 이상에서 Import failed due to a GitHub error: (HTTP 406)라는 오류가 발생할 수 있습니다.
GitHub에서 GitLab으로 프로젝트를 가져올 때 다음 문제가 발생할 수 있습니다.
이전에 실패한 가져오기 프로세스 수동으로 계속하기#
일부 경우 GitHub 가져오기 프로세스에서 저장소 가져오기에 실패할 수 있습니다. 이로 인해 GitLab이 프로젝트 가져오기 프로세스를 중단하고 저장소를 수동으로 가져와야 합니다. 관리자는 실패한 가져오기 프로세스에 대해 저장소를 수동으로 가져올 수 있습니다:
-
Rails 콘솔을 엽니다.
-
콘솔에서 다음 일련의 명령을 실행합니다:
project_id = <PROJECT_ID> github_access_token = <GITHUB_ACCESS_TOKEN> github_repository_path = '/' github_repository_url = "https://#{github_access_token}@github.com/#{github_repository_path}.git" # Find project by ID project = Project.find(project_id) # Set import URL and credentials project.import_url = github_repository_url project.import_type = 'github' project.import_source = github_repository_path project.save! # Create an import state if the project was created manually and not from a failed import project.create_import_state if project.import_state.blank? # Set state to start project.import_state.force_start # Optional: If your import had certain optional stages selected or a timeout strategy # set, you can reset them here. Below is an example. # The params follow the format documented in the API: # https://docs.gitlab.com/api/import/#import-repository-from-github Gitlab::GithubImport::Settings .new(project) .write( timeout_strategy: "optimistic", optional_stages: { single_endpoint_issue_events_import: true, single_endpoint_notes_import: true, attachments_import: true, collaborators_import: true } ) # Trigger import from second step Gitlab::GithubImport::Stage::ImportRepositoryWorker.perform_async(project.id)
누락된 접두사로 인한 가져오기 실패#
GitLab 16.5 이상에서 Import failed due to a GitHub error: (HTTP 406)라는 오류가 발생할 수 있습니다.
이 문제는 GitLab 16.5에서 GitHub 가져오기 도구로부터 경로 접두사 api/v3가 제거되었기 때문에 발생합니다. 이는 가져오기 도구가 Gitlab::LegacyGithubImport::Client 사용을 중지했기 때문입니다. 이 클라이언트는 GitHub Enterprise URL에서 가져올 때 자동으로 api/v3 접두사를 추가했습니다.
이 오류를 해결하려면 GitHub Enterprise URL에서 가져올 때 api/v3 접두사를 추가하세요.
대형 프로젝트 가져오기 시 오류#
GitHub 가져오기 도구는 대형 프로젝트를 가져올 때 일부 오류가 발생할 수 있습니다.
누락된 댓글#
GitHub API에는 약 30,000개 이상의 노트 또는 diff 노트가 가져와지는 것을 방지하는 제한이 있습니다. 이 제한에 도달하면 GitHub API는 대신 다음 오류를 반환합니다:
In order to keep the API fast for everyone, pagination is limited for this resource. Check the rel=last link relation in the Link response header to see how far back you can traverse.
많은 수의 댓글이 있는 GitHub 프로젝트를 가져올 때 Use alternative comments import method 추가 가져오기 항목 체크박스를 선택합니다. 이 설정은 가져오기를 수행하는 데 필요한 네트워크 요청 수를 증가시키기 때문에 가져오기 프로세스가 더 오래 걸립니다.
GitLab 인스턴스가 GitHub에 연결할 수 없음#
GitLab 15.10 이하를 실행하는 GitLab Self-Managed 인스턴스가 프록시 뒤에 있는 경우 github.com 또는 api.github.com에 대한 DNS를 확인할 수 없습니다.
GitLab 인스턴스가 가져오기 중에 GitHub에 연결하지 못하고 로컬 요청 허용 목록에 github.com 및 api.github.com 항목을 추가해야 합니다.
