importing projects in batch using terraform provider fails

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Bug Report

When importing more than 5 projects using terraform provider this results in an error message. The size of the project to import is about 9MB.

Error: error while waiting for project "clone-8" import to finish: unexpected state 'failed', wanted target 'finished'. last error: %!s(\<nil\>)

Loop import via Gitlab-API works fine.

Relevant Terraform Configuration

terraform {
  required_providers {
    gitlab = {
      source  = "gitlabhq/gitlab"
      version = "17.7.1"
    }
  }
}

provider "gitlab" {
  base_url = "https://gitlaburl/api/v4"
}

variable "Number" {
  type = string
}


resource "gitlab_project" "example" {
  provider                        = gitlab
  count                           = var.Number
  name                            = "clone-template-${count.index + 1}"
  namespace_id                    = 34
  description                     = "ALM repository of project tenant"
  use_custom_template             = true
  group_with_project_templates_id = 35
  template_name                   = "ALM-TEMPLATE"
  visibility_level                = "private"
  shared_runners_enabled          = true
  lfs_enabled                     = false
  archive_on_destroy              = false
}

Relevant Terraform Command

export TF_VAR_Number=8
terraform plan -out tf.plan
terraform apply 

Relevant Log Output

These are the debug logs of the `terraform` command output:

Additional Details

  • GitLab Terraform Provider Version: 17.7.1
  • GitLab Instance Version: v17.8.1-ee
  • Terraform Version: Terraform v1.10.4
Edited by 🤖 GitLab Bot 🤖