OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 362 forks source link

ERROR: source object is already set #675

Open zuku81 opened 4 years ago

zuku81 commented 4 years ago

General informations

Logs, error

root@offlineimap:~# offlineimap --dry-run -l /root/.offlineimap.log OfflineIMAP 7.3.3 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.101 (bundled), Python v2.7.18rc1, OpenSSL 1.1.1f 31 Mar 2020 ERROR: source object is already set ERROR: Exceptions occurred during the run! ERROR: source object is already set

Steps to reproduce the error

I'm just trying to move Offlineimap configuration to the new server, but I have such error as above. I don't know how to troubleshoot this because I do not have anything in log.

chris001 commented 4 years ago

Please post back with output from: python --version

zuku81 commented 4 years ago

root@offlineimap:~# python --version Python 2.7.18rc1

chris001 commented 4 years ago
  1. Could you try to git bisect this? http://offlineimap.org/doc/git-bisect.html

  2. Also, what's your configuration file? Note: Redact/remove private info such as server addresses and passwords.

nicolas33 commented 4 years ago

--dry-run mode is known to have issues. Do you hit this without this option?

zuku81 commented 4 years ago

without --dry-run I have the same error:

root@offlineimap:~# offlineimap -l /root/.offlineimap.log OfflineIMAP 7.3.3 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.101 (bundled), Python v2.7.18rc1, OpenSSL 1.1.1f 31 Mar 2020 ERROR: source object is already set ERROR: Exceptions occurred during the run! ERROR: source object is already set

zuku81 commented 4 years ago

----------------.offlineimapprc-------------------------------

# Sample minimal config file.  Copy this to ~/.offlineimaprc and edit to
# suit to get started fast.

[general]
# Path to file with arbitrary Python code to be loaded
pythonfile = ~/.offlineimap.py
accounts = WP

[Account WP]
localrepository = WPlocal
remoterepository = Gmail-wp

[Repository WPlocal]
#readonly = true
#sslcacertfile = /etc/ssl/certs/ca-certificates.crt
cert_fingerprint = 2e4efe27a24ffc61ea0c5ccc9145fb5e4ef8c6af
type = IMAP
remotehost = imap.wp.pl
remoteport = 993
ssl = yes
createfolders = false
remoteuser = ***************
#remotepasseval = get_pass()
remotepasseval = unencrypt_password("~/.offlineimappass")
folderfilter = lambda folder: folder in ['INBOX', 'Xpertis', 'Citibank', 'Mbank', 'Trenowanie', 'Wys&AUI-ane']
nametrans = lambda folder:<----> re.sub  ('INBOX', 'WP',
<------><------>re.sub ('Xpertis', 'WP/Xpertis',
<------><------>re.sub ('Citibank', 'WP/Citibank',
<------><------>re.sub ('Mbank', 'WP/Mbank',
<------><------>re.sub ('Trenowanie', 'WP/Trenowanie',
<------><------>re.sub ('Wys&AUI-ane', 'WP/Wys&AUI-ane', folder))))))

[Repository Gmail-wp]
auth_mechanisms  = PLAIN
type = Gmail
ssl = yes
#createfolders = false
#realdelete = true
# Synchronize only the folders Inbox and Sent:
folderfilter = lambda folder: folder in ['WP', 'WP/Xpertis', 'WP/Citibank', 'WP/Mbank', 'WP/Trenowanie', 'WP/Wys&AUI-ane']
#folderincludes =  ['WP', 'WP/Xpertis', 'WP/Citibank', 'WP/Mbank', 'WP/Trenowanie', 'WP/Wys&AUI-ane']
remotehost = imap.gmail.com
remoteuser = ************************
#remotepasseval = get_pass()
remotepasseval = unencrypt_password("~/.offlineimappassgoogletwoway")
cert_fingerprint = cb7bcaea2c188c39c2c91e5f6f6fbe949df29ad0
#sslcacertfile = /etc/ssl/certs/ca-certificates.crt
nametrans = lambda folder:<----> re.sub ('WP', 'INBOX',
<------><------>re.sub ('WP/Xpertis', 'Xpertis',
<------><------>re.sub ('WP/Citibank', 'Citibank',
<------><------>re.sub ('WP/Mbank', 'Mbank',
<------><------>re.sub ('WP/Trenowanie', 'Trenowanie',
<------><------>re.sub ('WP/Wys&AUI-ane', 'Wys&AUI-ane', folder))))))

---------------------------------------------EOF--------------------------------------------------------------

zuku81 commented 4 years ago
root@offlineimap:~# cd offlineimap/
root@offlineimap:~/offlineimap# git bisect start
root@offlineimap:~/offlineimap# git bisect good
root@offlineimap:~/offlineimap# git bisect bad
7531ac4640aff8477b0893c55c99c9fe4a9bbcfc was both good and bad
root@offlineimap:~/offlineimap# git bisect skip
7531ac4640aff8477b0893c55c99c9fe4a9bbcfc was both good and bad
root@offlineimap:~/offlineimap# git bisect reset
Already on 'master'
Your branch is up to date with 'origin/master'.
root@offlineimap:~/offlineimap#
chris001 commented 4 years ago

Please post again your (redacted) config file, and precede it with three backticks alone on a line, and followed by three backticks alone on a line, to preserve formatting, as demonstrated here: https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks

nicolas33 commented 4 years ago

I've edited the posts as requested.

zuku81 commented 4 years ago

OK, I just commented these lines in .offlineimap.py

from offlineimap import OfflineImap

oi = OfflineImap()

oi.run()

and my offlineimap is working now ;)