hi All,
This behavior was observed while trying to fix the below issue.
https://wso2.org/jira/browse/APPFAC-2853
We observed 401 error in Jenkins front just after deleting an application.
Steps to reproduce issue:
1. Create an application in AF.
2. Wait till tenant gets unloaded from BuildServer.
3. Delete the created application.
The job will be deleted from Jenkins.
The undeploy artifact call will fail with a 401 error in AF logs
Later it was found out that just after doDelete api is invoked, whatever
the call goes to Jenkins side fails with 401 error in AF side.
After trying curl commands it was observed that there is no problem in
Jenkins front.
curl -X POST -k -v -u jenkinssystemadmin:admin
https://jenkins.appfactory.private.wso2.com:9674/t/puva2.com/webapps/jenkins/job/bbbbbbbbbbbbbbo-trunk-default/doDelete
<https://www.google.com/url?q=https%3A%2F%2Fjenkins.appfactory.private.wso2.com%3A9674%2Ft%2Fpuva2.com%2Fwebapps%2Fjenkins%2Fjob%2Fbbbbbbbbbbbbbbo-trunk-default%2FdoDelete&sa=D&sntz=1&usg=AFQjCNFIwXyaoro2WsHk77Pt8VPOnITB6A>
curl -X POST -k -v -u jenkinssystemadmin:admin
https://jenkins.appfactory.private.wso2.com:9674/t/puva2.com/webapps/jenkins/job/kokokokokoko-trunk-default/buildWithParameters?isAutomatic=false&doDeploy=true&deployStage=Development&repoFrom=original&tenantUserName=admin%40puva2.com&persistArtifact=true&tagName=+
<https://www.google.com/url?q=https%3A%2F%2Fjenkins.appfactory.private.wso2.com%3A9674%2Ft%2Fpuva2.com%2Fwebapps%2Fjenkins%2Fjob%2Fkokokokokoko-trunk-default%2FbuildWithParameters%3FisAutomatic%3Dfalse%26doDeploy%3Dtrue%26deployStage%3DDevelopment%26repoFrom%3Doriginal%26tenantUserName%3Dadmin%2540puva2.com%26persistArtifact%3Dtrue%26tagName%3D%2B&sa=D&sntz=1&usg=AFQjCNFctCXe6ahwGHlRdaPKI_cLLsjmWQ>
Then the next observation was that doDelete api call results 302 once the
job is deleted successfully.
AF communicates with Jenkins via RestBasedJenkinsCIConnector.java singleton
class and it has a global HttpClient instance.
https://github.com/wso2/product-af/blob/master/modules/components/org.wso2.carbon.appfactory.build/src/main/java/org/wso2/carbon/appfactory/jenkins/build/RestBasedJenkinsCIConnector.java
There was no significance in deleteJob method compared to other methods
except the return HTTP response status code (i.e 302)
So we tried creating a new HttpClient instance only for deleteJob and it
fixed the issue.
So we concluded that the issue is with HttpClient, which has some issue in
handling 302.
Any similar experience?
--
Thanks and Regards,
Punnadi Gunarathna
Senior Software Engineer,
WSO2, Inc.; http://wso2.com <http://wso2>
Blog: http://hi-my-world.blogspot.com/
Tel : 94 11 214 5345
Fax :94 11 2145300
<http://lalajisureshika.blogspot.com/>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev