Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, which can be used to display tickets that meet specified criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page, the default filter will display tickets relevant to you:

  • If logged in then all open tickets, it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences, then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged in and no name/email is defined in the preferences, then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the dropdown lists at the bottom corners of the filters box; 'And' conditions on the left, 'Or' conditions on the right. Filters with either a text box or a dropdown menu of options can be added multiple times to perform an Or on the criteria.

For text fields such as Keywords and CC the - operator can be used to negate a match and double quotes (since 1.2.1) can be used to match a phrase. For example, a contains match for word1 word2 -word3 "word4 word5" matches tickets containing word1 and word2, not word3 and word4 word5.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

After you have edited your filters, click the Update button to refresh your results.

Keyboard shortcuts are available for manipulating the checkbox filters:

  • Clicking on a filter row label toggles all checkboxes.
  • Pressing the modifier key while clicking on a filter row label inverts the state of all checkboxes.
  • Pressing the modifier key while clicking on a checkbox selects the checkbox and deselects all other checkboxes in the filter. Since 1.2.1 this also works for the Columns checkboxes.

The modifier key is platform and browser dependent. On Mac the modified key is Option/Alt or Command. On Linux the modifier key is Ctrl + Alt. Opera on Windows seems to use Ctrl + Alt, while Alt is effective for other Windows browsers.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria , the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria, see Query Language.

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field>. You can specify multiple fields and what order they are displayed in by placing pipes (|) between the columns:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Full rows

In table format you can also have full rows by using rows=<field>:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 1265)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1725 duplicate NVMe pass-through support for Argon ONE M.2 Expansion Board (NVME) RobertCezar
Description

I tried to get info of Argon ONE M.2 Expansion Board (NVME), but got this error (I had to specify -d scsi by trial and error otherwise got error)

sudo smartctl /dev/sdb
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-6.1.21-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdb: Unknown SNT device type 'sntasmedia'
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

 sudo smartctl -a -d scsi /dev/sdb
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-6.1.21-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Argon
Product:              Forty
Revision:             0
Compliance:           SPC-4
User Capacity:        2,000,398,934,016 bytes [2.00 TB]
Logical block size:   512 bytes
LU is fully provisioned
Rotation Rate:        Solid State Device
Logical Unit id:      0x5000000000000001
Serial number:        50F000000000
Device type:          disk
Local Time is:        Sat May 13 10:38:14 2023 EEST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging

