Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone of Azure devops git repo not working with private repositories #2994

Open
ittacco opened this issue Sep 12, 2024 · 2 comments · May be fixed by #2996
Open

Clone of Azure devops git repo not working with private repositories #2994

ittacco opened this issue Sep 12, 2024 · 2 comments · May be fixed by #2996

Comments

@ittacco
Copy link

ittacco commented Sep 12, 2024

Environment

Device and OS: Windows 10/Linux
App version: 0.39.0

Steps to reproduce

run zarf package create using the following zarf file:

kind: ZarfPackageConfig
metadata:
  name: git-data
  version: 0.0.1
  description: Demo Zarf loading resources into a gitops service
components:
  - name: full-repo
    repos:
      - https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb

Expected result

zarf package created

Actual Result

$ ./zarf_v0.39.0_Windows_amd64.exe package create . --confirm

 NOTE  Saving log file to
       C:\Users\Lorenzo\AppData\Local\Temp\zarf-2024-09-12-19-48-11-3623942437.log
 NOTE  Using build directory .

  📦 PACKAGE DEFINITION

kind: ZarfPackageConfig

metadata:  information about this package
  name: git-data
  description: Demo Zarf loading resources into a gitops service
  version: 0.0.1
  architecture: amd64
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
components:  components selected for this operation
- name: full-repo
  repos:
  - https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✔  Create Zarf package confirmed

  📦 FULL-REPO COMPONENT

  ⠸  Loading 1 git repos (1s)
 NOTE  Falling back to host 'git', failed to clone the repo
       "https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb" with Zarf:
       authentication required
  ⠴  Loading 1 git repos (3s)
     **ERROR:  failed to create package: unable to add component "full-repo": unable to pull git repo
             https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb: authentication
             required**

[zarf-2024-09-12-19-48-11-3623942437.log](https://github.com/user-attachments/files/16983683/zarf-2024-09-12-19-48-11-3623942437.log)

### Additional Context
Cloning the repository directly works, since credentials are stored in credential manager

With zarf version 0.36.1 is working properly:

$ ./zarf_v0.36.1_Windows_amd64.exe package create . --confirm

 NOTE  Saving log file to C:\Users\Lorenzo\AppData\Local\Temp\zarf-2024-09-12-19-45-55-282772647.log
 NOTE  Using build directory .

  📦 PACKAGE DEFINITION

kind: ZarfPackageConfig
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
metadata:  information about this package
  name: git-data
  description: Demo Zarf loading resources into a gitops service
  version: 0.0.1
  architecture: amd64
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
components:  components selected for this operation

- name: full-repo
  repos:
  - https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✔  Create Zarf package confirmed

  📦 FULL-REPO COMPONENT

 Processing git repo https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_  ⠋  Processing git repo https://lorenzotacconi1967.visualstudio.com/Mqtt2Influx  ⠙  Processing git repo https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb (0s)
 NOTE  Falling back to host 'git', failed to clone the repo
       "https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb" with Zarf:
       authentication required
$ git clone --origin online-upstream https://lorenzotacconi1967.visualstudio.com/Mqtt2InfluxDb/_git/Mqtt2InfluxDb C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\components\full-repo\repos/Mqtt2InfluxDb-2212667166
  ⠙  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠹  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠸  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠼  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠴  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠦  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠧  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠇  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\components\full-repo\repos/Mqtt2InfluxDb-2212667166'... (2s)$ git fetch --tags --update-head-ok online-upstream refs/*:refs/*
  ⠏  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠋  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠙  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠹  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ⠸  Cloning into 'C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740\component  ✔  Loading 1 git repos
  ✔  Creating SBOMs for 0 images and 0 components with files.
  ⠋  Writing C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740 to zarf-package  ⠋  Wrote C:\Users\Lorenzo\AppData\Local\Temp\zarf-1434688740 to zarf-package-g  ✔  Package saved to "zarf-package-git-data-amd64-0.0.1.tar.zst"

@phillebaba
Copy link
Member

phillebaba commented Sep 13, 2024

I am trying to understand what is wrong with the actual result. Is the problem that the package is not being created? In the logs you provided it seems like the package was created.

I do see that the initial git clone is failing with credential issues but then the fallback seems to work.

ittacco added a commit to ittacco/zarf that referenced this issue Sep 14, 2024
fix: Clone of Azure devops git repo not working with private repositories

Refs: zarf-dev#2994
@ittacco ittacco linked a pull request Sep 14, 2024 that will close this issue
2 tasks
@ittacco
Copy link
Author

ittacco commented Sep 14, 2024 via email

ittacco added a commit to ittacco/zarf that referenced this issue Nov 9, 2024
fix: Clone of Azure devops git repo not working with private repositories

Refs: zarf-dev#2994
Signed-off-by: ittacco <lorenzo.tacconi1967@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage
Development

Successfully merging a pull request may close this issue.

2 participants