error on git push --set-upstream origin beanch_name - gitlab

When i give the command git push --set-upstream origin US8938439 it gives error as below:
remote: GitLab: You cannot push commits for
'X56789#TFC-6JNm6RqXvb6.bbtnet.com'. You can only push commits if the
committer email is one of your own verified emails.To
ssh://git#gitlab.bbtnet.com:90088/DummyProject ! [remote rejected]
US8938439 -> US8938439 (pre-receive hook declined) error: failed to
push some refs to 'ssh://git#gitlab.bbtnet.com:90088/DummyProject'
Please help me to understand what is causing the error:
You cannot push commits for 'X56789#TFC-6JNm6RqXvb6.bbtnet.com'. You can only push commits if the committer email is one of your own
verified emails
-(pre-receive hook declined)

Related

ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: returned status code 128:

Am getting the below error when i build a job from Jenkins
Checking out git https://github.airbus.corp/Airbus/6e7c-myAuthoring.git into /var/jenkins_home/workspace/Cognitodeploy#script/e0b7ead5fba7a7068ea08dc5f7f7da6376cbb7d7f46c4a86a940337f63683bdc to read Jenkinsfilecognito
The recommended git tool is: git
using credential git-jenkins-cred
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.airbus.corp/Airbus/6e7c-myAuthoring.git
> git init /var/jenkins_home/workspace/Cognitodeploy#script/e0b7ead5fba7a7068ea08dc5f7f7da6376cbb7d7f46c4a86a940337f63683bdc # timeout=10
Fetching upstream changes from https://github.airbus.corp/Airbus/6e7c-myAuthoring.git
> git --version # timeout=10
> git --version # 'git version 2.31.1'
using GIT_ASKPASS to set credentials
> git fetch --tags --force --progress -- https://github.airbus.corp/Airbus/6e7c-myAuthoring.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- https://github.airbus.corp/Airbus/6e7c-myAuthoring.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Enumerating objects: 56900, done.
remote: Counting objects: 0% (1/105)
remote: Counting objects: 1% (2/105)
remote: Counting objects: 2% (3/105)
remote: Counting objects: 3% (4/105)
aining
error: 248 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2675)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2099)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:85)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:619)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:848)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1226)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:159)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
at hudson.model.ResourceController.execute(ResourceController.java:107)
at hudson.model.Executor.run(Executor.java:449)
ERROR: Error cloning remote repo 'origin'
ERROR: Maximum checkout retry attempts reached, aborting
org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval.using(ScriptApproval.java:489)
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval$using$0.call(Unknown Source)
at com.splunk.splunkjenkins.UserActionDSL.perform(UserActionDSL.groovy:39)
at com.splunk.splunkjenkins.listeners.LoggingRunListener.onCompleted(LoggingRunListener.java:85)
at hudson.model.listeners.RunListener.lambda$fireCompleted$0(RunListener.java:207)
at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
at jenkins.util.Listeners.notify(Listeners.java:67)
at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:205)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:627)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:362)
at hudson.model.ResourceController.execute(ResourceController.java:107)
at hudson.model.Executor.run(Executor.java:449)
Finished: FAILURE
Note: I have already set up a behaviour to wipe workspace repository and force clone while triggering the job.
Kindly let me know what other measures would be required to overcome this issue

Git push heroku main > pre-receive hook declined

When I give the command git push heroku main it fails to build and shows the following error:
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs
How can I solve this error?

Gitlab shows remote: This server is readonly

Can't push the changes to any existing repository (Or) to new repository.
Error while pushing the changes:-
git push -u origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 226 bytes | 226.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: ================================================
remote: This server is readonly
remote: ================================================
To gitlab.domain.com:gitlab-user/test30-jan-2020.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#gitlab.domain.com:gitlab-user/test30-jan-2020.git'
GitLab GUI --> Under Admin--> Settings-->General & Repository settings checked, seems settings are fine.
And GitLab Server gitlab.rb file also doesn't have readonly settings mode enabled.
Any other clue/input to enable write mode?
Server side there was a custom hook /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive.d which was preventing the push. Same has been removed it started working.

Git push - node.js failed to push some refs

I am trying to push a node.js application, but I run into following issue:
Total 226 (delta 25), reused 0 (delta 0)
remote: /usr/share/gems/gems/openshift-origin-node-1.18.0.1/lib/openshift-origin-node/model/application_repository.rb:50:
warning: Insecure world writable dir /var/lib/openshift/532aba62493209b14e000001 in PATH, mode 040777
remote: Stopping NodeJS cartridge
remote: Permission denied - /var/lib/openshift/532aba62493209b14e000001/app-deployments/2014-03-20_02-52-39.976/dependencies/nodejs/node_modules/express
To ssh://532aba62493209b14e000001#myapp-test.openshift.local/~/git/myapp.git/
! [remote rejected] master -> master
(pre-receive hook declined)
error: failed to push some refs to 'ssh://532aba62493209b14e000001#myapp-test.openshift.local/~/git/myapp.git/'
Found that could be a known issue https://bugzilla.redhat.com/show_bug.cgi?id=1054421.
Can anyone help me here?
Thanks.

Is it possible to specify a rule for a file for a specific branch?

I have a GIT repository foo with 2 branches: branch1 and branch2. I want to set up a gitolite rule that denies pushing modifications for this file only for branch1 for bar user. This is what I've tried so far:
repo foo
- branch1/this = bar
repo foo
- branch1/NAME/this = bar
repo foo
- branch1 /NAME/this = bar
I don't even know if this is possible with gitolite.
Any help very much welcome. Thanks in advance.
EDIT: I tried this 2 configurations as suggested. The following:
- branch1 VREF/NAME/this = bar
RW branch2 VREF/NAME/this = #all
rejects both branches
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch2
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch1
To debian:testing.git
! [remote rejected] branch2 -> branch2 (hook declined)
! [remote rejected] branch1 -> branch1 (hook declined)
error: failed to push some refs to 'debian:testing.git'
While the following
RW branch2 VREF/NAME/this = #all
- branch1 VREF/NAME/this = bar
allows both branches to be pushed
To debian:testing.git
f6bc01d..09b63ab branch2 -> branch2
7a868cf..09bcb63 branch1 -> branch1
Using the same branch (branch1)
RW branch1 VREF/NAME/this = #all
- branch1 VREF/NAME/this = bar
To debian:testing.git
9c50fc4..02f350d branch1 -> branch1
- branch1 VREF/NAME/this = bar
RW branch1 VREF/NAME/this = #all
remote: FATAL: W VREF/NAME/this testing bar DENIED by VREF/NAME/this
remote: error: hook declined to update refs/heads/branch1
To debian:testing.git
! [remote rejected] branch1 -> branch1 (hook declined)
It should be:
repo foo
- branch1 VREF/NAME/this = bar
I used a similar VREF-based rule for "gitolite disallow access for directory on master branch but not on user branch".
'VREF/...' is the important part ('NAME' alone won't work, 'VREF/NAME' will)

Resources