offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

ERROR: source object is already set

Open Tuteksik opened this issue 5 years ago • 10 comments

General informations

  • system/distribution (with version): Ubuntu 20.04 LTS
  • offlineimap version (offlineimap -V): 7.3.3
  • Python version: 2.7
  • server name or domain:
  • CLI options: offlineimap --dry-run -l /root/.offlineimap.log

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.

Tuteksik avatar Jul 20 '20 11:07 Tuteksik

Please post back with output from: python --version

chris001 avatar Jul 20 '20 18:07 chris001

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

Tuteksik avatar Jul 20 '20 18:07 Tuteksik

  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.

chris001 avatar Jul 20 '20 19:07 chris001

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

nicolas33 avatar Jul 20 '20 22:07 nicolas33

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

Tuteksik avatar Jul 21 '20 05:07 Tuteksik

----------------.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--------------------------------------------------------------

Tuteksik avatar Jul 21 '20 05:07 Tuteksik

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#

Tuteksik avatar Jul 21 '20 05:07 Tuteksik

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

chris001 avatar Jul 21 '20 14:07 chris001

I've edited the posts as requested.

nicolas33 avatar Jul 21 '20 21:07 nicolas33

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

#from offlineimap import OfflineImap #oi = OfflineImap() #oi.run()

and my offlineimap is working now ;)

Tuteksik avatar Jul 23 '20 08:07 Tuteksik