wiki:

TracQuery


Version 3 (modified by trac, 4 years ago) (diff)

--

Trac Ticket Queries

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.

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

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
Fuzzed sample crashes ffplay

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:

0

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 5993)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#7971 invalid Hung process poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) jidckii
#7969 wontfix Flac tracknumber is incorrectly identified rayden
#7967 invalid ID3v2 comment unsupported bitennui
1 2 3 4 5 6 7 8 9 10 11

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 5993)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#7971 invalid Hung process poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) jidckii
Description

Summary of the bug: How to reproduce: I run ffmpeg in the docker container

jidckii/ffmpeg:4-1-0-v1-1-0

The process is frozen and does nothing. At the time of the creation of the ticket, it has been hanging for 19 hours. Similar problem: http://michael-peeters.blogspot.com/2019/03/hanging-m3u8-downloads-in-ffmpeg.html

At the time of the problem, the network connection was briefly lost.

% ffmpeg -i input ... output
ffmpeg -version
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --arch=amd64 --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-postproc --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100



jidckii@keikogi~14:09:31:~$  ps -ef | grep plot_hd
root      5877 19491  0 июн24 ?     00:00:28 /usr/local/bin/ffmpeg -xerror -abort_on empty_output -nostats -hide_banner -progress /dev/stdout -loglevel repeat+level+info -analyzeduration 10000000 -probesize 10000000 -i rtmp://mediasrv.uralttk.ru/rtplive/plot_hd.stream -vsync -1 -map 0:0 -c:v copy -an -f hls -use_localtime 1 -hls_time 3 -hls_list_size 10 -hls_flags delete_segments+second_level_segment_index -hls_segment_filename %y%m%d_%H%M%S_%%06d.ts index.m3u8