sudo smartctl -a -d sntrealtek /dev/sdb -r ioctl,2
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-6.1.21-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

 [NVMe call: opcode=0x06, size=0x1000, nsid=0x00000000, cdw10=0x00000001]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 00 10 06 01 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=0 milliseconds  resid=4096
  Incoming data trimmed to nothing by resid
 [NVMe call succeeded: result=0x00000000
 00     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 10     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
=== START OF INFORMATION SECTION ===
Model Number:
Serial Number:
Firmware Version:
PCI Vendor ID:                      0x0000
PCI Vendor Subsystem ID:            0x0000
IEEE OUI Identifier:                0x000000
Total NVM Capacity:                 0
Unallocated NVM Capacity:           0
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               0
Local Time is:                      Sat May 13 10:41:39 2023 EEST
Firmware Updates (0x00):            0 Slots
Optional Admin Commands (0x0000):   -
Optional NVM Commands (0x0000):     -
Log Page Attributes (0x00):         -
Maximum Data Transfer Size:         -
Warning  Comp. Temp. Threshold:     -
Critical Comp. Temp. Threshold:     -
Namespace 4294967295 Features (0x00):      -

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
 [NVMe call: opcode=0x02, size=0x0200, nsid=0xffffffff, cdw10=0x007f0002]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 00 02 02 02 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=4 milliseconds  resid=512
  Incoming data trimmed to nothing by resid
 [NVMe call succeeded: result=0x00000000
 00     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 10     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        -
Available Spare:                    0%
Available Spare Threshold:          0%
Percentage Used:                    0%
Data Units Read:                    0
Data Units Written:                 0
Host Read Commands:                 0
Host Write Commands:                0
Controller Busy Time:               0
Power Cycles:                       0
Power On Hours:                     0
Unsafe Shutdowns:                   0
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               -
Temperature Sensor 2:               -
Temperature Sensor 3:               -
Temperature Sensor 4:               -
Temperature Sensor 5:               -
Temperature Sensor 6:               -
Temperature Sensor 7:               -
Temperature Sensor 8:               -
Thermal Temp. 1 Transition Count:   0
Thermal Temp. 2 Transition Count:   0
Thermal Temp. 1 Total Time:         0
Thermal Temp. 2 Total Time:         0

 [NVMe call: opcode=0x02, size=0x0040, nsid=0xffffffff, cdw10=0x000f0001]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 40 00 02 01 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=0 milliseconds  resid=0
  Incoming data, len=64:
 00     50 00 00 00 00 00 00 01  00 b0 00 3c 00 00 00 01
 10     00 00 08 00 00 00 00 00  00 00 00 00 00 00 00 00
 20     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 30     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 [NVMe call succeeded: result=0x00000000
 00     50 00 00 00 00 00 00 01  00 b0 00 3c 00 00 00 01    P..........<....
 10     00 00 08 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 20     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
Error Information (NVMe Log 0x01, 1 of 1 entries)
Num   ErrCount  SQId   CmdId  Status  PELoc          LBA  NSID    VS
  0 72057594037928016 45056  0x3c00  0x0000  0x100       524288     0     -

#1722 duplicate error_log on Seagate FireCuda 510 NVMe (Debian 11 and 12) kolAflash
Description

I'm getting error_log entries for my Seagate FireCuda 510 SSD ZP2000GM30001. See the attachment. OS: Debian 11 and 12 (Linux 5.10 and 6.1)

I guess there's not really a hardware defect. Because the system is running totally fine. (yes, I do daily backups)

Maybe it's some bad NVMe commands like in #1663 !? If yes, how can I find out which commands and why they are being send? Is opening a ticket on https://bugzilla.kernel.org/ a good idea to get those bad NVMe commands fixed?

P.S. With Debian-12 this became more prominent, because now there's a graphical notification (smart-notifier).

Hard Disk Health Warning
The hard disk health status has changed. This could mean that hard drive failure is imminent. It is always a good idea to have up to date backups.
This message was generated by the smartd daemon running on:

   host name:  myhost
   DNS domain: mydomain

The following warning/error was logged by the smartd daemon:

Device: /dev/nvme0, number of Error Log entries increased from 343 to 345

Device info:
Seagate FireCuda 510 SSD ZP2000GM30001, S/N:XXXXXXXX, FW:STES1024, 2.00 TB

For details see host's SYSLOG.

You can also use the smartctl utility for further investigation.
The original message about this issue was sent at Fri Dec 25 13:31:06 2020 CET
Another message will be sent in 24 hours if the problem persists.
#1720 invalid Western Digital SN730 SDBQNTY-1T00-1001 displaying incorrect data opethfan91
1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (&). Each filter consists of the ticket field name, an operator and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

Filters combining matches and negated matches can be constructed for text fields such as Keywords and CC when using the contains (~=) operator. The - operator is used to negate a match and double quotes (since 1.2.1) are used for whitespace-separated words in a phrase. For example, keywords~=word1 word2 -word3 "word4 word5" matches tickets containing word1 and word2, not word3 and also word4 word5.

status=closed,keywords~=firefox query closed tickets that contain keyword firefox
status=closed,keywords~=opera query closed tickets that contain keyword opera
status=closed,keywords~=firefox opera query closed tickets that contain keywords firefox and opera
status=closed,keywords~=firefox|opera query closed tickets that contain keywords firefox or opera
status=closed,keywords~=firefox,or,keywords~=opera query closed tickets that contain keyword firefox, or (closed or unclosed) tickets that contain keyword opera
status=closed,keywords~=firefox -opera query closed tickets that contain keyword firefox, but not opera
status=closed,keywords~=opera -firefox query closed tickets that contain keyword opera, but no firefox

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be omitted to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

Note that modified is the last modified time, so modified with a date range shows ticket that were last modified in that date range. If a ticket was modified in the date range, but modified again after the end date, it will not be included in the results.


See also: TracTickets, TracReports, TracGuide, TicketQuery

Last modified 6 years ago Last modified on Nov 12, 2017, 2:15:51 PM