Insync-headless get_logfile


The logs of insync-headless are stored in a Database in ~/.config/Insync/. I cannot read that.
Is it possible to make a command like ‘get_logs’, that prints out the logs from the database into a textfile?

The Problem was, that insync-headless was not syncing. ‘get_status’ only printed “ERROR”.
So I do not know whats happening. I had to restart the Server and now it works again. But I would like to know what went wrong.

btw: I already tried the command ‘get_errors’, but it only tells me “none”.


Tagging our engineer @lpugoy and he will get back to you.


@Achim_Tecklenburg: The logs are sqlite3 dbs, so it can be opened by any program that can read those files. They can only be opened when Insync is not running though, and it is recommended to not change any value in those files to prevent Insync from malfunctioning.

The get_errors command should have shown you the details of the error when get_status returned ERROR. It probably returned None in your case because the error was resolved when you restarted Insync.


If this is not so hard, will be good to integrate this in insync app (cat log database as text output, like the syslog file), because not all users know that is sqlite and how to view sqlite3 database, even this is quite easy. They see in file binary symbols and are frightened.


Thanks for the feedback, @Murz! Will let our team know about it. :slight_smile:


Even if we succesfully view the sqlite database file, in some records we will see hard to read data in json format, like this:

INSERT INTO event_logs VALUES('01fbc8e05b73494487ae1a2e41936f35',3,'d47fedbc16454f10a9dee29fea98xxxx','idesksyncer.gdstate.GDState.get_user_info','697667a5423c4f945421475149d5xxxx',1532429202.4053139686,40,'gevent.event in get','ideskmain/',223,NULL,NULL,
'{"message": "Uncaught error from %r", "params": ["<Greenlet at 0x7fedd2d917d0: <bound method GDState.get_user_info of <idesksyncer.gdstate.GDState object at 0x7fedd19fb8d0>>>"]}','{"type": "GDAuthError", "value": "Access token refresher stopped.", "module": "idesksyncer
.gderrs"}','{"frames": [{"function": "run", "abs_path": "gevent/", "vars": {"self": "<Greenlet at 0x7fedd2d917d0: <bound method GDState.get_user_info of <idesksyncer.gdstate.GDState object at 0x7fedd19fb8d0>>>"}, "module": "gevent.greenlet", "filename": "event
/", "lineno": 390}, {"function": "get_user_info", "abs_path": "idesksyncer/", "vars": {"self": "<idesksyncer.gdstate.GDState object at 0x7fedd19fb8d0>"}, "module": "idesksyncer.gdstate", "filename": "desksyncer/", "lineno": 201}, {"function
": "get_user_info", "abs_path": "idesksyncer/", "vars": {"self": "<idesksyncer.gdclient.GDClient object at 0x7fedd19fb290>", "uri": ""}, "module": "idesksyncer.gdclient", "filename": "desksyncer/", "linen
o": 1042}, {"function": "__request", "abs_path": "idesksyncer/", "vars": {"content_str": "", "redirects": 0, "token_refreshed": false, "uri_string": "", "timeout": 40.0, "content_parts": ["''''"], "self": "<idesksyn
cer.gdclient.GDClient object at 0x7fedd19fb290>", "idempotent": true, "content": ["0", "[]", "None"], "headers": {"Content-Length": "0", "User-Agent": "''Insync for Desktop (gzip)''"}, "server_errors": 0, "pre_read": true, "method": "GET"}, "module": "idesksyncer.gdclien
t", "filename": "desksyncer/", "lineno": 540}, {"function": "get_token", "abs_path": "idesksyncer/", "vars": {"self": "<idesksyncer.gdclient.OAuth2Client object at 0x7fedd19fb250>"}, "module": "idesksyncer.gdclient", "filename": "desksyncer/gdclient
.py", "lineno": 354}, {"function": "get", "abs_path": "gevent/", "vars": {"self": "<gevent.event.AsyncResult object at 0x7feddd813790>", "timer": "<Timeout at 0x7fedd01585a0 seconds=None>", "switch": "<built-in method switch of Greenlet object at 0x7fedd2d917d0>"
, "result": "<gevent.event.AsyncResult object at 0x7feddd813790>", "timeout": null, "block": true}, "module": "gevent.event", "filename": "event/", "lineno": 223}]}','{}');

So for human readable logs view we need to convert records like those to something more user friendly - do json_decode and show only message text.