Modify

Opened 4 years ago

Closed 6 weeks ago

#7041 closed defect (fixed)

XML-RPC access to trac-hacks.org disabled (forbidden access)

Reported by: egavaldo Owned by: osimons
Priority: low Component: XmlRpcPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

Hi there,
Not sure this is the right place to post this. when I'm trying to use the XML-RPC plugin via my Java client (and the example library provided), I'm always getting this exception:

java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.query(Unknown Source)
	at com.xqual.xstudio.sql.external_bugtracking.trac_0_11_x.CStudioXmlRpcTrac_0_11_x_Engine.<init>(CStudioXmlRpcTrac_0_11_x_Engine.java:70)
	at com.xqual.xstudio.sql.external_bugtracking.trac_0_11_x.CStudioXmlRpcTrac_0_11_x_Engine.main(CStudioXmlRpcTrac_0_11_x_Engine.java:313)
Caused by: org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server returned unexpected status: Forbidden
	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)

however, my code is pretty simple and should be correct:

	    try {
		    xmlRpcClientConfig = new XmlRpcClientConfigImpl();
			xmlRpcClientConfig.setServerURL(new URL("http://trac-hacks.org/login/xmlrpc"));
			xmlRpcClientConfig.setBasicUserName("egavaldo");
			xmlRpcClientConfig.setBasicPassword("<my password>");
			//xmlRpcClientConfig.setConnectionTimeout(60 * 1000);
			//xmlRpcClientConfig.setReplyTimeout(60 * 1000);
			//xmlRpcClientConfig.setEnabledForExtensions(true); // ?

		    xmlRpcClient = new XmlRpcClient();
			xmlRpcClient.setConfig(xmlRpcClientConfig);
			//xmlRpcClient.setTransportFactory(new XmlRpcCommonsTransportFactory(xmlRpcClient)); //?

			xmlRpcProxy = new TrackerDynamicProxy(xmlRpcClient);
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return;
		}

		System.out.println("about to execute a command...");

		// get some information !!!
        Ticket ticket = (Ticket)xmlRpcProxy.newInstance(Ticket.class);

        try {
			//Vector vector = ticket.getTicketFields();
        	//Vector vector = ticket.get(new Integer(5896));
        	Vector vector = ticket.query(); //owner=egavaldo

			System.out.println("- - - - - result = " + vector);
		} catch (Exception e) {
			e.printStackTrace();
		}

This sniplet should connect to the TRAC live instance (http://trac-hacks.org/login/xmlrpc) with my own credentials... but it looks there are some rights problems.
Any help?
Many thanks in advance,
Eg
*

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by osimons

  • Priority changed from high to low
  • Summary changed from forbidden access to XML-RPC access to trac-hacks.org disabled (forbidden access)

Yes, it should. But it won't as you and everyone else don't actually have permission to use XML-RPC at trac-hacks.org anymore. Try login/xmlrpc using your credentials to verify that.

This Trac is currently running old 0.10.x, and the XmlRpcPlugin code from that era does not play nicely with things like spam filter and so on. As an endless stream of test & spam tickets and wiki edits arrived, we saw no other good solution than to disable RPC access. It will return once the site gets updated to Trac 0.11.x or later, and using the latest XmlRpcPlugin version.

I've renamed the summary and will keep the ticket open as a reminder.

comment:2 Changed 4 years ago by egavaldo

Ok, thank you very much. I'll install Trac somewhere to test my code then.
Thanks,
Eg
*

comment:3 Changed 6 weeks ago by olemis

  • Resolution set to fixed
  • Status changed from new to closed

This is working now , see http://trac-hacks.org/blog/2014-02-08-xml-rpc-is-back . Unless I am missing something this ticket should be closed .

comment:4 Changed 6 weeks ago by olemis

  • Resolution set to fixed
  • Status changed from new to closed

This is working now , see http://trac-hacks.org/blog/2014-02-08-xml-rpc-is-back . Unless I am missing something this ticket should be closed .

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.