S
S
Steve2021-08-30 13:24:41
Amazon Web Services
Steve, 2021-08-30 13:24:41

Error while testing: Preparation failed: exit status 1?

I installed the runner on AWS EC2, set up the configuration (shown below), but the tests in CI / CD fail:

Preparing the "docker+machine" executor
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Job failed (system failure): exit status 1


.gitlab-ci.yml on gitlab server
image: php:7.4

# Cache libraries in between jobs
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/

before_script:
  - apt-get update -yqq
  - apt-get install -yqq git libzip-dev libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
  # Install PHP extensions
  - docker-php-ext-install exif pdo_pgsql pgsql curl json intl gd xml zip bz2 opcache
  # Install & enable Xdebug for code coverage reports
  - pecl install xdebug
  - docker-php-ext-enable xdebug
  # Install and run Composer
  - curl --show-error --silent "https://getcomposer.org/installer" | php
  - php composer.phar install

UnitTest:
  script:
    - phpdbg -d memory_limit=-1 -qrr vendor/bin/phpunit --config=phpunit.xml.dist
    - XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text --colors=never --configuration phpunit.xml.dist


My /etc/gitlab-runner/config.toml on aws server

  name = "unit-test"
  url = "https://gitlab.com/"
  token = "xxx"
  executor = "docker+machine"
  limit = 8
  [runners.docker]
    tls_verify = false
    image = "php:7.4"
    privileged = true
    disable_cache = true
    shm_size = 0
  [runners.cache]
    Type = "s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "s3.amazonaws.com"
      AccessKey = "xxx"
      SecretKey = "xxx"
      BucketName = "s3-cache-xxx"
      BucketLocation = "us-east-2"
  [runners.machine]
    MachineDriver = "amazonec2"
    MachineName = "gitlab-ci-machine-%s"
    OffPeakTimezone = ""
    OffPeakIdleCount = 0
    OffPeakIdleTime = 0
    IdleCount = 0
    MachineOptions = [
      "amazonec2-access-xxx",
      "amazonec2-secret-key=xxx",
      "amazonec2-region=us-east-2",
      "amazonec2-vpc-id=vpc-904561f8",
      "amazonec2-subnet-id=subnet-38e71c15",
      "amazonec2-zone=a",
      "amazonec2-use-private-address=true",
      "amazonec2-tags=unit-test",
      "amazonec2-security-group=launch-wizard-2",
      "amazonec2-instance-type=t2.micro",
      "amazonec2-request-spot-instance=true",
      "amazonec2-spot-price=0.05",
      "amazonec2-block-duration-minutes=60"
    ]


And when I run tests on aws server (gitlab-runner exec docker UnitTest) it throws an error
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
WARNING: You most probably have uncommitted changes. 
WARNING: These changes will not be tested.         
fatal: not a git repository (or any of the parent directories): .git
FATAL: exit status 128

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question