LineageOS Gerrit push failed: too many commits & forge committer not permitted - android-source

I am setting up a Gerrit LineageOS(fork of AOSP) server locally, but upon my push to gerrit, many of the refs are rejected, giving me the error(s): prohibited by Gerrit: forge committer not permitted and too many commits. I understand the too many commits message, but even when checking the --skip-validation option, I was given the same forge committer message.
This is a linux server running Ubuntu, with Gerrit 2.15. I tried the skip option as stated above, and also did enable forge committing in the gerrit all-projects permissions.
The commands I used were(this worked fine):
repo forall -c 'echo $REPO_PATH; ssh -p 29418 admin#localhost gerrit create-project --name blinkOS/$REPO_PATH --owner blinkOS --parent blinkOS;'
to create branches, and this one to push(error ridden per push):
repo forall -c 'echo $REPO_PATH; git push ssh://admin#localhost:29418/blinkOS/$REPO_PATH +refs/heads/* +refs/tags/*;' The create command worked(parent project name is blinkOS), the push one is giving me the errors.
Expectedly, it should push, but it does not push all files, only some, and rejects the majority.
Here is a snippet of some of the error messages(i just took the most recent ones):
! [remote rejected] studio-2.3 -> studio-2.3 (prohibited by Gerrit: forge committer not permitted)
! [remote rejected] studio-3.0 -> studio-3.0 (prohibited by Gerrit: forge committer not permitted)
! [remote rejected] studio-3.1.2 -> studio-3.1.2 (prohibited by Gerrit: forge committer not permitted)
! [remote rejected] studio-master-dev_before_26911779 -> studio-master-dev_before_26911779 (prohibited by Gerrit: forge committer not permitted)
! [remote rejected] studio-master-dev_before_27917934 -> studio-master-dev_before_27917934 (prohibited by Gerrit: forge committer not permitted)

