Version 2 (modified by 11 years ago) ( diff ) | ,
---|
Trac Ticket Queries
Table of Contents
In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of 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 and no name/email 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 pulldown 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 pulldown menu of options can be added multiple times to perform an or of the criteria.
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.
Once you've edited your filters click the Update button to refresh your results.
Navigating Tickets
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.
Using TracLinks
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:
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:
Using the [[TicketQuery]]
Macro
The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.
Example:
[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]
This is displayed as:
No results
Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language. This also allows displaying the link and description of a single ticket:
[[TicketQuery(id=123)]]
This is displayed as:
- #123
- Option DEVISCAN does not work on OpenBSD >= 4.8
A more compact representation without the ticket summaries is also available:
[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]
This is displayed as:
No results
Finally, if you wish to receive only the number of defects that match the query, use the count
parameter.
[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]
This is displayed as:
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 by placing pipes (|
) between the columns like below:
[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]
This is displayed as:
Results (1 - 3 of 1436)
Full rows
In table format you can also have full rows by using rows=<field> like below:
[[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 1436)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#1935 | duplicate | Problems with S.M.A.R.T (OMV - Short self-test on /dev/nvme0n1) | ||
Description |
Hello everyone, for some time now, Open Media Vault has been sending me the following error message: This message was generated by the smartd daemon running on: host name: omv-nas DNS domain: local The following warning/error was logged by the smartd daemon: Device: /dev/disk/by-id/nvme-CT4000P3SSD8_2342E88107D9, number of Error Log entries increased from 9 to 10 Device info: CT4000P3SSD8, S/N:2342E88107D9, FW:P9CR30A, NSID:1 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 Mon Feb 10 14:32:12 2025 CET Another message will be sent in 24 hours if the problem persists. When I try to run a "Short self-test" on the "/dev/nvme0n1" manually, omv outputs the following: smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.12.9+bpo-amd64] (local build) Copyright (C) 2002-22, Bruce Allen, Christian Franke, http://www.smartmontools.org === START OF INFORMATION SECTION === Model Number: CT4000P3SSD8 Serial Number: 2342E88107D9 Firmware Version: P9CR30A PCI Vendor/Subsystem ID: 0xc0a9 IEEE OUI Identifier: 0x00a075 Controller ID: 1 NVMe Version: 1.4 Number of Namespaces: 1 Namespace 1 Size/Capacity: 4,000,787,030,016 [4.00 TB] Namespace 1 Formatted LBA Size: 512 Namespace 1 IEEE EUI-64: 6479a7 8440000039 Local Time is: Tue Feb 18 15:25:34 2025 CET Firmware Updates (0x12): 1 Slot, no Reset required Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test Optional NVM Commands (0x005e): Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp Log Page Attributes (0x06): Cmd_Eff_Lg Ext_Get_Lg Maximum Data Transfer Size: 64 Pages Warning Comp. Temp. Threshold: 85 Celsius Critical Comp. Temp. Threshold: 95 Celsius Supported Power States St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat 0 + 6.00W 0.0000W - 0 0 0 0 0 0 1 + 3.00W 0.0000W - 0 0 0 0 0 0 2 + 1.50W 0.0000W - 0 0 0 0 0 0 3 - 0.0250W 0.0000W - 3 3 3 3 5000 1900 4 - 0.0030W - - 4 4 4 4 13000 100000 Supported LBA Sizes (NSID 0x1) Id Fmt Data Metadt Rel_Perf 0 + 512 0 1 1 - 4096 0 0 === START OF SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED SMART/Health Information (NVMe Log 0x02) Critical Warning: 0x00 Temperature: 41 Celsius Available Spare: 100% Available Spare Threshold: 5% Percentage Used: 0% Data Units Read: 209,028 [107 GB] Data Units Written: 340,472 [174 GB] Host Read Commands: 535,891 Host Write Commands: 705,317 Controller Busy Time: 10 Power Cycles: 7 Power On Hours: 190 Unsafe Shutdowns: 0 Media and Data Integrity Errors: 0 Error Information Log Entries: 10 Warning Comp. Temperature Time: 0 Critical Comp. Temperature Time: 0 Temperature Sensor 1: 41 Celsius Temperature Sensor 2: 57 Celsius Temperature Sensor 8: 41 Celsius Error Information (NVMe Log 0x01, 16 of 16 entries) Num ErrCount SQId CmdId Status PELoc LBA NSID VS 0 10 0 0x4010 0x4005 0x028 0 0 - Everything works perfectly with the SSD hard drive. I'm still a bit of a newbie on this topic and would really appreciate some help with this problem. |
|||
#1934 | fixed | Buffer overflow in scsi_decode_lu_dev_id | ||
Description |
Hi, I encountered a buffer overflow in smartd: (gdb) bt #0 0x00007f70d94031d4 in __pthread_kill_implementation () from /lib64/libc.so.6 #1 0x00007f70d93b0b8e in raise () from /lib64/libc.so.6 #2 0x00007f70d9399378 in abort () from /lib64/libc.so.6 #3 0x00007f70d939a428 in __libc_message_impl.cold () from /lib64/libc.so.6 #4 0x00007f70d947a0a9 in __fortify_fail () from /lib64/libc.so.6 #5 0x00007f70d9479a54 in __chk_fail () from /lib64/libc.so.6 #6 0x00007f70d947b135 in __snprintf_chk () from /lib64/libc.so.6 #7 0x0000555d9d10ca59 in snprintf (__fmt=0x555d9d16b101 "%02x", __n=18446744073709551614, __s=0x7ffd540faa52 "") at /usr/include/bits/stdio2.h:68 #8 scsi_decode_lu_dev_id (slen=64, transport=0x0, s=0x7ffd540faa10 "0x600a098038313577792450384a4a62750x2450384a4a62750000a09838313", blen=<optimized out>, b=0x7ffd540fac94 "\002\001") at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/scsicmds.cpp:793 #9 SCSIDeviceScan (cfg=..., state=..., scsidev=<optimized out>, prev_cfgs=prev_cfgs@entry=0x7ffd54100800) at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/smartd.cpp:2462 #10 0x0000555d9d11420a in register_device (prev_cfgs=<optimized out>, dev=..., state=..., cfg=...) at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/smartd.cpp:5604 #11 register_devices (conf_entries=..., scanned_devs=..., configs=..., states=..., devices=...) at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/smartd.cpp:5694 #12 0x0000555d9d11d8a1 in main_worker (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/smartd.cpp:5792 #13 0x0000555d9d105ac2 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/smartmontools-7.4-4.xs9.x86_64/smartd.cpp:5942 It is triggered by a device with the following VPD 0x83 page: $ sg_vpd -p 0x83 /dev/sdb Device Identification VPD page: Addressed logical unit: designator type: T10 vendor identification, code set: ASCII vendor id: NETAPP vendor specific: LUN 815wy$P8JJbu designator type: NAA, code set: Binary 0x600a098038313577792450384a4a6275 designator type: EUI-64 based, code set: Binary 0x2450384a4a62750000a0983831357779 Target port: designator type: NAA, code set: Binary 0x600a098000000001200500a098f5f6d0 designator type: Relative target port, code set: Binary Relative target port: 0x12 designator type: Target port group, code set: Binary Target port group: 0x3e8 Target device that contains addressed lu: designator type: SCSI name string, code set: UTF-8 SCSI name string: naa.600A098038313577792450384A4A626E $ sg_vpd --hex -p 0x83 /dev/sdb Device Identification VPD page: 00 00 83 00 9c 02 01 00 20 4e 45 54 41 50 50 20 20 ....... NETAPP 10 20 4c 55 4e 20 38 31 35 77 79 24 50 38 4a 4a 62 LUN 815wy$P8JJb 20 75 20 20 20 20 20 20 20 01 03 00 10 60 0a 09 80 u ....`... 30 38 31 35 77 79 24 50 38 4a 4a 62 75 01 02 00 10 815wy$P8JJbu.... 40 24 50 38 4a 4a 62 75 00 00 a0 98 38 31 35 77 79 $P8JJbu....815wy 50 01 13 00 10 60 0a 09 80 00 00 00 01 20 05 00 a0 ....`....... ... 60 98 f5 f6 d0 01 14 00 04 00 00 00 12 01 15 00 04 ................ 70 00 00 03 e8 03 28 00 28 6e 61 61 2e 36 30 30 41 .....(.(naa.600A 80 30 39 38 30 33 38 33 31 33 35 37 37 37 39 32 34 0980383135777924 90 35 30 33 38 34 41 34 41 36 32 36 45 00 00 00 00 50384A4A626E.... I have attached a couple of patches to fix the issue. |
|||
#1925 | fixed | Add TERRAMASTER D4-320 USB3.2 Gen 2 enclosure to database (0x5432:0x235c) | ||
Description |
I have a TerraMaster D4-320 that is not being picked up by smartctl even though the device should be in the database (see #1856). It seems that there may be some models (like mine) with a different ID. Output from smartctl: smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.44-production+truenas] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org /dev/sdb: Unknown USB bridge [0x5432:0x235c (0x100)] Please specify device type with the -d option. Use smartctl -h to get a usage summary
Running smartctl with the |
Query Language
query:
TracLinks and the [[TicketQuery]]
macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&
). Each filter then 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 |
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 left out 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 |
See also: TracTickets, TracReports, TracGuide