Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12420 closed defect (worksforme)

Ticket Query doesn't return all matching tickets for a query.

Reported by: anonymous Owned by: osimons
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Olemis Lang Trac Release:

Description (last modified by Ryan J Ollos)

The function array ticket.query(string qstr="status!=closed") does not return all tickets from my server which meet the desired criteria. I have a component with over 30 tickets called D2D. When I run: p.ticket.query("component=D2D") I get the following output:

>>[37, 38, 65, 66, 69, 72, 71]

I also cannot return a query with multiple parameters. For instance p.ticket.query("component=D2D & priority=major") returns:

>>[]

What is the correct syntax?

Attachments (2)

queryError.PNG (41.7 KB) - added by anonymous 9 years ago.
queryTest.PNG (38.0 KB) - added by anonymous 9 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 9 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 in reply to:  description Changed 9 years ago by Olemis Lang

Replying to anonymous:

The function array ticket.query(string qstr="status!=closed") does not return all tickets from my server which meet the desired criteria.

I'll take a look at this in a while . Could please mention the versions of Trac and installed plugins ?

[...]

I also cannot return a query with multiple parameters. For instance p.ticket.query("component=D2D & priority=major") returns:

>>[]

What is the correct syntax?

Have you tried p.ticket.query("component=D2D&priority=major") (i.e. no whitespace chars ;) ?

comment:3 Changed 9 years ago by anonymous

Trac version: 1.0

tracxmlrpc 1.1.2

No whitespace characters resolved the problem of multiple parameters.

comment:4 Changed 9 years ago by Olemis Lang

osimons could you please check ? I do not have Trac 1.0 installed in my dev machine :-/

comment:5 in reply to:  3 Changed 9 years ago by osimons

Replying to anonymous:

No whitespace characters resolved the problem of multiple parameters.

Goodie.

It is very difficult to test your queries for data in you own installation. What RPC does is really execute the query just as if it was called by a user in the Trac query module. Therefore if you went to Custom Query and performed the same query, the results should be identical (like /query?component=D2D in your own Trac instance).

If the lists are not identical, the first place to look is permissions. Perhaps the login from the browser session is different from the RPC request that may use a different user – or even anonymous?

If you turn on Trac debug logging (see TracLogging), the RPC plugin should report a great deal of information about the user making requests, the input received, the permissions checks performed, and the output returned:

[logging]
log_level = DEBUG

... and then have a look at log/trac.log in your project folder.

comment:6 Changed 9 years ago by anonymous

Both logins are identical. I gave 'Trac Admin' permissions to all groups to make sure, and nothing changed. The log/trac.log file doesn't give any indication that the user doesn't possess the required permissions, but the dates in the log file only go to 6/9/2015. It seems that only tickets with type='task' are returned by the RPC request. I cannot find anywhere that may restrict the permissions for type. There are 3 additional types (support, defect, enhancement). Any idea where the discrepancy may be occurring?

Changed 9 years ago by anonymous

Attachment: queryError.PNG added

Changed 9 years ago by anonymous

Attachment: queryTest.PNG added

comment:7 Changed 9 years ago by anonymous

Unsure if it is related, but I ran an example from the XmlRpcPlugin site:

The following error occurred at the server.ticket.query method:

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:8 Changed 9 years ago by Ryan J Ollos

Are you using AgiloForTrac?: #11847.

comment:9 Changed 9 years ago by anonymous

It is disabled right now, so no.

comment:10 Changed 9 years ago by anonymous

Blackmagictickettweaks 0.12.2 is the only plugin that could play a role, but I haven't changed the permissions for any fields and the 'type' field isn't being tweaked.

comment:11 in reply to:  9 Changed 9 years ago by osimons

Replying to anonymous:

It is disabled right now, so no.

I'm not sure disabling will be enough as Agilo code can still load behind the scenes even though visual traces may be gone. The way plugins work is that all code must actually be loaded into Python process in order to discover the possible components, and only then for each interface decide which classes of which plugins should be in the set to be called for the various hooks. Agilo changes Trac at a very deep level, and will likely go well beyond the ordinary plugin mechanisms in order to inject the necessary code behind the scenes.

Could you please try to actually delete the Agilo plugin code (or at least move it out of any path that loads Trac plugins). Then restart your Trac server process.

comment:12 Changed 9 years ago by anonymous

It isn't in the plugins folder. It isn't in the configuration file. It only appears on the TracAdmin Plugins list. So I believe it has previously been deleted.

comment:13 Changed 9 years ago by osimons

If it is in the Plugins list, it actually loads.

See "About Trac" as TRAC_ADMIN to see where Trac found the plugin.

comment:14 Changed 9 years ago by anonymous

It cannot be deleted because it is being used in a different site by another development team within my company.

comment:15 Changed 9 years ago by osimons

Resolution: worksforme
Status: newclosed

If so, you need to separate the sites by ensuring that they run in different processes (Python intepreters). Then it is possible to have different set of local plugins (while globally installed plugins will load regardless).

Anyway, this is an installation issue and not an issue with the plugin itself.

comment:16 Changed 9 years ago by anonymous

The plugin could be enhanced so that it is compatible with Agilo. Even if I ensured that the sites ran in different processes, we will be using Agilo shortly and the resolution would be invalid. There needs to be XmlRpc compatibility with Agilo.

I'm not convinced that the problem is related to Agilo. All other aspects of the XmlRpcPlugin work as desired. Some most elements of the ticket query work as well. This seems like a plugin issue.

comment:17 Changed 9 years ago by osimons

comment:2:ticket:6297 – actually the other way around...

comment:18 Changed 9 years ago by anonymous

Why is the on site query unaffected by Agilo if the XmlRpc plugin algorithm works as you say it does? comment:5

comment:19 Changed 9 years ago by osimons

That is a question for the Agilo people to answer. If you can close the other site for a couple of minutes and temporarily remove the Agilo plugin (or configure a separate environment for testing), I'm sure you can get some interesting questions to ask when comparing web & rpc queries with & without Agilo installed.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.