bloodhound-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olemis Lang <ole...@gmail.com>
Subject Re: xml-rpc ticket.delete ResourceNotFound: Ticket n does not exist
Date Wed, 19 Feb 2014 01:08:20 GMT
On 2/18/14, Mark Abbate <abbatemp@gmail.com> wrote:
> Hello All
>

Hi !
:)

> I greatly appreciate any help, and kudos for an extremely useful project.
>

Thanks !

> (1) Short version:
>
> I would like to submit and update tickets remotely using xml-rpc. I am
> using 0.7 and the suggested xml-rpc plugin version.
>

AFAICR in 0.7 some requests sent to global scope URLs are redirected
to default product .

> I can use curl or chrome-postman and get sensible answers to calls such
> as ticket.getTicketFields and wiki.getPage.I can also successfully use
> ticket.create.
>

Ok . What RPC URL are you using ?

  - http://host.tld/bh/login/rpc
  - http://host.tld/bh/login/products/PREFIX/rpc
  - http://host.tld/bh/products/PREFIX/login/rpc
  - ... something else ...

> However when I use ticket.update to put additional info into the ticket
> I get the error that the ticket does not exist.
> The simpler ticket.delete results in the same error. Other calls such as
> ticket.getActions that need the id also fail.
>

You have to put the request in the right product context , especially
if using PostgreSQL DB . Is this your case ?

> Then I tried trac-admin and also can not delete:
> Trac
> [/home/family/bloodhoundsvn/bloodhound/installer/bloodhound/environments/main]>
>
> ticket remove 2
> ResourceNotFound: Ticket 2 does not exist.
>

Tickets are bound to products . In recent versions of BH (i.e. 0.8-dev
/trunk) the command would be :

[/path/to/env]> product admin PREFIX ticket remove 2

>
> (2) Long version:
>
> I am by no means a trac/bloodhound/python expert, and do not fully
> understand how bloodhound provides the multi product functionality on
> top of trac.
>

Nevermind , that's what we are for ... It's all explained in
https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003

> The isolated multiproduct functionality is important for my application,
> so I have not gone back to a trac only install to test this.
>
> ticket.create is not quite enough for my needs, I also want to assign
> the ticket, and add successive comments and attachments.
>

There are recent reports of the RPC plugin working successfully
connected to Mylyn running BH=0.8-dev

[...]
>
> - Using:
>
> 4038685 Jan 22 15:55 /home/family/Downloads/apache-bloodhound-0.7.tar.gz
> I also ran from the svn co:
> svn co https://svn.apache.org/repos/asf/bloodhound/trunk bloodhound
> TRAC_VERSION 1.0.1
> Followed README.rst, using SQLite.
>
> http://localhost:8000/main/products/%40/rpc#rpc.ticket.version
> Remote Procedure Call (RPC), Installed API version : 1.4.1dev
>

Ok , that should be latest version .

> This is a fresh install. I created 3 tickets manually from the web UI.
> User mark has admin permissions, and XML_RPC.
>
[...]

Request and response are consistent with everything you were saying before .

>
> 2014-02-18 09:27:38,431 Trac[main] DEBUG: Dispatching
> <ProductRequestWithSession "POST '/login/xmlrpc'">

Try sending requests to /products/PREFIX/login/xmlrpc and please tell
us what you get .

[...]
> 2014-02-18 09:27:38,438 Trac[web_ui] DEBUG: RPC(XML-RPC) call by 'mark'
> ticket.delete

authentication is configured OK .

> 2014-02-18 09:27:38,440 Trac[web_ui] ERROR: RPC(XML-RPC) Error
> Traceback (most recent call last):
>    File "build/bdist.linux-x86_64/egg/tracrpc/web_ui.py", line 158, in
> _rpc_process
>      result = (XMLRPCSystem(self.env).get_method(method_name)(req,
> args))[0]
>    File "build/bdist.linux-x86_64/egg/tracrpc/api.py", line 197, in
> __call__
>      result = self.callable(req, *args)
>    File "build/bdist.linux-x86_64/egg/tracrpc/ticket.py", line 270, in
> delete
>      t = model.Ticket(self.env, id)
>    File
> "/home/family/bloodhoundsvn/bloodhound/trac/trac/ticket/model.py", line
> 82, in __init__
>      self._fetch_ticket(tkt_id)
>    File
> "/home/family/bloodhoundsvn/bloodhound/trac/trac/ticket/model.py", line
> 121, in _fetch_ticket
>      id=tkt_id), _("Invalid ticket number"))
> ResourceNotFound: Ticket 2 does not exist.
>
[...]

This should be happening because in 0.7 tickets created in global
scope via web UI are bound the ┬źdefault┬╗ product (deprecated in 0.8)
environment but RPC calls sent to /login/xmlrpc are handled by the
global environment . Different contexts => ticket not found .

-- 
Regards,

Olemis - @olemislc

Mime
View raw message