suurjaak / Skyperious

Skype chat history tool
Other
350 stars 36 forks source link

Getting stuck at "quering recent chats". #98

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am trying to set up regular backups of Skype using skyperious, and having the following problem. Basically, synchronization does not get to completion, getting stuck at "Querying recent chats" seemingly after most of the chats have already been synchronized.

I do not really see anything conspicuous in the traceback:

[                ----        ] Querying recent chats.. ^CTraceback (most recent call last):
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/bin/skyperious", line 8, in <module>
    sys.exit(run())
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skyperious/main.py", line 886, in run
    arguments.chat, arguments.author)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skyperious/main.py", line 557, in run_sync
    try: db.live.populate(chats)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skyperious/live.py", line 660, in populate
    self.populate_history(chats)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skyperious/live.py", line 698, in populate_history
    mychats = self.request(self.skype.chats.recent, __raise=False).values()
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skyperious/live.py", line 183, in request
    try: return func(*args, **kwargs)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skpy/chat.py", line 477, in recent
    chat = SkypeChat.fromRaw(self.skype, json)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skpy/chat.py", line 40, in fromRaw
    params={"view": "msnp24Equivalent"}).json()
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/skpy/conn.py", line 226, in __call__
    resp = self.sess.request(method, url, headers=headers, **kwargs)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen
    chunked=chunked,
  File "/home/lockywolf/binary_software/2021-04-09_skyperious/lib/python2.7/site-packages/urllib3/connectionpool.py", line 436, in _make_request
    httplib_response = conn.getresponse(buffering=True)
  File "/usr/lib64/python2.7/httplib.py", line 1161, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 448, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 404, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib64/python2.7/socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/lib64/python2.7/ssl.py", line 754, in recv
    return self.read(buflen)
  File "/usr/lib64/python2.7/ssl.py", line 641, in read
    v = self._sslobj.read(len)
KeyboardInterrupt
Unhandled exception in thread started by <bound method ProgressBar.__bootstrap of <ProgressBar(Thread-1, stopped daemon 139682248115776)>>
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 774, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/lib64/python2.7/threading.py", line 814, in __bootstrap_inner
    (self.name, _format_exc()))
  File "/usr/lib64/python2.7/traceback.py", line 241, in format_exc
    etype, value, tb = sys.exc_info()
AttributeError: 'NoneType' object has no attribute 'exc_info'

but the process seems to never end, although "sometimes", perhaps about one run per 20-30, it succeeds.

Can this be debugged somehow?

suurjaak commented 3 years ago

Should be fixed in the new v4.7 release. Can you confirm?

ghost commented 3 years ago

This issue seems to be resolved in my case.

The progress bar, though, behaves in a slightly strange way, it creates adds a new line for each chat for which there are updates. (And does not add a line for those cases when there is no updates.) This does not affect my usage (I intend to use the --no-progress option), but to just let you know.

ghost commented 3 years ago

Ow, wait, in the new version I have to enter the password every time I start skyperious sync. It used to be remembered in the previous version.

And if I Ctrl-C, it hangs, so that it even stops responding to SIGTERM, and can only be killed with SIGKILL.

suurjaak commented 3 years ago

The progress bar, though, behaves in a slightly strange way, it creates adds a new line for each chat for which there are updates. (And does not add a line for those cases when there is no updates.)

This is intentional, so that the final output shows what was actually updated.

Ow, wait, in the new version I have to enter the password every time I start skyperious sync. It used to be remembered in the previous version.

There's a flag for that: --store-password.

And if I Ctrl-C, it hangs, so that it even stops responding to SIGTERM, and can only be killed with SIGKILL.

Breaking out of running programs tends to be OS- and hardware-specific. For example, on Windows, Ctrl-C can require multiple presses, but Ctrl-Break ends a Python program immediately, and for me on Linux, Ctrl-C works effectively, See https://stackoverflow.com/a/21460045.