Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 3.5k
    • Issues 3.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 95
    • Merge requests 95
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #27016
Closed
Open
Issue created Sep 21, 2020 by lbouquinUniv@lbouquinUniv

kaniko unautorized

Summary

kaniko work when I used a kubernetes gitlab-runner but not working with a runner in VM.

Steps to reproduce

Create helm gitlab-runner with url add token value. Create a runner with gitlagb-runner register ( runner -> docker default ubuntu:18.04 ) Create a project and include the following code:

Build App:
  stage: build_dev
  tags:
    - test34
  image:
    name: gcr.io/kaniko-project/executor:$KANIKO_VERSION
    entrypoint: [""]
  script:
    - mkdir -p /root/.docker
    - echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$TESTHTTPD_ROBOT_USERNAME\",\"password\":\"$TESTHTTPD_ROBOT_PASSWORD\"}}}" > /root/.docker/config.json
    - cat /root/.docker/config.json 
    - /kaniko/executor --skip-tls-verify-pull  --verbosity debug --skip-tls-verify --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Docker/Dockerfile --destination $DOCKER_REGISTRY/$DOCKER_REGISTRY_PROJET/$DOCKER_REGISTRY_IMAGE:$TAG_IMAGE_DEV --destination $DOCKER_REGISTRY/$DOCKER_REGISTRY_PROJET/$DOCKER_REGISTRY_IMAGE:dev-latest
  only:
    refs:
      - dev
    changes:
      - Docker/**/*
      - Sources/**/*

test with tag correspond to gitlab-runner register by VM. -> doesn't work test with tag correspond to kubernetes register -> work.

Example Project

What is the current bug behavior?

not working with gitlab-runner register.

What is the expected correct behavior?

working

Relevant logs and/or screenshots

EBU[0000] Copying file /builds/app-ci/swe/test-httpd/Docker/Dockerfile to /kaniko/Dockerfile 
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "https://my_registry.co/test-httpd/test-httpd:dev-b0ad05ff": POST https://my_registry.co/v2/test-httpd/test-httpd/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:test-httpd/test-httpd Type:repository] map[Action:push Class: Name:test-httpd/test-httpd Type:repository]]
  • DOCKER_REGISTRY_PROJET => test-httpd
  • DOCKER_REGISTRY_IMAGE => test-httpd

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited Sep 21, 2020 by Hordur Freyr Yngvason
Assignee
Assign to
Time tracking