qiwi / semantic-release-gh-pages-plugin

github-pages publishing plugin for semantic-release
MIT License
23 stars 8 forks source link

Invalid username or password: Command failed with exit code 1: git pull --tags --force https://[secure]@github.com/org/package-foo.git #80

Closed moltar closed 4 years ago

moltar commented 4 years ago

I am getting the following error message.

The GitHub action step is like this (included GITHUB_TOKEN):

      - name: Semantic Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
        run: npm run semantic-release

Error:

2020-03-28T16:56:02.2949375Z > @org/package-foo@1.8.0 semantic-release /home/runner/work/package-foo/package-foo
2020-03-28T16:56:02.2951615Z > semantic-release
2020-03-28T16:56:02.2952044Z 
2020-03-28T16:56:02.5652247Z [4:56:02 PM] [semantic-release] › ℹ  Running semantic-release version 17.0.4
2020-03-28T16:56:02.7732114Z [4:56:02 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:02.7869179Z [4:56:02 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer" in shareable config "@org/semantic-release-config"
2020-03-28T16:56:02.7873798Z [4:56:02 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:04.1790636Z [4:56:04 PM] [semantic-release] › ✔  Run automated release from branch master on repository https://x-access-token:[secure]@github.com/org/package-foo
2020-03-28T16:56:04.4949960Z [4:56:04 PM] [semantic-release] › ✔  Allowed to push to the Git repository
2020-03-28T16:56:04.4954865Z [4:56:04 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:04.5145253Z [4:56:04 PM] [semantic-release] [@qiwi/semantic-release-gh-pages-plugin] › ℹ  verify gh-pages config
2020-03-28T16:56:04.5149162Z [4:56:04 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:04.5218546Z [4:56:04 PM] [semantic-release] › ℹ  Found git tag v1.8.0 associated with version 1.8.0 on branch master
2020-03-28T16:56:04.5323660Z [4:56:04 PM] [semantic-release] › ℹ  Found 8 commits since last release
2020-03-28T16:56:04.5326398Z [4:56:04 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
2020-03-28T16:56:04.5405042Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: ci: removes debug
2020-03-28T16:56:04.5412875Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5414120Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: ci: enables debug for semantic-release-gh-pages-plugin
2020-03-28T16:56:04.5415375Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5416539Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: docs: triggers a release
2020-03-28T16:56:04.5425867Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5434728Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: ci: adds docs generating step
2020-03-28T16:56:04.5460054Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5461370Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: adds typedoc and GitHub pages (#305)
2020-03-28T16:56:04.5462427Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is minor
2020-03-28T16:56:04.5463273Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: test: fixes missing param
2020-03-28T16:56:04.5464110Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5464894Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Update CNAME
2020-03-28T16:56:04.5465633Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5466369Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Create CNAME
2020-03-28T16:56:04.5467151Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-03-28T16:56:04.5467986Z [4:56:04 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 8 commits complete: minor release
2020-03-28T16:56:04.5468753Z [4:56:04 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
2020-03-28T16:56:04.5507963Z [4:56:04 PM] [semantic-release] › ℹ  The next release version is 1.9.0
2020-03-28T16:56:10.7167862Z [4:56:10 PM] [semantic-release] › ✔  Created tag v1.9.0
2020-03-28T16:56:10.7172458Z [4:56:10 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:10.7220160Z [4:56:10 PM] [semantic-release] [@qiwi/semantic-release-gh-pages-plugin] › ℹ  Publishing docs via gh-pages
2020-03-28T16:56:10.9265845Z [4:56:10 PM] [semantic-release] › ✖  Failed step "publish" of plugin "@qiwi/semantic-release-gh-pages-plugin"
2020-03-28T16:56:10.9289607Z [4:56:10 PM] [semantic-release] › ✖  An error occurred while running semantic-release: Error: Command failed with exit code 1: git pull --tags --force https://[secure]@github.com/org/package-foo.git
2020-03-28T16:56:10.9290354Z remote: Invalid username or password.
2020-03-28T16:56:10.9291317Z fatal: Authentication failed for 'https://github.com/org/package-foo.git/'
2020-03-28T16:56:10.9292177Z     at makeError (/home/runner/work/package-foo/package-foo/node_modules/@qiwi/semantic-release-gh-pages-plugin/node_modules/execa/lib/error.js:58:11)
2020-03-28T16:56:10.9304463Z     at handlePromise (/home/runner/work/package-foo/package-foo/node_modules/@qiwi/semantic-release-gh-pages-plugin/node_modules/execa/index.js:114:26)
2020-03-28T16:56:10.9304986Z     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-03-28T16:56:10.9305833Z     at async validator (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
2020-03-28T16:56:10.9306998Z     at async /home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
2020-03-28T16:56:10.9307858Z     at async /home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/pipeline.js:31:3
2020-03-28T16:56:10.9308766Z     at async Object.pluginsConf.<computed> [as publish] (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/index.js:80:11)
2020-03-28T16:56:10.9317031Z     at async run (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/index.js:197:20)
2020-03-28T16:56:10.9319981Z     at async module.exports (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/index.js:259:22)
2020-03-28T16:56:10.9320956Z     at async module.exports (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/cli.js:55:5) {
2020-03-28T16:56:10.9321729Z   shortMessage: 'Command failed with exit code 1: git pull --tags --force https://[secure]@github.com/org/package-foo.git',
2020-03-28T16:56:10.9322425Z   command: 'git pull --tags --force https://[secure]@github.com/org/package-foo.git',
2020-03-28T16:56:10.9322772Z   exitCode: 1,
2020-03-28T16:56:10.9323067Z   signal: undefined,
2020-03-28T16:56:10.9323377Z   signalDescription: undefined,
2020-03-28T16:56:10.9323808Z   stdout: '',
2020-03-28T16:56:10.9324338Z   stderr: 'remote: Invalid username or password.\n' +
2020-03-28T16:56:10.9325006Z     "fatal: Authentication failed for 'https://github.com/org/package-foo.git/'",
2020-03-28T16:56:10.9325369Z   failed: true,
2020-03-28T16:56:10.9325669Z   timedOut: false,
2020-03-28T16:56:10.9325965Z   isCanceled: false,
2020-03-28T16:56:10.9326242Z   killed: false,
2020-03-28T16:56:10.9326734Z   pluginName: '@qiwi/semantic-release-gh-pages-plugin'
2020-03-28T16:56:10.9327106Z }
2020-03-28T16:56:10.9327937Z Error: Command failed with exit code 1: git pull --tags --force https://[secure]@github.com/org/package-foo.git
2020-03-28T16:56:10.9328367Z remote: Invalid username or password.
2020-03-28T16:56:10.9329051Z fatal: Authentication failed for 'https://github.com/org/package-foo.git/'
2020-03-28T16:56:10.9329888Z     at makeError (/home/runner/work/package-foo/package-foo/node_modules/@qiwi/semantic-release-gh-pages-plugin/node_modules/execa/lib/error.js:58:11)
2020-03-28T16:56:10.9330849Z     at handlePromise (/home/runner/work/package-foo/package-foo/node_modules/@qiwi/semantic-release-gh-pages-plugin/node_modules/execa/index.js:114:26)
2020-03-28T16:56:10.9331556Z     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-03-28T16:56:10.9332614Z     at async validator (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
2020-03-28T16:56:10.9333690Z     at async /home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
2020-03-28T16:56:10.9334589Z     at async /home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/pipeline.js:31:3
2020-03-28T16:56:10.9335595Z     at async Object.pluginsConf.<computed> [as publish] (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/lib/plugins/index.js:80:11)
2020-03-28T16:56:10.9336567Z     at async run (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/index.js:197:20)
2020-03-28T16:56:10.9337759Z     at async module.exports (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/index.js:259:22)
2020-03-28T16:56:10.9340804Z     at async module.exports (/home/runner/work/package-foo/package-foo/node_modules/@org/semantic-release-config/node_modules/semantic-release/cli.js:55:5) {
2020-03-28T16:56:10.9341662Z   shortMessage: 'Command failed with exit code 1: git pull --tags --force https://[secure]@github.com/org/package-foo.git',
2020-03-28T16:56:10.9342222Z   command: 'git pull --tags --force https://[secure]@github.com/org/package-foo.git',
2020-03-28T16:56:10.9342552Z   exitCode: 1,
2020-03-28T16:56:10.9342876Z   signal: undefined,
2020-03-28T16:56:10.9343192Z   signalDescription: undefined,
2020-03-28T16:56:10.9343504Z   stdout: '',
2020-03-28T16:56:10.9343862Z   stderr: 'remote: Invalid username or password.\n' +
2020-03-28T16:56:10.9344357Z     "fatal: Authentication failed for 'https://github.com/org/package-foo.git/'",
2020-03-28T16:56:10.9344711Z   failed: true,
2020-03-28T16:56:10.9345013Z   timedOut: false,
2020-03-28T16:56:10.9345331Z   isCanceled: false,
2020-03-28T16:56:10.9347397Z   killed: false,
2020-03-28T16:56:10.9347903Z   pluginName: '@qiwi/semantic-release-gh-pages-plugin'
2020-03-28T16:56:10.9504391Z }npm ERR! code ELIFECYCLE
2020-03-28T16:56:10.9504672Z npm ERR! errno 1
2020-03-28T16:56:10.9507930Z npm ERR! @org/package-foo@1.8.0 semantic-release: `semantic-release`
2020-03-28T16:56:10.9508203Z npm ERR! Exit status 1
2020-03-28T16:56:10.9510511Z npm ERR! 
2020-03-28T16:56:10.9511395Z npm ERR! Failed at the @org/package-foo@1.8.0 semantic-release script.
2020-03-28T16:56:10.9511791Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-03-28T16:56:10.9673896Z 
2020-03-28T16:56:10.9676343Z npm ERR! A complete log of this run can be found in:
2020-03-28T16:56:10.9678391Z npm ERR!     /home/runner/.npm/_logs/2020-03-28T16_56_10_951Z-debug.log
2020-03-28T16:56:10.9780648Z ##[error]Process completed with exit code 1.
2020-03-28T16:56:10.9828334Z Cleaning up orphan processes

Any ideas?

Thanks!

antongolub commented 4 years ago

@moltar

Could you run this cmd locally?

git pull --tags --force https://[secure]@github.com/org/package-foo.git

Just to exclude broken token case.

the-glima commented 4 years ago

I'm having the same issue.

image

Yes, I have the GITHUB_TOKEN env configured. Also, this command works for me:

git pull --tags --force https://[secure]@github.com/org/package-foo.git

Using in my context, of course.

antongolub commented 4 years ago

@moltar @the-glima No explanation was found in logs above, sorry.

It is necessary to spy on getRepoUrl and getRepo helpers.

Once DEBUG env is set, more details will appear in logs:

if (process.env.DEBUG) {
    logger.log('getRepoUrl:')
    logger.log('urlFromEnv=', urlFromEnv)
    logger.log('urlFromStepOpts=', urlFromStepOpts)
    logger.log('urlFromOpts=', urlFromOpts)
    logger.log('urlFromPackage', urlFromPackage)
    logger.log('url=', url)
  }

if (process.env.DEBUG) {
    logger.log('getRepo:')
    logger.log('repoUrl=', repoUrl)
    logger.log('repoName=', repoName)
    logger.log('repoDomain=', repoDomain)
    logger.log('has token=', !!token)
    logger.log('enterprise=', enterprise)
  }

Everything seems to be ok with the latest semrel and plugins. Here's the public repo example: https://github.com/qiwi/mixin

Verified working config for "enterprise":

GH_URL=https://github.<domain>/api/v3/ GH_TOKEN=<token> yarn release
{
  "name": "@private-scope/package-name",
  "description": "Blah-blah-blah",
  "version": "1.0.0",
  "files": [
    "README.md",
    "CHANGELOG.md",
    "index.js"
  ],
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "lint": "echo \"Error: no linter configured\" && exit 1",
    "build": "yarn docs",
    "docs": "rm -rf docs &&  mkdir docs && echo 'docs' > docs/DOCS.md",
    "release": "semantic-release"
  },
  "dependencies": {},
  "devDependencies": {
    "@qiwi/semantic-release-gh-pages-plugin": "^1.15.10",
    "@semantic-release/commit-analyzer": "^8.0.1",
    "@semantic-release/changelog": "^5.0.1",
    "@semantic-release/git": "^9.0.0",
    "@semantic-release/github": "^7.0.5",
    "@semantic-release/npm": "^7.0.5",
    "semantic-release": "^17.0.4"
  },
  "repository": {
    "type": "git",
    "url": "https://github.<domain>/space/package-name.git"
  },
  "publishConfig": {
    "registry": "https://npm-registry.<domain>"
  },
  "release": {
    "branch": "master",
    "verifyConditions": [
      "@semantic-release/changelog",
      "@semantic-release/npm",
      "@semantic-release/git",
      "@qiwi/semantic-release-gh-pages-plugin"
    ],
    "prepare": [
      "@semantic-release/changelog",
      "@semantic-release/npm",
      "@semantic-release/git"
    ],
    "publish": [
      "@semantic-release/npm",
      "@semantic-release/github",
      [
        "@qiwi/semantic-release-gh-pages-plugin",
        {
          "enterprise": true
        }
      ]
    ]
  }
}

Hope this helps.

antongolub commented 4 years ago

@moltar @the-glima, since 1.16.0 the pulling hook can be disabled by setting pullTagsBranch option to empty string.

antongolub commented 4 years ago

One more similar case. BuildId: https://github.com/microsoft/jacdac-ts/runs/811365079 Commit: https://github.com/microsoft/jacdac-ts/commit/1ba1d9a54aff2a8b025160944ecc626e6d5bb1d8

antongolub commented 4 years ago

@moltar @the-glima @pelikhan @kjens93

We still don't have the stand that reproduces this issue. As an experiment, we've tried to replace the custom url builder with "native" semrel mechanics (#94). Everything seems to be ok on our testing repo travis/354764920, but it isn't clear whether the problem is fixed.

Could anybody try the latest beta? semantic-release-gh-pages-plugin@4.0.0-beta.0 Thanks.

qiwibot commented 4 years ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: