Problems API v2 Specification 0.2 Copyright (C) 2012, 2015 Red Hat Copyright (C) 2012, 2015 ABRT Team <crash-catcher@lists.fedorahosted.org> The Problems Service manages all the crashes. Creates a new problem and returns it's identifier. A dictionary describing problem where values are either file descriptors or strings. There are few commonly recognized fields but the dictionary can hold anything you need. type This field should be always present. The field defines a type of problem. If the item is not provided, libreport string is used by default. This element must not be passed as plain String. Some values can passed only by authorized users, check the implementation details to find the real values. analyzer This field should be always present. The field defines a type of problem. If the item is not provided, libreport string is used by default. This element must not be passed as plain String. Some values can passed only by authorized users, check the implementation details to find the real values. reason This field should contain a short human readable text describing the problem. time This field is filled automaticaly. uid Only a user with root privileges can pass this field. For all other users the field is filled by caller's uid. executable This is mandatory field and must contain a valid path to an executable. component A name of package which a problematic application belongs to. If this field is provided, the executable field becomes optional. uuid Machine readable identifier of a kind of the problem. ABRT uses this field for local duplicates searching. duphash Machine readable identifier of a kind of the problem. ABRT uses this field for global duplicates searching. The value can be one of the following types: string (s), binary array (ay) or file handle (h - will be read in non-blocking mode). The task details will contain object path of a temporary Entry under the key "NewProblem.TemporaryEntry". The temporary entry object implements the org.freedesktop.Problems2.Entry interface. The task results will contain object path of the Entry representing the processed problem data under the key "NewProblem.Entry". 0x1 the task will be created 0x2 the task will be stopped after the temporary directory is created 0x4 the task will be automatically started Object path of the task processing the new problem data. The task can finish with one of the following codes: 0 ABRT_P2_TASK_NEW_PROBLEM_ACCEPTED - a new problem was created 1 ABRT_P2_TASK_NEW_PROBLEM_FAILED - the processing failed 2 ABRT_P2_TASK_NEW_PROBLEM_DUPLICATE - the problem data was dropped and a duplicated problem was updated 3 ABRT_P2_TASK_NEW_PROBLEM_DROPPED - the problem data couldn't be saved 4 ABRT_P2_TASK_NEW_PROBLEM_INVALID_DATA - the problem data contained abandoned values How to create a new problems in Python How to create a new problems in Bash Returns a session object which implements the org.freedesktop.Problems2.Session interface. An object path Returns a list of problem identifiers for problems visible by the caller. If the session is authorized (GetSession), then the method returns all detected problems (system problems and problems of other users). Allows to specify what kind of problems to include in the response 0x0 Only problems that can be viewed and modified by the caller 0x1 Include problems of other users 0x2 Include problems being processed For future needs List of problem objects paths How to get the list of problems in Python How to get the list of user problems and system problems in Python 0: mainloop.run() prblms = problems.GetProblems(0x1, {}) for path in prblms: prblm_proxy = bus.get_object(PROBLEMS_BUS, path) props = dbus.Interface(prblm_proxy, "org.freedesktop.DBus.Properties") print("{}: {}".format(props.Get(ENTRY_IFACE, "Executable"), props.Get(ENTRY_IFACE, "Reason"))) ]]> Gets an equivalent of libreport's ProblemData for the given problem entry ($INCLUDE_DIR/libreport/problem_data.h). Problem Entry path used to get the problem data. The results is a dictionary where the key is problem element name (e.g. package, maps, coredump) and the value is a structure with three members: libreport flags ($INCLUDE_DIR/libreport/problem_data.h) real file size in Bytes a representation of the element depending on the libreport flags CD_FLAG_TXT file contents CD_FLAG_BIN file path CD_FLAG_BIGTXT file path Deletes specified problems. The problems are specified as array of problem objects. An array of problem objects to deleted. A new system problem has been detected. An identifier of the detected problem. UID of user who reported this problem. The Entry represents single problem. The UNIX time when the collection was created. The UID of the crashed program. The user name associated with the uid. Name of the host where the problem occurred The type of the problem (CCpp, Python, Kerneloops, Java, Ruby, ...). The UNIX time when the problem entry was created. The UNIX time when the problem entry was seen for the last time. The number of observed problem's occurrences. The file system path to crashed program. The command line arguments used run the crashed program. The component which the package belongs to. Information about the package which the crashed program belongs to: full name epoch name version release A local scope, unique identifier for similar problems to the problem. A global scope, unique identifier for similar problems to the problem. The list of reports of the problem in the form of a dictionary where the key is the report type (e.g. Bugzilla, ABRT Server) and the value is another dictionary with the report information ("URL", "https://bugzilla.redhat.com/1000000"). Known information types are the following: URL An URL BTHASH An indentifier of the problem returned by ABRT server MSG A message CERTAINTY This type can appear only together with a entry of the "URL" type. Its value is an integer and represents percentual relevance to of the URL to the problem. A brief description of what caused the problem. List of solutions that are a structrure with these members (which are self-explanatory): solution type title URL note_text note_html certainty Technical details about the problem usually containing explanation for the not-reporatiblity of the problem (e.g tainted Kernel oopses). List of all elements the problem data contains. List of all semantic elements that can be handled by GetSemanticElement and SetSemanticElement methods. True if someone took the time to file a ticket in the OS's default bug tracking system. TRUE if it is possible to file a ticket in the OS's default bug tracking system. TRUE if the problem data has been uploaded by another host. Gets semantic values of problem's elements. Each implementation of 'org.freedesktop.Problems2' supports their own Semantic Elements. It is an error to call this method with an element that is not listed in the property 'semantic_elements' Requested element names. A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'. Sets semantic value of problem's elements. Each implementation of 'org.freedesktop.Problems2' supports their own Semantic Elements. It is an error to call this method with an element that is not listed in the property 'semantic_elements' A dictionary where keys are element names and values depend on the implementation of 'org.freedesktop.Problems2'. Gets a raw value of a problem's element. A list of names of required info. If type of a requested element does not match the type specified in the argument 'i', the element will be ignored and its value will not be included in the response. Enables selection of the allowed type and the type of return values. 0x0 : NO_FLAGS Do not check element types and return text elements as D-Bus strings, big text elements as UNIX file descriptors and binary elements as UNIX file descriptors too. 0x1 : ALL_FD The returned values will be file descriptors for all element types (text, big text and binary) 0x2 : ALL_TYPES (TODO : I am not sure what I had on mind. I will remove this term later.) 0x4 : ONLY_TEXT Only those elements that are of text type are read and their contents are returned as D-Bus strings by default. 0x8 : ONLY_BIG_TEXT Only those elements that are of binary type are read and their contents are returned as UNIX file descriptors 0x10 : ONLY_BINARY Only those elements that are of big text type are read and their contents are returned as UNIX file descriptors 0x20 : ALL_NO_FD Return binary data as fixed byte array Dictionary here the key is a requested element name and the value is the element's value. How to use ReadElements() method to print out a nice list of problems Creates or updates raw values of the given problem elements. See org.freedesktop.Problems2.NewProblem for more details about element naming rules. The problem elements and their values of one of the following types: s text data ay binary data h file descriptor - will be read in non-blocking mode This argument is used to define how to recover from errors. 1 Fatal IO errors 2 Fatal Unsupported data type errors 4 Fatal Problem elements count limit 8 Fatal Problem data size limit Deletes the listed problem's elements. The list of deleted problem elements. Session objects hold information about identity of clients. A session object is created automatically when a new client makes connection. Clients are treated as an anonymous users until they are authorized in 'Authorize' method. TRUE if the client is authorized; otherwise FALSE. The method authorizes the client for access to all problems. The method returns immediately and the authorization results are reported through AuthorizationChanged signal. Additional parameters that can be used for granting authorization: problems2.peer-token Secret token of the peer's session. problems2.peer-bus Unique bus name of the Session that generated the token. -1 An error occurred 0 The authorization request has succeeded and the client is now authorized. 1 The authorization request has been accepted. 2 The previous authorization request is not finished yet. Disposes the current session object and drops all authorization tokens. If the client makes a further action, a new session object on the same path will be created. This methods generates a string that can be used by another Session for authorization without prompting for password. The token can be used only once and only by the same user as the one that owns the Session object that generated the token. The token remains valid for a limited period of time. The method will fail if called on a Session object that is not authorize yet. In case the token will not be used, the token can be revoked by RevokeToken method. The method can be called only on a Session that is currently authorized. This argument defines the validity period of time in seconds. 0 is interpreted as default which may vary between implementations (~5s). A string that should be passed as the value of the 'parent-token' key in the Authorize method's 'parameters' argument. In case a token is no longer needed. This method can be used to revoke a generated token. Token string returned by GenerateToken method. Notifies the changes of state of authorization. Describes the change that happened and can be one of the following values: 0 The recent authorization request has succeeded and the client is now authorized. 1 Authorization request is pending. 2 Authorization has been lost. 3 Authorization request has failed. Represents an long running task Request to start processing of the task. This method can be called only if the status property equals TASK_READY. For future needs Request to cancel processing of the task. The task will be disposed after that. This method can be called only if the status property equals TASK_PROCESSING. For future needs Takes the results and dispose the task. The method can be called only if the status property equals TASK_DONE. The parameter for returning the results. Return code 0 Successfully finished non 0 Processing failed - check status code of the task type. Any details that the specific task provides. This property supports org.freedesktop.DBus.Properties.PropertiesChanged signal. 0 TASK_NEW: processing can be started 1 TASK_RUNNING: the task is being processed 2 TASK_STOPPED: processing has been stopped - the task can define several stop points where the users can adjust the configuration 3 TASK_CANCELED: processing has been canceled 4 TASK_FAILED: processing has been failed 5 TASK_DONE: processing has been finished