question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Command failed with exit code 128: git push. main remote: You are not allowed to upload code.

See original GitHub issue

Log:

2022-10-15T13:44:58.833Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  [https://gitlab-ci-token:[secure]@gitlab.com/anton_patsev/terraform-yandex-compute.git](https://gitlab-ci-token:%5Bsecure%5D@gitlab.com/anton_patsev/terraform-yandex-compute.git)
2022-10-15T13:44:59.194Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify [https://gitlab-ci-token:[secure]@gitlab.com/anton_patsev/terraform-yandex-compute.git](https://gitlab-ci-token:%5Bsecure%5D@gitlab.com/anton_patsev/terraform-yandex-compute.git) HEAD:main
remote: You are not allowed to upload code.
fatal: unable to access '[https://gitlab-ci-token:[secure]@gitlab.com/anton_patsev/terraform-yandex-compute.git/'](https://gitlab-ci-token:%5Bsecure%5D@gitlab.com/anton_patsev/terraform-yandex-compute.git/'): The requested URL returned error: 403

Source code https://gitlab.com/anton_patsev/terraform-yandex-compute .gitlab-ci.yml:

stages:
  - release

release:
  image: node:16-buster-slim
  stage: release
  variables:
    GITLAB_TOKEN: $GITLAB_TOKEN
  interruptible: true
  before_script:
    - apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
    - npm install
  script:
    - npx semantic-release --debug
  only:
    - main

.releaserc.json:

{
  "branches": ["main"],
  "ci": false,
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/gitlab",
    [
      "@semantic-release/git",
      {
        "assets": ["CHANGELOG.md"],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}

package.json:

{
  "name": "semantic-release",
  "dependencies": {
    "@semantic-release/changelog":"6.0.1",
    "@semantic-release/commit-analyzer":"9.0.2",
    "@semantic-release/git":"10.0.1",
    "@semantic-release/gitlab":"9.4.2",
    "@semantic-release/release-notes-generator":"10.0.3",
    "semantic-release":"19.0.5"
  }
}

I created token: image

Add TOKEN to Settings > CI/CD > Variables image

Full log https://gitlab.com/anton_patsev/terraform-yandex-compute/-/jobs/3178193211

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fgreinachercommented, Nov 4, 2022

@patsevanton To me it looks like this is the expected behavior, and your job seems to be working. Feel free to open an issue in https://github.com/semantic-release/git if something is not working for you.

0reactions
luchanancommented, Nov 18, 2022

i have the same problem.

I’ve defined GL_TOKEN variable

git-lfs/2.10.0 (GitHub; windows amd64; go 1.12.7; git a526ba6b)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ echo "$GL_TOKEN"
glpat-Ums7uLkcvzdMycquVXNg
Job succeeded

the error log like this

[09:46:13] [semantic-release] » √  Loaded plugin "fail" from "@semantic-release/gitlab"
2022-11-17T01:46:13.250Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  http://gitlab-ci-token:[secure]@localhost/gitlab-instance-7c45863e/semantic-release-test.git
2022-11-17T01:46:13.498Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify http://gitlab-ci-token:[secure]@localhost/gitlab-instance-7c45863e/semantic-release-test.git HEAD:main
remote: You are not allowed to upload code.
fatal: unable to access 'http://localhost/gitlab-instance-7c45863e/semantic-release-test.git/': The requested URL returned error: 403
    at makeError (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\node_modules\execa\lib\error.js:60:11)
    at handlePromise (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async verifyAuth (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\lib\git.js:207:5)
    at async module.exports (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\lib\get-git-auth-url.js:91:5)
    at async run (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\index.js:64:27)
    at async module.exports (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\index.js:269:22)
    at async module.exports (d:\Users\ivan\AppData\Roaming\nvm\v16.14.2\node_modules\semantic-release\cli.js:55:5)
2022-11-17T01:46:13.498Z semantic-release:get-git-auth-url SSH key auth failed, falling back to https.
2022-11-17T01:46:15.967Z semantic-release:get-tags found tags for branch main: []
[09:46:16] [semantic-release] » √  Run automated release from branch main on repository http://gitlab-ci-token:[secure]@localhost/gitlab-instance-7c45863e/semantic-release-test.git
[09:46:17] [semantic-release] » √  Allowed to push to the Git repository
[09:46:17] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[09:46:17] [semantic-release] » √  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[09:46:17] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/gitlab"
2022-11-17T01:46:17.419Z semantic-release:gitlab apiUrl: 'http://localhost/api/v4'
2022-11-17T01:46:17.419Z semantic-release:gitlab repoId: 'gitlab-instance-7c45863e/semantic-release-test'
[09:46:17] [semantic-release] [@semantic-release/gitlab] » i  Verify GitLab authentication (http://localhost/api/v4)
[09:46:57] [semantic-release] » ×  Failed step "verifyConditions" of plugin "@semantic-release/gitlab"
[09:46:57] [semantic-release] » i  Start step "verifyConditions" of plugin "@semantic-release/git"
[09:46:57] [semantic-release] » √  Completed step "verifyConditions" of plugin "@semantic-release/git"
[09:46:57] [semantic-release] » ×  An error occurred while running semantic-release: RequestError: socket hang up
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve the "remote: You are not allowed to upload code ...
Try configuring your gitlab-ci.yml file to push the changes rather than trying to do it from the python file.
Read more >
Git auth check fails on GitLab with "remote: You are not ...
Git auth check fails on GitLab with "remote: You are not allowed to upload ... Error: Command failed with exit code 128: git...
Read more >
Remote: You are not allowed to upload code. 403
I'm the maintainer, I've uploaded, pushed changed code. ... I'm working on Win10, using the push command button, provided by VCode.
Read more >
semantic-release/semantic-release - Gitter
Here in my company we use GitHub Registry instead of NPMJs. ... semantic-release:git Error: Command failed with exit code 128: git push --dry-run ......
Read more >
Build Azure Repos Git repositories - Azure Pipelines
batch is not supported in repository resource triggers. To clarify this example, let us say that a push A to master caused the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found