gui.py return "username or password incorrect" but the password is correct

Bug #758100 reported by Diego Principe
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Backup Gmail
In Progress
Medium
Joseph Wen

Bug Description

like title

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Can you use
./backup_gmail.py backup_dir email@address password
and post the Traceback.
Thanks

Revision history for this message
Diego Principe (cdprincipe) wrote :

Traceback (most recent call last):
  File "./backup_gmail.py", line 484, in <module>
    doBackup(options, TerminalProgress())
  File "./backup_gmail.py", line 454, in doBackup
    backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels)
  File "./backup_gmail.py", line 293, in backupTo
    self.checkDir(overwrite)
  File "./backup_gmail.py", line 276, in checkDir
    raise e
OSError: [Errno 13] Permission denied: '/backupgmail'
username or password incorrect

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Thank you.
From the message it seems the problem is that you don't have permission to access /backupgmail.
Maybe you want to try ./backupgmail or ~/backupgmail .
I will update the program to give a correct error message.

Changed in backup-gmail:
status: New → In Progress
assignee: nobody → Joseph Wen (wenjoseph)
importance: Undecided → Medium
Revision history for this message
Diego Principe (cdprincipe) wrote :

diego@eeePC:~/Script/backup-gmail$ sudo ./backup_gmail.py backup username password
[backup] Already exists overwrite? (use -i for incremental backup) [N/y]y
Traceback (most recent call last):te size]
  File "./backup_gmail.py", line 484, in <module>
    doBackup(options, TerminalProgress())
  File "./backup_gmail.py", line 454, in doBackup
    backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels)
  File "./backup_gmail.py", line 294, in backupTo
    self.doBackup(date_range, include_labels, exclude_labels)
  File "./backup_gmail.py", line 282, in doBackup
    self.fetchAllMail(date_range)
  File "./backup_gmail.py", line 253, in fetchAllMail
    self.fetchMailByLabel('[Gmail]/All Mail', date_range)
  File "./backup_gmail.py", line 157, in fetchMailByLabel
    infos = self.fetchRFC822Info('1:%s' % (mail_count[0], ))
  File "./backup_gmail.py", line 51, in convert
    data = func(self, uid)
  File "./backup_gmail.py", line 102, in fetchRFC822Info
    while not self.resultCountCheck(data, uid):
  File "./backup_gmail.py", line 79, in resultCountCheck
    return len(result) == int(l[1]) - int(l[0]) + 1
ValueError: invalid literal for int() with base 10: '[NONEXISTENT] Unknown Mailbox'
username or password incorrect
diego@eeePC:~/Script/backup-gmail$

Revision history for this message
Diego Principe (cdprincipe) wrote :

PS I have censored username and password

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Hi:

I have uploaded a new version that I hope will solve the problem:
http://launchpad.net/backup-gmail/trunk/backup-gmail-0.1/+download/backup-gmail-0.1.2.tar.gz

The problem seems to be that Gmail have different name for its mailbox for different account.

Revision history for this message
Diego Principe (cdprincipe) wrote :

No... now it start but don't backup anything. There is only file label in backup directory but is empty.
PS my password have non alphanumeric digit

diego@eeePC:~/Script/backup-gmail$ sudo ./backup_gmail.py backup myusername mypassword
[sudo] password for diego:
[backup] Already exists overwrite? (use -i for incremental backup) [N/y]y
Traceback (most recent call last):
  File "./backup_gmail.py", line 548, in <module>
    doBackup(options, TerminalProgress())
  File "./backup_gmail.py", line 518, in doBackup
    backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels)
  File "./backup_gmail.py", line 348, in backupTo
    self.doBackup(date_range, include_labels, exclude_labels)
  File "./backup_gmail.py", line 335, in doBackup
    self.fetchAllMail(date_range)
  File "./backup_gmail.py", line 306, in fetchAllMail
    self.fetchMailByLabel('%s/All Mail' % (self.getGmailPrefix(), ), date_range)
  File "./backup_gmail.py", line 163, in getGmailPrefix
    raise self.SelectMailBoxError('<All Mail>', labels)
SelectMailBoxError: MailBox [<All Mail>] does not exists.
MailBox List: ['Amici', 'Amore Mio', 'Auguri', 'Banca', 'Citt&AOA- della Fedelt&AOA-/GMG 2011', 'Citt&AOA- della Fedelt&AOA-/Organizzazione', 'Citt&AOA- della Fedelt&AOA-/Preghiere', 'Citt&AOA- della Fedelt&AOA-/Viaggi', 'Famiglia/Fratelli', 'INBOX', 'Lavori', 'Meditazioni', 'Messaggi di Medjugorje', 'Pagamenti/PayPal', 'Pagamenti/eBay', 'Parrocchia/Camposcuola 2009', 'Quaresima', 'Registrazioni', 'Sito parrocchiale/commenti', 'Universit&AOA-/Colleghi', 'Universit&AOA-/Iscrizioni', 'Universit&AOA-/Newsletter', 'Universit&AOA-/Professori', 'Universit&AOA-/Studio', 'Viaggi', '[Gmail]/Bozze', '[Gmail]/Importante', '[Gmail]/Posta inviata', '[Gmail]/Spam', '[Gmail]/Speciali', '[Gmail]/Tutti i messaggi']
diego@eeePC:~/Script/backup-gmail$

The gui.py report always "username or password incorrect"

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Hi:

The problem is that to improve performance I have hard coded some mail box names in English, which are different in other language.
This attachment will solve the problem but decrease performance a little bit.
I will think of a better way and update later this week.
Also, I have not update the GUI part yet. So use the command line for the moment.

Revision history for this message
Elvis Dominguez (elvisd79) wrote :

Hi had the same problem. Version 0.1.2.1 fixes it. Thank you.

Revision history for this message
Diego Principe (cdprincipe) wrote :

Now works also the gui!
Only one question: this script also download attachments?

Revision history for this message
Invincicble Mutant (ngkengyap) wrote :

The script isn't work as great as it sounds for me. I hope that it could be patched, i appreciate the developer's effort. Thank you very much. Below is the traceback:

Note: i have find and replace'd the user dir and <email address hidden> for privacy reason. The gui.py was renamed to gmail.backup in my user bin.

[/tmp/gmail] Already exists overwrite? (use -i for incremental backup) [N/y]y

Traceback (most recent call last):
  File "/home/user/bin/backup_gmail.py", line 548, in <module>
    doBackup(options, TerminalProgress())
  File "/home/user/bin/backup_gmail.py", line 518, in doBackup
    backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels)
  File "/home/user/bin/backup_gmail.py", line 348, in backupTo
    self.doBackup(date_range, include_labels, exclude_labels)
  File "/home/user/bin/backup_gmail.py", line 335, in doBackup
    self.fetchAllMail(date_range)
  File "/home/user/bin/backup_gmail.py", line 306, in fetchAllMail
    self.fetchMailByLabel('%s/All Mail' % (self.getGmailPrefix(), ), date_range)
  File "/home/user/bin/backup_gmail.py", line 163, in getGmailPrefix
    raise self.SelectMailBoxError('<All Mail>', labels)
SelectMailBoxError: MailBox [<All Mail>] does not exists.
MailBox List: ['Archive', 'Drafts', 'INBOX', 'Sent', 'Trash', '[Gmail]/Drafts', '[Gmail]/Sent Mail', '[Gmail]/Spam', '[Gmail]/Starred', '<email address hidden>']

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Yes it also downloads attachments.

Invincicble Mutant:
Your problem should be solved by 0.1.2.1 too.
Not sure what patched means, but if you use the -i option it will not ask "Already exists overwrite? "

Revision history for this message
Gills Lopes (gills) wrote :

Guys, thank you for your replies... they helped me a lot to fix my bug (error in the username/password).

In fact, even with the GUI this bug has persisted yet. Bu by using the command line no longer. My "problem" was my password started with a non alphanumeric character (eg: #, @, !, *, % etc.), so I just put a "\" before it and everything is well-running righ now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.