I did some thorough searhing, and soon after, realized I had the correct permissions pushed to refs/heads/*, but not to refs/tags/*, I then added the forge committer identity and all forge permissions to the refs/tags/* branch and it ended up allowing me to push and create a branch.

Related

Git LFS cannot find object for new repo

I'm trying to push some UE4 assets from a local brand new git project to a new github repo. I started with:
> git init
> git lfs track *.uasset
> git lfs track *.umap
> git add .git*
> git add path/to/asset.uasset
> git commit -m "init repo"
> git remote add origin git#github:my_repo.git
> git push -u origin master
Then I get:
Git LFS upload failed: 0% (0/1), 0 B | 0 B/s
(missing) Content/Assets/Landscape/M_Landscape_Master.uasset (9ec478c231daf870ad7ab6535c3beb403a63f68a305073506decd24ac66ad122)
hint: Your push was rejected due to missing or corrupt local objects.
hint: You can disable this check with: `git config lfs.allowincompletepush true`
error: failed to push some refs to 'github.com:my_repo.git'
git lfs push --all origin master gives the same error here.
git lfs fetch --all returns:
fetch: 1 object found, done.
fetch: Fetching all references...
[9ec478c231daf870ad7ab6535c3beb403a63f68a305073506decd24ac66ad122] Object does not exist on the server: [404] Object does not exist on the server
error: failed to fetch some objects from 'https://github.com/my_repo.git/info/lfs'
My environment:
Win10
git: git version 2.36.1.windows.1
lfs: git-lfs/3.1.4 (GitHub; windows amd64; go 1.17.8)

Permission denied error while setting up GitHub Pages

I'm following this page https://learntocodewith.me/tutorials/github-pages/ to create GitHub pages on MacBook Air (El Capitan) but when I do the last step I get this error:
$ git remote add origin
https://github.com/azg357/azg357.github.io.git
$ GitHubPageTest a$ git push -u origin master
remote: Permission to azg357/azg357.github.io.git denied to zeynel1.
fatal: unable to access
'https://github.com/azg357/azg357.github.io.git/': The requested URL returned error: 403
$
It looks like permission to access the repository is denied to "zeynel1". I use names like "zeynel" or "zeynel1" because it is my first name, but in this case, I haven't used it! I don't know where this is coming from.
Just before this error, OSX asks permission to give permission to GitHub to access "osxkeychain". Is this related to this? The message says something like "git-credential-osxkeychain" cannot be verified.
This is the copy of the entire session:
as-MacBook-Air:azeynel a$ cd /Users/a/GitHubPageTest
as-MacBook-Air:GitHubPageTest a$ git init
Initialized empty Git repository in /Users/a/GitHubPageTest/.git/
as-MacBook-Air:GitHubPageTest a$ git add .
as-MacBook-Air:GitHubPageTest a$ git commit -m "first commit"
[master (root-commit) ad86580] first commit
1 file changed, 7 insertions(+)
create mode 100644 index.html
as-MacBook-Air:GitHubPageTest a$ git remote add origin
https://github.com/azg357/azg357.github.io.git
as-MacBook-Air:GitHubPageTest a$ git push -u origin master
remote: Permission to azg357/azg357.github.io.git denied to zeynel1.
fatal: unable to access
'https://github.com/azg357/azg357.github.io.git/': The requested URL returned error: 403
as-MacBook-Air:GitHubPageTest a$
Thanks!
.
This was a problem caused by the cache on Key chain app. I deleted the stored GitHub items and it worked.

Jenkins Git Plugin

I am getting the below error when attempting a Jenkins build of a project from a GitHub repository for a poc. Jenkins is a local install and I am using the https address for git with thge username and password I use to login to GitHub. Can anyone offer me some pointers here as I am new to both Jenkins and GitHub
Building in workspace C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build
Cloning the remote Git repository
Cloning repository https://github.com/h020905a/AdventureWorks2014.git
> git.exe init C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build # timeout=10
Fetching upstream changes from https://github.com/h020905a/AdventureWorks2014.git
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> git.exe fetch --tags --progress https://github.com/h020905a/AdventureWorks2014.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Error performing git command
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1793)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1513)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: org.jvnet.winp.WinpException: Failed to read RT_USER_PROCESS_PARAMETERS error=299 at envvar-cmdline.cpp:151
at org.jvnet.winp.Native.getCmdLineAndEnvVars(Native Method)
at org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:126)
at org.jvnet.winp.WinProcess.getCommandLine(WinProcess.java:102)
at hudson.util.ProcessTree$Windows$1.getArguments(ProcessTree.java:444)
at hudson.plugins.msbuild.MsBuildKillingVeto.vetoProcessKilling(MsBuildKillingVeto.java:56)
at hudson.util.ProcessTree$OSProcess.getVeto(ProcessTree.java:242)
at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:425)
at hudson.util.ProcessTree.killAll(ProcessTree.java:145)
at hudson.Proc$LocalProc.destroy(Proc.java:380)
at hudson.Proc$LocalProc.join(Proc.java:353)
at hudson.Proc.joinWithTimeout(Proc.java:166)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1780)
... 15 more
ERROR: null
Finished: FAILURE
If your github login password has special characters, then the issue you are facing might be similar to the issue described in this ticket:
https://issues.jenkins-ci.org/browse/JENKINS-38655
You can try getting your job to use JGit. Quoting from Mark Waite's answer in the above mentioned ticket:
"If you're not using TFS, but have special characters in the password of the specific user (like caret or ampersand or single quote or double quote), then this may be a duplicate of JENKINS-38194. The work around in that case may be to switch that job from using the command line git implementation to use the JGit implementation. The JGit implementation needs to be enabled globally first from "Manage Jenkins", "Global Tool Configuration", "Git", then there will be a pick list in each job which will allow you to choose whether that job should use command line git or JGit."
Resolved the issue by switching the branch in github to master and making the repo public.

EGit: cannot push, cannot pull

I'am using EGit and I commited a change to my local git repository.
I'd like to push this change to a remote.
When doing that, a dialog screen pops up which shows "rejected-master-master-non-fast-forward". The answer of this linked question states that I have to pull first.
When doing the pull, an EGit exception is thrown:
org.eclipse.jgit.api.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:253)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:97)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:128)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:139)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:114)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.TransportException: Nothing to fetch.
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1087)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 8 more
It seems that I'm stuck. Who can help me out?
UPDATE
The .git/config file in my repository contains (remote URL hid):
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = <URL_HIDDEN>
I'm using Eclipse Git Team Provider 3.4.1.201406201815
The configuration of the repository seems to miss this line in the [remote "origin"] section:
fetch = +refs/heads/*:refs/remotes/origin/*
It tells git to fetch all refs starting with refs/heads/ (all branches) and store them under refs/remotes/origin/ locally. E.g. the refs/heads/master in the remote repository will become refs/remotes/origin/master locally (or origin/master in short).
Can you add that and try if it makes pull work?
Also, it would be very interesting to know in which way you first created/cloned this repository.
I also faced the same problem when using egit and could not pull the changes. But previous answer helped a lot. Now, there can be two ways to update the config file.
Direct Update in the file : Goto local_repo_location/.git/ and open config file and add :
[remote "origin"]
url = YOUR_REPO_URL
push = ALREADY_FILLED_VALUE
fetch = +refs/heads/:refs/remotes/origin/
Updating config using eclipse : Goto Windows -> Preferences -> Team -> Git -> Configuration and now under Repository Settings tab look under -> remote -> origin.
Problem is there is no key for fetch.
Now click : Add Entry and provide the values as follows :
Key : remote.origin.fetch
Value : +refs/heads/:refs/remotes/origin/
Now we are done.
i had the same problem pulling from remote repo was giving error (org.eclipse.jgit.api.errors.transportexception)
here's what i did
changed the origin to my fork account and pulled.
changed the origin back to the actual value and pulled.
donot really know about the problem of egit but this two simple steps solved my problem, hope it helps

Pushing my app to cloudControl (PaaS) fails: hook declined

When trying to push and deploy my app to cloudControlled PaaS:
$ cctrlapp MY_APP/default push
I get the following error (reduced output):
remote: -----> Receiving push
remote: /srv/www/buildpacks/php/bin/compile: line 81: /srv/tmp/builddir/code/composer.phar: Permission denied
remote: ! cloudControl push rejected, failed to compile php app
remote: !
remote: error: hook declined to update refs/heads/master
To ssh://MY_APP#cloudcontrolled.com/repository.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://MY_APP#cloudcontrolled.com/repository.git'
Command '['PATH_TO_GIT', 'push', u'ssh://MY_APP#cloudcontrolled.com/repository.git', 'master']'
returned non-zero exit status 1
Anyone has any idea?
I found out I have to remove the composer.phar file from the root directory of my repository. Too keep it in my local filesystem, I did
git rm --cached composer.phar
# then commit, push, deploy