gerrit associate Jira issues to Git commits return 401 - jira

My gerrit checking Jira connectivity ... [OK]
But git push has an error:request failed
Please help me.
Here are my configurations and operations:
gerrit configurations:
*** Jira connectivity
***
Jira URL (empty to skip) [http://jira]:
Jira username [jiraxx]:
Change jirasa's password [y/N]?
Connection timeout [120000 ms]:
Read timeout [30000 ms]:
Test connectivity to http://jira/ [y/N]? y
Checking Jira connectivity ... [OK] - Jira Ver8
*** Jira issue-tracking association
***
Jira issue-Id regex [([A-Z]+-[0-9]+)]:
What html would you like to use? [$1]:
Issue-id enforced in commit message [suggested/?]:
git push:
[root#git]# git add .
[root#git]# git commit -m "TEST-1"
[root#git]# git push origin HEAD:refs/for/master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 341 bytes | 341.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: refs: 1, new: 1, done
remote: commit 0779d4a: Failed to check whether or not issue TEST-1 exists, due to connectivity issue. Com mit will be accepted.
remote: java.io.IOException: Request failed: http://jira/rest/api/2/issue/TEST-1 - 401 - null
remote:
remote: SUCCESS
remote:
remote: http://gerrit/c/gitrepo/+/18019 TEST-1 [NEW]
remote:
To ssh://gerrit:29418/gitrepo
* [new branch] HEAD -> refs/for/master

Since a 401 HTTP error means the client request has not been completed because it lacks valid authentication credentials for the requested resource:
either your Jira credentials are not valid (despite the "Checking Jira connectivity" step)
or you need to use a proxy to access said Jira, proxy requiring authentication.
Don't forget those error messages are coming from the remote Gerrit server, meaning that a "Test connectivity to http://jira" done locally would not implies that the remote Gerrit server can do the same.

Related

HEAD is now at 253c43d25 Merge pull request #13060 from Random

Press RETURN/ENTER to continue or any other key to abort:
/usr/bin/sudo/usr/sbin/chown
-R ahmedkahie: admin /opt/homebrew
Downloading and installing Homebrew..
HEAD is now at 253c43d25 Merge pull request #13060 from RandomDSdevel/revert-130
44-taps-rubocop-config
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument
'refs/remotes/origin/master': unknown revision or path
not in the working tree
Use
to separate paths from revisions, like this:'git [‹revision>[‹file>.. ]
It seems like the installation is stuck but you just need to wait until you get this message:
fatal: Could not resolve HEAD to a revision
==> Installation successful!
Ignore the error as the installation should still be successful.

Is it possible to push changes into a branch which is already merged in Gerrit

I have a branch named bugs_feature which i have already merged into develop branch. Next time when i work on the same branch which has fix for some other bug, Can i push that fix for code review to same branch bugs_feature which is already in merged state.
I have tried with below commands, but it din't work
xxxx#xxxx-MacBook-Pro SampleApp % git commit -m "Fixed issue HRODS-945"
[bugfix_dashboard 226f6b6] Fixed issue HRODS-945
5 files changed, 78 insertions(+), 45 deletions(-)
xxxx#xxxx-MacBook-Pro SampleApp % git push
"https://xxxx#reviewba.xxxxx.com:8459/a/Sample/Sample-mobile-app"
HEAD:refs/for/bugfix_dashboard
Counting objects: 34, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (34/34), 4.43 KiB | 1.48 MiB/s, done.
Total 34 (delta 19), reused 0 (delta 0)
remote: Resolving deltas: 100% (19/19)
remote: Processing changes: refs: 1, done
To https://reviewba.xxxx.com:8459/a/Sample/sample-mobile-app
! [remote rejected] HEAD -> refs/for/bugfix_dashboard (change
https://reviewba.xxxxx.com:8459/c/Sample/sample-mobile-app/+/185 closed)
error: failed to push some refs to
'https://xxxxxx#reviewba.xxxxx.com:8459/a/Sample/sample-mobile-app'
Even tried with git commit --amend and modified the changed Id, so gerrit might consider it as a new push for code review.
Is it because the branch is already in merged i'm not able to push or Gerrit doesn't support pushing code to a already merged branch.
Thanks.
This worked for me after following the hint from the git command prompt message.
remote: ERROR: commit ac81273: invalid Change-Id line format in message footer
remote:
remote: Hint: run
remote: git commit --amend
remote: and move 'Change-Id: Ixxx..' to the bottom on a separate line
remote:
Step 1 : After using the git commit -amend
when you enter into the edit format of the earlier commit message screen.
Step 2 :Go to line of the Change ID and move it to couples of lines down and on Top
Step 3 :Type Change Id: "your commit Id goes here"(should be like the below format).
It starts with an uppercase I;
It contains 32 hexadecimal characters;
One sample format could be :
I201611160832aa0000000000786176696572
It starts with the date and time (YYYYMMDDHHMM), followed by a separator, and then the name of the committer in hexa format (here i used ascii, but one could use another format), padded with 00.

Pushing to the repository created by Gitlab fails with error

An error occurred when pushing to the repository created by GitLab,
I wanted to give advice.
Push operation itself, from Windows 10 PC,
I did it using TortoiseGit.
[Error message displayed]
git.exe push --progress "origin" master: master
Enumerating objects: 8, done. Counting objects: 100% (8/8), done.
Delta compression using up to 8 threads. Compressing objects: 100%
(3/3), done. Writing objects: 100% (6/6), 532 bytes | 532.00 KiB / s,
done. Total 6 (delta 0), reused 1 (delta 0) remote:
/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb:153:in
parse_who ': undefined method start_with?' for nil: NilClass
(NoMethodError) remote: from
/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb: 31: in
check_access' remote: from
/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:27:in
block in exec ' remote: from
/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_metrics.rb: 50:
in measure ' remote: from
/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:26: in
exec ' remote: from hooks / pre-receive: 30: in ` ' To ssh: //
: / ~ / /test_system.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh: // git # : / ~ / /test_system.git'
git did not end normally (exit code 1) (1125 ms # 2018/10/21 16: 47:
10)
I would be pleased if you give me advice.
Thank you.
Additional Information:
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.4.4p296
Gem Version: 2.7.6
Bundler Version:1.16.2
Rake Version: 12.3.1
Redis Version: 3.2.11
Git Version: 2.18.1
Sidekiq Version:5.1.3
Go Version: unknown
GitLab information
Version: 11.3.5
Revision: c74e8d9
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL:
HTTP Clone URL:
SSH Clone URL:
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 8.3.3
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
I don't think it comes from TortoiseGit in itself. But more likely that the default setting of Gitlab is to protect the master branch. See Gitlab protected branches
In your case, you can see the main error is :
"! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs"
It means that your remote (here, your Gitlab server) is rejecting the push for the reason "pre-receive hook declined".
To change that, go to : Project > Settings > Repository > Protected branches
Here you can remove or add protected branches, and you can edit push settings for protected branches.

Jenkins-Testlink integration - HTTP server returned unexpected status: Found

I’m trying to connect Jenkins (1.482) with TestLink (1.9.4) thru Jenkins configuration in order to retrieve tests, but while running the job in Jenkins I get the below error in the console log.
Please note that Jenkins is hosted on tomcat (linux) on network“gnb” and Testlink is hosted on php (linux) on another network “<company network name>”. It works well when both are on my localhost (in windows)
but this integration does not work when both Jenkins and TestLink are on separate networks/hosts.
I get the below error on the console while running the job:
Preparing TestLink client API.
Using TestLink URL: http://<hostname>/mr61_php5/testlink/lib/api/xmlrpc.php
FATAL: Error verifying developer key: HTTP server returned unexpected status: Found
br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException: Error verifying developer key: HTTP server returned unexpected status: Found
at br.eti.kinoshita.testlinkjavaapi.MiscService.checkDevKey(MiscService.java:66)
at br.eti.kinoshita.testlinkjavaapi.TestLinkAPI.(TestLinkAPI.java:162)
at hudson.plugins.testlink.TestLinkBuilder.getTestLinkSite(TestLinkBuilder.java:244)
at hudson.plugins.testlink.TestLinkBuilder.perform(TestLinkBuilder.java:134)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1502)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Caused by: org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server returned unexpected status: Found
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at br.eti.kinoshita.testlinkjavaapi.BaseService.executeXmlRpcCall(BaseService.java:90)
at br.eti.kinoshita.testlinkjavaapi.MiscService.checkDevKey(MiscService.java:62)
... 12 more
ERROR: Error communicating with TestLink. Check your TestLink configuration.
I have below settings in my Jenkins’s global configuration for Testlink installation
Name: testlink
URL: http://<host name>/mr61_php5/testlink/lib/api/xmlrpc.php
Developer key: generated from Testlink (Settings->Generate a new key)
Can you please point me if I miss something?
Usually in the Testlink folder structure, the path that you have mentioned, does not contain the xmlrpc.php file
Probabaly worng URL: URL: http:///mr61_php5/testlink/lib/api/
The correct URL is usually of this format
.../testlink/lib/api/xmlrpc//xmlrpc.php
Kindly check the correct URL, or try opening the xmlrpc.php page, so that you can get the correct path of the file. As per my assumption it should be somewhat like this:
http:///mr61_php5/testlink/lib/api/xmlrpc/xmlrpc.php
Good answer In my case it is as below...
http://IP:PORT/testlink/lib/api/xmlrpc/v1/xmlrpc.php in 1.9.11 version of testlink

reviewboard: post-review error uploading diff with basedir configuration error

I'm working in Ubuntu and I want to use post-review to create a new review request for reviewboard with a manually-generated .diff file but failed.
I worked on post-review for most time of today but find myself stuck on this postbasedir problem. I asked three of my colleagues to sit on my seat to solve this problem but they too found themselves run out of effective solutions.
here is the problem:
I set repoistory and reviewboard_url in the .reviewboardrc file, I'm sure the two settings are ok because the request was successfully created in review board and the repository points to the directory where the target file resides.
here is the content of .reviewboardrc:
============================= .reviewboardrc ===============================
REVIEWBOARD_URL = "http://10.22.200.166:8088"
REPOSITORY = "http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk"
============================================================================
I run post-review as follows but failed on uploading the Doxyfile.diff file and here is the content of it:
============================== Doxyfile.diff ================================
Index: Doxyfile
===================================================================
--- Doxyfile (revision 107236)
+++ Doxyfile (working copy)
## -1,3 +1,5 ##
+#POST_REVIEW_TEST
+POST_REVIEW_TEST =
# Doxyfile 1.7.6
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
=============================================================================
and the output error message with debug info enabled
====================== err msg ===============================================
houchenxi#houchenxi-PC:~/renren-wap-talk$ post-review -dp --diff-filename=Doxyfile.diff
>>> RBTools 0.4.2
>>> Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1]
>>> Running on Linux-3.0.0-22-generic-x86_64-with-Ubuntu-11.10-oneiric
>>> Home = /home/houchenxi
>>> Current Directory = /home/houchenxi/renren-wap-talk
>>> Checking the repository type. Errors shown below are mostly harmless.
DEBUG:root:Checking for a CVS repository...
DEBUG:root:Checking for a ClearCase repository...
DEBUG:root:Checking for a Git repository...
DEBUG:root:Running: git rev-parse --git-dir
DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
---
DEBUG:root:Checking for a Mercurial repository...
DEBUG:root:Running: hg showconfig
DEBUG:root:Running: hg root
DEBUG:root:Command exited with rc 255: ['hg', 'root']
abort: no repository found in '/home/houchenxi/renren-wap-talk' (.hg not found)!
---
DEBUG:root:Checking for a Perforce repository...
DEBUG:root:Checking for a Plastic repository...
DEBUG:root:Checking for a Subversion repository...
DEBUG:root:Running: svn info http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk
DEBUG:root:Running: diff --version
DEBUG:root:repository info: Path: http://svn.d.xiaonei.com/wap, Base path: /renren/renren-wap-talk/trunk, Supports changesets: False
>>> Finished checking the repository type.
>>> HTTP GETting api/
>>> HTTP GETting http://ourhost:8088/api/info/
>>> Using the new web API
>>> HTTP GETting http://ourhost:8088/api/repositories/
>>> Attempting to create review request on http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk for None
>>> HTTP POSTing to http://ourhost:8088/api/review-requests/: {'repository': 'http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk'}
>>> Review request created
>>> Uploading diff, size: 335
>>> HTTP POSTing to http://ourhost:8088/api/review-requests/130/diffs/: {'basedir': '/renren/renren-wap-talk/trunk'}
>>> Got API Error 207 (HTTP code 400): The file was not found in the repository
>>> Error data: {u'stat': u'fail', u'file': u'/renren/renren-wap-talk/trunk/Doxyfile', u'err': {u'msg': u'The file was not found in the repository', u'code': 207}, u'revision': u'107236'}
Error uploading diff
Your review request still exists, but the diff is not attached.
==========================================================================
In the err msg above we found that the basedir parameter {'basedir': '/renren/renren-wap-talk/trunk'} is incorrect, which is supposed to be the full path from "http",namely "http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk" , but no matter how we try to modify the .reviewboardrc or add command line arguments, we just cannot correct this value to the expected right value, we searched in the help info by running "post-review --help", but there just isn't the "--basedir" option available.
All I have to do is to correct the basedir value to the correct full path , either by modifying the .reviewboardrc or changing post-review arguments.
Does anyone have any similar experience for solving this problem, and suggestion is highly appreciated.
I believe your problem may be the correlation between the path of the SVN repository:
http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk
and the relative path in your diff file (the level at which it was generated in the hierarchy of folders):
Index: Doxyfile
Unless the file Doxyfile is situated directly in the trunk, you should try to re-create your diff at such a level so that the diff will contain the missing relative path between the trunk and Doxyfile:
Index: /missing/path/to/Doxyfile
..or to update your SVN URL in Reviewboard so that the URL contains itself the missing path.
You will find a detailed explanation of this correlation in this answer for the post: review board diff not uploading
HTH!

Resources