portainer: Git Authentication not works in Portainer 1.19.1

Bug description

Git Authentication not works in Portainer 1.19.1

Expected behavior In a swarm environment the stack creation of a yml file hosted in a git repository doesn’t work. The GUI shows a error in upper right corner e in the logs it’s showed:

2018/07/17 11:00:27 Starting Portainer 1.19.1 on :9000 2018/07/17 11:01:28 http error: Unable to clone git repository (err=repository already exists) (code=500)

The username and password are correct.

Briefly describe what you were expecting.

Steps to reproduce the issue:

Briefly describe what you were expecting.

Steps to reproduce the issue:

Steps to reproduce the behavior:

  1. Go to stacks/Add Stack/git Repository
  2. Enter Repository URL, Compose Path, Username ad Password.
  3. SClick Deploy the Stack
  4. See error

Technical details:

  • Portainer version: 1.19.1
  • Docker version (managed by Portainer): 18.03.0-ce, build 0520e24
  • Platform (windows/linux):linux
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer):

docker stack deploy --prune --compose-file /gfs/docker-compose/portainer.yml portainer --with-registry-auth

where /gfs/dc/portainer.yml is:

version: ‘3’

services:

portainer: image: portainer/portainer:latest ports:

  • “9000:9000” volumes:
  • /etc/hosts:/etc/hosts
  • /gfs/portainer:/data
  • Browser:

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (10 by maintainers)

Commits related to this issue

Most upvoted comments

The extra step in order to reproduce this might have been “have two factor authentication enabled” on the private repo. I have it enabled and when I try to create a stack, I get “Deployment error, authentication required” even though I specified the correct user and password.

I was able to clone a private repo with two factor enabled by generating a personal access token and using it instead of my password.

  1. https://github.com/settings/tokens
  2. Generate New Token button
  3. image