Getting logs

Ensure that the G_MESSAGES_DEBUG and GNOME_PHOTOS_DEBUG environment variables are defined before launching the application. They will make Photos show some extra debug messages. The variables can be set to the special value all, in which case it will show all possible debug messages coming from the application and the libraries underneath it.


It is possible to only log a subset of the messages. Set G_MESSAGES_DEBUG to gnome-photos to limit them to only those coming from Photos itself. You can further limit them by sub-systems within the application using the GNOME_PHOTOS_DEBUG variable. The possible values are listed below.





Shows all the supported debug values.



Special value that includes everything else below.



The stages in the lifetime of the GApplication.



Communication with DLNA Digital Media Renderers



Babl format of the GeglBuffer when an image is decoded for viewing; the state of the GEGL graph when editing; and a spattering of performance figures of operations performed on the UI thread that could potentially freeze the UI if not sufficiently fast.



Network activity when thumbnailing and viewing non-local images; and caching metadata about remote content through the online miners.



Communication between the application and its custom out-of-process thumbnailer; and stages of each thumbnailing operation.



SPARQL queries used to communicate with Tracker and the time taken to handle them.


For example, to only log the Photos' GApplication start-up and shutdown sequences, and the SPARQL statements used to communicate with Tracker:

$ G_MESSAGES_DEBUG=gnome-photos GNOME_PHOTOS_DEBUG=application:tracker gnome-photos

Run-time failures are always logged as WARNINGs and unexpected programming errors are logged as CRITICALs. They are shown regardless of the values of the debug variables above. Check your operating system's logging facilities (eg., journalctl) to find them.

Checking the environment

Local content

By default, local content is pulled from XDG_DESKTOP_DIR, XDG_DOWNLOAD_DIR and XDG_PICTURES_DIR. To check where they are pointing to:

$ cat .config/user-dirs.dirs 

You can add custom locations using the Search panel in Settings.

Photos uses Tracker as its metadata cache and it should be configured to index and monitor these locations. Tracker uses GSettings for its configuration, and refers to the XDG presets as &DESKTOP, &DOWNLOAD and &PICTURES. On a functional system, without any custom locations, you might see:

$ gsettings get org.freedesktop.Tracker.Miner.Files index-recursive-directories

Note that only directories listed under index-recursive-directories are monitored recursively. Those under index-single-directories are not.

Online or remote content

Online or remote content is pulled from online accounts with the “photos” feature. You can look at the GNOME Online Accounts documentation on how to debug this integration.

Metadata cache

Photos uses Tracker to harvest and cache metadata about the content coming from the above sources. It uses SPARQL as the query language, and the tracker command can be used to control and interface with the Tracker services. Tracker's manual for application developers covers SPARQL extensively.

Missing content

Photos shows content from the XDG_DESKTOP_DIR, XDG_DOWNLOAD_DIR and XDG_PICTURES_DIR directories, custom locations added through the Search panel, and your online accounts. It queries Tracker for relevant content in these locations. It tries to limit itself to photographs and screenshots, and skips MIME types that it doesn't have support for (eg., GIFs).

So if you are missing some content, check if your environment is properly set up (see above). Then, check the entries in Tracker's database.

For example, to list all known photographs and their MIME types:

$ tracker sparql -q \
>  "SELECT nie:url(?urn) nie:mimeType(?urn) \
>   WHERE {?urn a nmm:Photo}"

It's possible to force Tracker to index a file and have it inserted into the database:

$ tracker index --file ~/Pictures/balconies.jpg

Wrong metadata

For local content, check the metadata of the file extracted by Tracker:

$ tracker info ~/Pictures/balconies.jpg 
Querying information for entity:'/home/rishi/Pictures/balconies.jpg'
  '' = '2015-04-01T13:58:59Z'
  '' = '2017-06-22T16:27:05Z'
  '' = ''
  '' = 'urn:nepomuk:datasource:9291a450-1d49-11de-8c30-0800200c9a66'
  'tracker:added' = '2017-06-22T16:31:33Z'
  'tracker:modified' = '2152'
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'rdf:type' = ''
  'nie:byteSize' = '317077'
  'nie:dataSource' = ''
  'nie:dataSource' = 'urn:nepomuk:datasource:9291a450-1d49-11de-8c30-0800200c9a66'
  'nie:isPartOf' = 'urn:uuid:570e411e-5c4c-2c99-ca46-26532dff56f3'
  'nie:url' = 'file:///home/rishi/Pictures/balconies.jpg'
  'nfo:belongsToContainer' = 'urn:uuid:570e411e-5c4c-2c99-ca46-26532dff56f3'
  'tracker:available' = 'true'
  'nie:isStoredAs' = 'urn:uuid:335f04ef-be16-c7b8-6f3e-f040d5b5b0e0'
  'nie:mimeType' = 'image/jpeg'
  'nfo:fileLastAccessed' = '2017-06-22T16:27:05Z'
  'nfo:fileLastModified' = '2015-04-01T13:58:59Z'
  'nfo:fileName' = 'balconies.jpg'
  'nfo:fileSize' = '317077'
  'nmm:dlnaMime' = 'image/jpeg'
  'nmm:dlnaProfile' = 'JPEG_LRG'
  'nfo:height' = '1024'
  'nfo:width' = '683'
  'nfo:horizontalResolution' = '72'
  'nfo:verticalResolution' = '72'

Apps/Photos/Debugging (last edited 2018-03-14 12:02:29 by DebarshiRay)