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

Semantic-Release can't access to Azure DevOps OnPrem server Git - fatal: Authentication failed #3211

Open
andy-mishechkin opened this issue Mar 1, 2024 · 0 comments

Comments

@andy-mishechkin
Copy link

andy-mishechkin commented Mar 1, 2024

Current behavior

We have the OnPrem Azure DevOps server and try to use the semantic release in Azure Pipelines. Our Azure DevOps server work over http (not https).
I've tried to create semantic-release step based on this article: https://www.eriklieben.com/posts/semantic-release-nuget/ and semantic-release-ado plugin description: https://github.com/lluchmk/semantic-release-ado. For authentication I've used the GIT_CREDENTIALS environment variable with $(System.AccessToken) value and custom generated PAT (and without any GIT_CREDENTIALS variable). In any case I've got the authentication error: fatal: Authentication failed (full log provided bellow in this post)

Semanti-release step in Azure DevOps pipeline definition:

- script: |
      npx semantic-release --debug
  env: 
      GIT_CREDENTIALS: $(System.AccessToken)
  displayName: 'Semantic release'
  enabled: true

package.json of our project:

{
  "name": "our-angular-project",
  "version": "0.0.0-0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "ci": "npm ci"
  },
  "private": true,
  "engines": {
    "node": "18.17.0",
    "npm": "10.2.1"
  },
  "dependencies": {
    "@angular/animations": "15.2.10",
    "@angular/common": "15.2.10",
    "@angular/compiler": "15.2.10",
    "@angular/core": "15.2.10",
    "@angular/forms": "15.2.10",
    "@angular/platform-browser": "15.2.10",
    "@angular/platform-browser-dynamic": "15.2.10",
    "@angular/router": "15.2.10",
    "@aurora-pos-gui/contracts": "1.0.0",
    "@aurora-pos-gui/shared": "1.0.0",
    "@microsoft/signalr": "7.0.12",
    "@ng-bootstrap/ng-bootstrap": "14.2.0",
    "@ngrx/effects": "15.4.0",
    "@ngrx/router-store": "15.4.0",
    "@ngrx/store": "15.4.0",
    "@ngrx/store-devtools": "15.4.0",
    "bootstrap": "5.3.2",
    "lodash": "4.17.21",
    "ngx-logger": "5.0.12",
    "rxjs": "7.8.1",
    "tslib": "2.6.2",
    "zone.js": "0.12.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "15.2.10",
    "@angular/cli": "15.2.10",
    "@angular/compiler-cli": "15.2.10",
    "@semantic-release/git": "10.0.1",
    "@semantic-release/npm": "11.0.2",
    "eslint": "8.52.0",
    "raw-loader": "4.0.2",
    "semantic-release": "20.1.0",
    "typescript": "4.9.4",
    "webpack-bundle-analyzer": "3.9.0"
  }
}

Expected behavior

Semantic-release step should be successfully authenticated on Azure DevOps Server Git

semantic-release version

20.1.0

CI environment

Azure DevOps Server 2020 Update 1.1 OnPrem

Plugins used

@semantic-release/commit-analyzer
@semantic-release/npm
@semantic-release/git

semantic-release configuration

We use the .releaserc.yaml for semantic-release parameters definition:

branches: 
  - master
ci: true
debug: true
dryRun: true
plugins:
  - '@semantic-release/commit-analyzer'
  - - '@semantic-release/npm'
    - publish: false
  - - '@semantic-release/git'
    - assets:
        - 'dist/**/*.{js,css}'
        - docs
        - package.json
        - package-lock.json

CI logs

at async run (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:55:27)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:257:22)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\cli.js:55:5)
[11:14:15] [semantic-release] » ×  An error occurred while running semantic-release: Error: Command failed with exit code 128: git ls-remote --heads [http://[secure]@my_repo_url](http://%5Bsecure%5D@my_repo_url)
fatal: Authentication failed for 'http://my_repo_url/'
    at makeError (E:\build-agent4\_work\35\s\node_modules\semantic-release\node_modules\execa\lib\error.js:59:11)
    at handlePromise (E:\build-agent4\_work\35\s\node_modules\semantic-release\node_modules\execa\index.js:114:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getBranches (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\git.js:66:11)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\branches\expand.js:6:23)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\branches\index.js:14:26)
    at async run (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:56:22)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:257:22)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\cli.js:55:5) {
  shortMessage: 'Command failed with exit code 128: git ls-remote --heads [http://[secure]@my_repo_url',](http://%5Bsecure%5D@my_repo_url',)
  command: 'git ls-remote --heads [http://[secure]@my_repo_url',](http://%5Bsecure%5D@my_repo_url',)
  exitCode: 128,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: "fatal: Authentication failed for '[http://my_repo_url/'",](http://my_repo_url/'%22,)
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error: Command failed with exit code 128: git ls-remote --heads [http://[secure]@my_repo_url](http://%5Bsecure%5D@my_repo_url)
fatal: Authentication failed for 'http://my_repo_url/'
    at makeError (E:\build-agent4\_work\35\s\node_modules\semantic-release\node_modules\execa\lib\error.js:59:11)
    at handlePromise (E:\build-agent4\_work\35\s\node_modules\semantic-release\node_modules\execa\index.js:114:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getBranches (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\git.js:66:11)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\branches\expand.js:6:23)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\lib\branches\index.js:14:26)
    at async run (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:56:22)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\index.js:257:22)
    at async module.exports (E:\build-agent4\_work\35\s\node_modules\semantic-release\cli.js:55:5) {
  shortMessage: 'Command failed with exit code 128: git ls-remote --heads [http://[secure]@my_repo_url'](http://%5Bsecure%5D@my_repo_url'),
  command: 'git ls-remote --heads [http://[secure]@my_repo_url'](http://%5Bsecure%5D@my_repo_url'),
  exitCode: 128,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: "fatal: Authentication failed for '[http://my_repo_url/'"](http://my_repo_url/'%22),
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
@andy-mishechkin andy-mishechkin changed the title Symantic-Release can't access to Azure DevOps OnPrem server Git - fatal: Authentication failed Semantic-Release can't access to Azure DevOps OnPrem server Git - fatal: Authentication failed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant