Configuring Jenkins with Bitbucket URL - java

I am trying to configure a maven job to run in jenkins - I have been getting the following error for some time now (with other variations dependant on what I change)
Failed to connect to repository : Failed to connect to
https://bitbucket.org/rickilambert/secondstoryuk/Core.git using
credentials (status = 404)
I have tried many variations of connection URL inclusive of the 2 most recommended on stack overflow
https://<user>:<pass>#bitbucket.org/<user>/<project>.git
https://bitbucket.org/<username>/<project>.git
Both to no avail - has anyone come across an error like this before or indeed have any idea how to fix it? For reference Jenkins is running the GIT plugin version 2.2.2
Thanks

404 error means the url does not exist.
You should double check if the url is valid or not.

Related

IntelliJ 2019.2.2: Unable to debug gradle unit tests

Every time I try to debug one of my tests (junit 5), I get an exception:
2019-12-20 10:40:53,776 [4972237] WARN - .ExternalSystemTaskDebugRunner - Interrupted function call: accept failed
java.net.SocketException: Interrupted function call: accept failed
at java.base/java.net.PlainSocketImpl.accept0(Native Method)
at java.base/java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:159)
at java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:458)
at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:551)
at java.base/java.net.ServerSocket.accept(ServerSocket.java:519)
at com.intellij.openapi.externalSystem.service.execution.ForkedDebuggerThread.run(ForkedDebuggerThread.java:103)
I've done quite a bit of searching through SO here, and have found several people that had similar problems. Most of them were resolve simply by upgrading (to 2013 or whatever, these questions aren't exactly spring chickens). The rest required some special sauce relevant to their system (android stuff mostly). Or they're getting a different exception (being disconnected, where I'm never getting the connection in the first place).
These tests (unit tests for the most part) are attached to a module with no "main".
I've tried launching gradlew -DtestDebug.test=true cleanTest test, and then connect with a remote debug session. I get an error: Unable to open debugger port (localhost:5005); java.net.ConnectException "Connection refused: connect", which I believe is just what IntelliJ's gui shows when it receives the aforementioned exception.
Ideally, I'd like to set my breakpoints, debug-launch my test task (perhaps specifying a class or individual #Test), and it'd Just Work.
Does anyone have any other ideas I could try? Logs I could look at?
The workaround is to switch the build/run actions to IntelliJ IDEA instead of using Gradle.
But if you still have this issue in the current IDE version, please consider reporting it with the sample project and the logs (Help | Compress Logs and Show in ...) attached.

issue when using SMTP and javax.mail

I am using the following in my sbt build file (versions are mentioned in the build file):
"javax.mail" % "javax.mail-api" % "1.5.5",
"javax.mail" % "mail" % "1.4.7",
I can run the application that runs the following code on one computer but not another. I have tried clearing up the ivy cache and reloading the javax mail packages but that has not helped. Any idea what I might be doing wrong?
final Transport transport = session.getTransport(prop.getProperty("mail.smtp.protocol"));
transport.connect(prop.getProperty("smtp.username"), "");
The properties being used are not null and are being used locally on one computer (and also by another process on the same computer where I am running into issues - that process is no longer running on that computer and should not have an open transport connection).
Exception
java.lang.NoSuchMethodError: com.sun.mail.util.TraceInputStream.<init>(Ljava/io/InputStream;Lcom/sun/mail/util/MailLogger;)V
at com.sun.mail.smtp.SMTPTransport.initStreams(SMTPTransport.java:2014)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1936)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:192)
com.sun.mail.smtp.SMTPTransport v1.4.7
private void More ...initStreams() throws IOException {
2011 boolean quote = PropUtil.getBooleanSessionProperty(session,
2012 "mail.debug.quote", false);
2013
2014 traceInput =
2015 new TraceInputStream(serverSocket.getInputStream(), traceLogger);
Any thoughts on how I should go about troubleshooting this? I have tried running the session in debug:
session.setDebug(true);
I do not think its a firewall issue because I can run another process using the same SMTP config (host/port/credentials) and that is able to connect without any exceptions.
The issue was caused by transitive dependency in the build file (whereby another dependency was pulling an older version of javax.mail for the application). Excluding the transitive dependency (using the exclusion rule in sbt) should resolve the issue.
This error is related to a missing smtp.jar on your classpath.
You can download it as part of the JavaMail API here

Jenkins Maven SoapUI Java403 Forbidden error

I have an automation which is written in SoapUI. I am kicking it off using Java/Maven/SoapUI API. Basically I can kick off soapUI automation from Java > Project > Run As> Maven Test. It works perfectly.
Now I committed my project to SVN and Integrating to local Jenkins. When I click Build now, I get following error.
23:11:49,514 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
23:11:49,514 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /myApp/ProcessorService HTTP/1.1
23:11:50,377 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 403 Forbidden
23:11:50,388 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive for 15000 MILLISECONDS
One thing i wanted to to mention is that my SoapUI project has some security (.JKS) files. I am not sure it is causing the problem or not.
Also whenever I run a job through jenkins, it tries to create soapui-settings.xml in C: drive. As this is my organization laptop, I do not have access to create a file in C Drive. Not sure this could be a problem or not.
Please help.
Thanks,

Boot2Docker TLS issue with buildDocker

I am exploring docker to deploy my dockerized java sample project on windows7 using boot2Docker. When I am building the dockerized java app using command ./gradlew build buildDocker. I am getting an issue as follows:
Execution failed for task ':buildDocker'.
> javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
My build.gradle file had docker settings as follows:
docker {
useApi true
hostUrl 'https://192.168.59.103:2376'
}
I searched for some probable solution for the same and got this link. I tried both the workarounds but none working for me. For the first approach i.e. changing profile and tried building again the project also failed with above error.
In the second workaround, I tried to install and run
$(docker run sequenceiq/socat)
the command downloaded the package and runned as well. But when I tried to check the running images using command docker ps, Nothing came in result set.
After that I tried pinging using curl http://192.168.59.103:2375/_ping returned error as curl: (7) Failed to connect to 192.168.59.103 port 2375: Connection refused
Anyway I changed my docker configuration in build.gradle file as follows:
docker {
useApi true
hostUrl 'http://192.168.59.103:2375'
}
And run the build command i.e. ./gradlew build buildDocker again to get below error:
Execution failed for task ':buildDocker'.
> org.apache.http.conn.HttpHostConnectException: Connection to http://192.168.59
.103:2375 refused.
So it seems both the workaround is not working for me. Any one faced the same and have any clue about what I am missing here.

Hudson build fails due to SVNAuthenticationException

I am getting an unexpected error when trying to build a project with Hudson. I have a valid account with which I can checkout to the machine on which Hudson is installed. I have updated from Hudson UI the authentication parameters to this account.
Has anyone else encountered this?
hudson.util.IOException2: revision check failed on https://SVN Location
at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:157)
at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:99)
at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:504)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:621)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1095)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1280)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:139)
Caused by: org.tmatesoft.svn.core.SVNAuthenticationException: svn: OPTIONS of '/SVN Location': 403 Forbidden (https://SVN)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:62)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:610)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:273)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:261)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1001)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:178)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:851)
at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:1016)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:891)
at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:823)
at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:145)
... 10 more
I had this problem. And after spending a day researching ssl and http interactions, I discovered that it was in fact an authentication problem.
in jenkins v1.534
the (encrypted) credentials in
/opt/jenkins/jobs/JOBNAME/subversion.credentials
and
/opt/jenkins/hudson.scm.SubversionSCM.xml
Were out of date AND out of sync. And to make diagnosis more difficult they were cached, and overwritten every time I ran a job. So I had to restart the jenkins service every time I changed those files.
Did you use the correct URL for SVN. This is a common error when the capitalization is not correct. Maybe the URL is not SVN_Location but Svn_location

Categories