$ sudo strace -r -T -f -p 5877 
strace: Process 5877 attached
     0.000000 restart_syscall(<... resuming interrupted poll ...>) = 0 <0.031468>
     0.031566 poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) <0.100140>
     0.100305 poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) <0.100110>
     0.100408 poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) <0.100164>
     0.100489 poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) <0.100330>
     0.100932 poll([{fd=4, events=POLLIN}], 1, 100) = 0 (Timeout) <0.101226>
     0.100666 poll([{fd=4, events=POLLIN}], 1, 100^Cstrace: Process 5877 detached
 <detached ...>



lsof -p 3917 (pid in docker container)
COMMAND  PID USER   FD   TYPE   DEVICE SIZE/OFF     NODE NAME
ffmpeg  3917 root  cwd    DIR    0,139      340        2 /tmp/live/hls
ffmpeg  3917 root  rtd    DIR    0,140     4096  1981846 /
ffmpeg  3917 root  txt    REG    0,140   214240   535741 /usr/local/bin/ffmpeg
ffmpeg  3917 root  mem    REG    253,0            535741 /usr/local/bin/ffmpeg (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406860 /lib/x86_64-linux-gnu/libresolv-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406839 /lib/x86_64-linux-gnu/libnss_dns-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406841 /lib/x86_64-linux-gnu/libnss_files-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537186 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537180 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537188 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537222 /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537211 /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.34.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406881 /lib/x86_64-linux-gnu/libuuid.so.1.3.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537136 /lib/x86_64-linux-gnu/libexpat.so.1.6.2 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537134 /lib/x86_64-linux-gnu/libbsd.so.0.8.3 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406862 /lib/x86_64-linux-gnu/librt-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406831 /lib/x86_64-linux-gnu/libmvec-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537190 /usr/lib/x86_64-linux-gnu/libcairo.so.2.11400.8 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537207 /usr/lib/x86_64-linux-gnu/libogg.so.0.8.2 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406819 /lib/x86_64-linux-gnu/libgcc_s.so.1 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            524985 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406811 /lib/x86_64-linux-gnu/libdl-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537213 /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537203 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536055 /usr/local/lib/libfontconfig.so.1.12.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537201 /usr/lib/x86_64-linux-gnu/libfribidi.so.0.3.6 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537184 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537182 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536063 /usr/local/lib/libkvazaar.so.4.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537228 /usr/lib/x86_64-linux-gnu/libxvidcore.so.4.3 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536126 /usr/local/lib/libx265.so.165 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536123 /usr/local/lib/libx264.so.155 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536111 /usr/local/lib/libvorbisenc.so.2.0.11 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536106 /usr/local/lib/libvorbis.so.0.4.8 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537218 /usr/lib/x86_64-linux-gnu/libtheoradec.so.1.1.4 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537220 /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1.1.2 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536087 /usr/local/lib/libopus.so.0.7.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536081 /usr/local/lib/libopenjp2.so.2.3.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536073 /usr/local/lib/libopencore-amrnb.so.0.0.3 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536068 /usr/local/lib/libmp3lame.so.0.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536051 /usr/local/lib/libfdk-aac.so.1.0.1 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536078 /usr/local/lib/libopencore-amrwb.so.0.0.3 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406825 /lib/x86_64-linux-gnu/liblzma.so.5.2.2 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536121 /usr/local/lib/libvpx.so.5.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537191 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537214 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406883 /lib/x86_64-linux-gnu/libz.so.1.2.8 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406800 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536059 /usr/local/lib/libfreetype.so.6.16.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536101 /usr/local/lib/libvidstab.so.1.1 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536022 /usr/local/lib/libass.so.9.0.2 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537224 /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            537226 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406801 /lib/x86_64-linux-gnu/libc-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406858 /lib/x86_64-linux-gnu/libpthread-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406826 /lib/x86_64-linux-gnu/libm-2.24.so (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536046 /usr/local/lib/libavutil.so.56.22.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536099 /usr/local/lib/libswscale.so.5.3.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536095 /usr/local/lib/libswresample.so.3.3.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536091 /usr/local/lib/libpostproc.so.55.3.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536042 /usr/local/lib/libavresample.so.4.0.0 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536026 /usr/local/lib/libavcodec.so.58.35.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536038 /usr/local/lib/libavformat.so.58.20.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536034 /usr/local/lib/libavfilter.so.7.40.101 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            536030 /usr/local/lib/libavdevice.so.58.5.100 (path dev=0,140)
ffmpeg  3917 root  mem    REG    253,0            406783 /lib/x86_64-linux-gnu/ld-2.24.so (path dev=0,140)
ffmpeg  3917 root    0r   CHR      1,3      0t0        6 /dev/null
ffmpeg  3917 root    1w  FIFO     0,12      0t0 15462578 pipe
ffmpeg  3917 root    2w  FIFO     0,12      0t0 15462579 pipe
ffmpeg  3917 root    3w  FIFO     0,12      0t0 15462578 pipe
ffmpeg  3917 root    4u  IPv4 15462591      0t0      TCP f4915a94d2e8:42724->80.78.116.125:1935 (ESTABLISHED)
ffmpeg  3917 root    5w   REG    0,139  1048576        9 /tmp/live/hls/190624_150308_000197.ts



root@f4915a94d2e8:/opt/yucca# ls -la  /proc/3917/fd/4
lrwx------ 1 root root 64 Jun 25 09:12 /proc/3917/fd/4 -> socket:[15462591]
root@f4915a94d2e8:/opt/yucca# lsof -p 3917 | grep 15462591
ffmpeg  3917 root    4u  IPv4 15462591      0t0      TCP f4915a94d2e8:42724->80.78.116.125:1935 (ESTABLISHED)



#7969 wontfix Flac tracknumber is incorrectly identified rayden
Description

Summary of the bug: track number is shown incorrectly for flac files. ffprobe shows tracknumber as track (lowercase), and track as TRACK (uppercase). Only using metaflac I realised the tags were different

How to reproduce: Grab a good flac file, and then run:

$ ffprobe '02 - Angelica.flac'
Input #0, flac, from '02 - Angelica.flac':
Metadata:
ALBUM : Eternity [Peaceville Records-Pony Canyon Inc PCCY-01050]
TRACKTOTAL : 15
ARTIST : Anathema
PERFORMER : Anathema
GENRE : "Doom metal"
DATE : 1996
TITLE : Angelica
track : 02
Duration: 00:05:50.40, start: 0.000000, bitrate: 809 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16


$ metaflac --list '02 - Angelica.flac'
...
METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 233
  vendor string: reference libFLAC 1.3.2 20170101
  comments: 8
    comment[0]: ALBUM=Eternity [Peaceville Records-Pony Canyon Inc PCCY-01050]
    comment[1]: TRACKNUMBER=02
    comment[2]: TRACKTOTAL=15
    comment[3]: ARTIST=Anathema
    comment[4]: PERFORMER=Anathema
    comment[5]: GENRE=Doom Metal
    comment[6]: DATE=1996
    comment[7]: TITLE=Angelica

Tracknumber is the correct tag that players use to identify, hence the following example is just for the purpose of showing the differences:

$ metaflac --set-tag=track=02 '02 - Angelica.flac'
$ ffprobe -fflags +bitexact 02\ -\ Angelica.flac
Input #0, flac, from '02 - Angelica.flac':
  Metadata:
    ALBUM           : Eternity [Peaceville Records-Pony Canyon Inc PCCY-01050]
    TITLE           : Angelica
    TRACKTOTAL      : 15
    ARTIST          : Anathema
    PERFORMER       : Anathema
    GENRE           : Doom Metal
    DATE            : 1996
    TRACK           : 02
  Duration: 00:05:50.40, start: 0.000000, bitrate: 809 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

This is very confusing and I think the tracknumber should show as TRACKNUMBER (uppercase). It took me a good while initially to understand why the tags on my flac album were not being set correctly, and that was because I was using track as ffprobe was showing it.

#7967 invalid ID3v2 comment unsupported bitennui
Description

Summary of the bug: id3v2enc.c does not encode "comment" metadata using ID3v2 tag "COMM", it instead drops though and gets encoded using the "TXXX" catch-all. The metadata mapping table in id3v2.c needs to be updated with the "COMM" tag for the "comment" key; and id3v2_check_write_tag in id3v2enc.c should not expect valid tags to start with "T" since "COMM" is an obvious exception to that constraint. How to reproduce:

% ffmpeg-i mp3_with_COMM_id3v2_tag.mp3 -f ffmetadata -c copy -map_metadata 0 -id3v2_version 3 -write_id3v1 1 incorrect_mp3_with_comment_mapped_to_TXXX_tag.mp3
ffmpeg version
built on ...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

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. 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