<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>47621</bug_id>
          
          <creation_ts>2023-09-16 18:53:29 +0300</creation_ts>
          <short_desc>http: invalid Host header при запуске с Docker</short_desc>
          <delta_ts>2024-03-21 23:00:04 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>gitlab-runner</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Evgeny Shesteperov">alimektor</reporter>
          <assigned_to name="bne@altlinux.org">bne</assigned_to>
          <cc>andy</cc>
    
    <cc>bne</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>233348</commentid>
    <comment_count>0</comment_count>
    <who name="Evgeny Shesteperov">alimektor</who>
    <bug_when>2023-09-16 18:53:29 +0300</bug_when>
    <thetext>Версия

- gitlab-runner-16.1.1-alt2

Предусловия

Установленные пакеты:

    # apt-get install -y  docker-engine docker-cli

Запустить сервис Docker:

    # systemctl enable --now docker &amp;&amp; sleep 5; systemctl status docker --no-pager -l

    $ cat .gitlab-ci.yml 
    build-job:
      stage: build
      script:
        - echo &quot;Hello, $GITLAB_USER_LOGIN!&quot;

    test-job1:
      stage: test
      script:
        - echo &quot;This job tests something. Current project dir is $CI_PROJECT_DIR&quot;

    test-job2:
      stage: test
      script:
        - echo &quot;This job tests something, but takes more time than test-job1.&quot;
        - echo &quot;After the echo commands complete, it runs the sleep command for 20 seconds&quot;
        - echo &quot;which simulates a test that runs 20 seconds longer than test-job1&quot;
        - sleep 20

    deploy-prod:
      stage: deploy
      script:
        - echo &quot;This job deploys something from the $CI_COMMIT_BRANCH branch.&quot;
      environment: production

Шаги воспроизведения

1.  Зарегистрировать новый Gitlab Runner без привязки по тегу:

        # gitlab-runner register --url &lt;URL&gt; --token &lt;TOKEN&gt;

2.  При запросе Enter the GitLab instance URL оставить по умолчанию.

3.  При запросе Enter a name for the runner. This is stored only in the
    local config.toml file ввести test-docker

4.  При запросе Enter an executor: kubernetes, parallels, ssh,
    docker+machine, shell, virtualbox, docker-autoscaler, instance,
    custom, docker, docker-windows ввести docker

5.  При запросе Enter the default Docker image ввести alt:p10

6.  Запустить Pipelines. В моём случае я просто делаю триггер:

    git commit -m &quot;Trigger&quot; --allow-empty; git push -f

Ожидаемый результат: успешно пройденный Pipelines.

Фактический результат: ошибка

    Running with gitlab-runner development version (HEAD)
      on test-docker ePq3W8uE5, system ID: s_bbb741e10f56
    Preparing the &quot;docker&quot; executor 00:29
    Using Docker executor with image alt:p10 ...
    Using helper image:  registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest
    Pulling docker image registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest ...
    Using docker image sha256:9ab1df015c0e63f25557060d6f85f0bdfc36969377bc3386e8202dde19fc93bf for registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest with digest registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper@sha256:9ce1f2b4d50a3a43b23890e322e3d9c1989c70b073ad54375367b1fc5344ae08 ...
    Pulling docker image alt:p10 ...
    Using docker image sha256:62a39dae75c8d838ab276d88806e5d2c13b0b753112b8946388bd1b70b8bf5bd for alt:p10 with digest alt@sha256:e9252bbd8730f12a12a4434ae6dd058ab542312c826e0ae16b312f3724697379 ...
    Preparing environment 00:00
    ERROR: Job failed (system failure): prepare environment: http: invalid Host header (exec.go:71:0s). Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

Я предполагаю, что это свежий баг в апстриме:

-   https://gitlab.com/gitlab-org/gitlab-runner/-/issues/36051</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>243330</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2024-03-21 23:00:04 +0300</bug_when>
    <thetext>gitlab-runner-16.9.1-alt1 -&gt; sisyphus:

 Wed Mar 20 2024 Nikolay Burykin &lt;bne@altlinux&gt; 16.9.1-alt1
 - New version 16.9.1
 - Fix:
   + &quot;/root/.bash_profile: Permission denied&quot; when use shell as an executor (ALT #47620)
   + failure prepare environment step, when use Docker as an executor (ALT #47621)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>