Not authorized to perform operation verify lock on repository - gerrit

I installed lfs plugin on gerrit server, but there are many error message on server.
ERROR com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext : Not authorized to perform operation verify lock on repository
Does anybody know what this error means, and how to fix it? I attempted to google this error, but didn't find any results.

By default, the Gerrit LFS plugin stores the Git LFS file lock information at the following directory:
$GERRIT_SITE/data/lfs/lfs_locks
Have you changed this directory using the "locks.directory" option in the "$GERRIT_SITE/etc/lfs.config" file? Verify if everything is OK with this option and with this directory.
For more info, see the "Global Plugin Settings" section here.

Related

Error: Global Tool Configuration in Jenkins

While making changes under Global Tool Configuration in Jenkins, it throws a message as "A problem occurred while processing your request". Though the changes are reflected even after the error message, however, it doesn't stay put after a jenkins restart.
enter image description here
I have tried the possible solutions.
Remove multi-auth files and role-strategy files
Remove authorization tag from config.xml files
Restarted jenkins multiple time
Updated plugins

Jenkins Subversion Checkout Failing - "E175002: CRLF expected at end of chunk: -1/-1"

I have a Jenkins v2.107.2 instance (running as a Windows service) which is checking out several projects via Subversion from a Visual SVN Server (on a seperate Windows PC).
One of the projects (the largest - ~2.7GB) is occasionally, but then consistently failing with the following error when attempting to checkout:
ERROR: Failed to check out https://example.com/myrepo
org.tmatesoft.svn.core.SVNException: svn: E175002: CRLF expected at end of chunk: -1/-1
svn: E175002: REPORT request failed on '/svn/REPO/!svn/vcc/default'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
In addition, when checking the logs of the Visual SVN Server, I can see the following:
Error writing base64 data: The timeout specified has expired [500, #70007]
A failure occurred while driving the update report editor [500, #70007]
Provider encountered an error while streaming a REPORT response. [500, #0]
Previously, some combination of downgrading Jenkins & the Subversion plugin by one version resolved this error, but despite having not changed versions since, this no longer works.
From looking online, there seems to be some sort of timeout built into Subversion where requests will be killed if going over a certain time. However, the instructions all refer to the Subversion config that should be in %APPDATA%\Roaming, which I do not seem to have.
The Jenkins Subversion documentation suggests C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming, but again I have nothing there.
I've installed TortoiseSVN, which did create the Subversion configuration folder. I've modified the http-timeout, and then put this configuration in all the locations suggested by the documentation, but this has not made any difference (but whether it's because it doesn't fix the issue, or it's not being picked up - I'm not sure).
This error E175002: CRLF expected at end of chunk: -1/-1 can occur with products that use SVNKit to support Subversion - Jenkins, Fisheye, Crucible etc. The bug should not occur with svn.exe, TortoiseSVN or native JavaHL libraries.
Per my experience, the following solution solves the problem - enable Spooling in SVNKit. See these tickets:
https://issues.jenkins-ci.org/browse/JENKINS-44307
https://issues.tmatesoft.com/issue/SGT-989.
The error is produced by SVNKit which is used in Jenkins to enable SVN client capabilities. SVNKit is a separate re-implementation of Subversion and SVNKit might have its own specifics that could result in issues or errors that does not occur with actual Apache Subversion client. I'm not an expert in SVNKit, but it seems to me that you've encountered such SVNKit-specific issue or at least error wording.
You need to enable spooling.
See this Jenkins support issue, although this dupe issue describes the solution better:
Set the -Dhudson.spool-svn=true system property or increase timeout on the server.
For Jenkins on Windows you need to edit jenkins.xml file located in Jenkins installation directory (e.g. C:\Program Files\Jenkins\jenkins.xml).
Add an option for Hudson to use SVN spooling
<service>
...
<arguments>
...
-Dhudson.spool-svn=true
...
</arguments>
...
</service>

getting "FATAL: Couldn’t find any executable in /root/apache-maven-3.5.3" with Jenkins version 2.107.3. I am CentOS

getting "FATAL: Couldn’t find any executable in /root/apache-maven-3.5.3" with Jenkins version 2.107.3. I am CentOS.
Added paths of Java and Maven in .bash_profile
git rev-list --no-walk 0caf6111d5ef4679bf818f99fa448a525566ee69 # timeout=10
FATAL: Couldn’t find any executable in /root/apache-maven-3.5.3
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Based on the comments under the OP this is definitely a permission issue.
You cannot expect to put something in the /root path and be able to access it with a user other than root. This will most likely fail, because the permissions which are used for home directories, allow only the root user to read, write and execute things in that path.
CentOS has SELinux enforce by default and it provides additional security layer which will also prevent users from reading and/or writing to certain paths on the system. So you could actually have the "correct" permissions set for a path, but the user that's trying to read/write something there could still not be able to do it.
In general, you should be running Jenkins server and agents under a dedicated user and group - i.e jenkins user and group. This will allow you to create a path like /jenkins/ which is owned by the jenkins user & group. Then set that as the path where Jenkins installs it's tools.

SVN commands don't recognize URL

I'm working at a very small startup. A previous employee set up our SVN system. The SVN system is accessed through a URL of the type:
http://dxxx2:1080/subversion (works in a web browser)
This works fine for Tortoise. No problems there. I'm trying to write a batch file to to pull down a single trunk file into a Unit Test folder for testing. All of my attempts at accessing by using the above URL results in errors saying that the URL cannot be found. For example:
When I use the form:
svn checkout file:///subversion/Firmware/2-branches//02_Initializations.c
I receive the following:
C:\>checkout_target.bat
C:\>svn checkout file:///subversion/Firmware/2-branches//02_Initializations.c
svn: E180001: Unable to connect to a repository at URL 'file:///subversion/Firmware/2-branches/02_Initializations.c'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///subversion/Firmware/2-branches/02_Initializations.c'
When I use the form:
svn checkout http://dxxx2:1080/subversion/Firmware/2-branches/02_Initializations.c
I receive the following:
C:\>checkout_target.bat
C:\>svn checkout http://dxxx2:1080/subversion/Firmware/2-branches//02_Initializations.c
svn: E170000: URL 'http://dxxx2:1080/subversion/Firmware/2-branches/02_Initializations.c' doesn't exist
How do I access our SVN through a command-line command that doesn't balk at the URL or port number?
Or how do I find the local network address of our SVN server so that I can access through a script?
You must read SVN Book
You must understand SVN Book basics
After 1-2 you'll never use svn co with file-URL, only with directory-URL
svn checkout http://dxxx2:1080/subversion/Firmware/2-branches/02_Initializations.c will not work and must not work
svn checkout http://dxxx2:1080/subversion/Firmware/2-branches/ will work and must work

stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC

Before anyone guns me down..I have looked at all the messages that has this error but they seem to manifest from a different problem,I couldn't get any substantial information. Following are the errors I'm running into in the git polling log...
I don't have a clue regarding error #1,please provide inputs
For this,I read on other questions that $GERRIT_REFSPEC gets filled in dynamically when there is a gerrit trigger but i don't understand why I keep seeing this in the git poll log. How can I fix this ?
Error messages:
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command "/usr/bin/git fetch -t ssh://company.com:29418/platform/vendor/proprietary/mla.git $GERRIT_REFSPEC" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC
Go to the Job's Configure page and search to check This build is parameterized box.
Then set Name to GERRIT_REFSPEC
and Default value to refs/heads/master.
It took me some time to search for how to add this string parameter mentioned in the Gerrit Trigger plugin manual. I use Jenkins 1.567 with Gerrit Trigger 2.11.1.
As of May 2016, this error may be result of fix for SECURITY-170 introduced in Jenkins 2.3 or 1.651.2.
From wiki:
In a May 2016 security advisory, a vulnerability was announced (SECURITY-170 / CVE-2016-3721) whereby attackers could potentially exploit the fact that certain Jenkins plugins allow the definition of arbitrary build parameters — which are in turn injected into the build envirionment.
The fix for this issue — which was first included in Jenkins versions 1.651.2 and Jenkins 2.3 — means that only build parameters that have been explicitly defined in a job's configuration will be available by default at build time. Any other arbitrary parameters added to a build by plugins will not be available by default.
As there are a number of plugins that rely on the behaviour in older Jenkins versions, upgrading to 1.651.2 or 2.3 means that certain build behaviours may be broken.
One of the affected plugins is the Gerrit Trigger. The issue you should watch for updates is here.
However, please note that the Rado's solution to definine the GERRIT_REFSPEC parameter manually in build config can solve this problem temporarily if you build only one branch from Gerrit.
A workaround is available by adding the following JAVA_ARGS to /etc/default/jenkins on ubuntu
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.keepUndefinedParameters=true"
You could also add which variables should be allowed
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.safeParameters=GERRIT_REFSPEC,GERRIT_BRANCH
Looks like you ran a Jenkins Gerrit Trigger build manually? The trigger page says,
Using "Build Now"
[..]
Add a String parameter called GERRIT_REFSPEC with the default value refs/heads/master
https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger
After solving this issue if Jenkins is still not pulling the latest code commit(un-merged) then, need to Add Additional Behaviours -> Strategy for choosing what to build -> Gerrit Trigger
Reference: Thanks to Fabian

Resources