GYB Error Message

349 views
Skip to first unread message

Jarid

unread,
Sep 5, 2011, 2:56:40 PM9/5/11
to Got Your Back: Gmail Backup
I am using GYB Gui Alpha 1 with GYB Alpha 17 on a Windows XP
platform. There are 28,635 message to backup. Estimate works without
any issues.

When I attempt a backup, I get the following error message (when
handling messages at 1200):

Traceback <most recent call last>:
File "gyb.py", line 921, in <module>
File "gyb.py", line 667, in main
sqlite3.IntegrityError: columns message_num, label are not unique

Any assistance is appreciated.

thumper369

unread,
Sep 9, 2011, 11:29:45 AM9/9/11
to got-yo...@googlegroups.com
I am also having this issue.

It worked great for one of my accounts but not this one. 

GYB needs to examine 16556 messages
GYB already has a backup of 0 messages
GYB needs to backup 16556 messages
backed up 1000 of 16556 messagesTraceback (most recent call last):

Brett Carver

unread,
Sep 9, 2011, 12:13:11 PM9/9/11
to got-yo...@googlegroups.com
On Fri, Sep 9, 2011 at 8:29 AM, thumper369 <j...@byersplace.com> wrote:
Traceback (most recent call last):
  File "gyb.py", line 921, in <module>
  File "gyb.py", line 667, in main
sqlite3.IntegrityError: columns message_num, label are not unique


I have no idea about the error, but the first think I'd try is moving the backup data elsewhere and do a full backup of the account again.  If it succeeds, doing a diff between the old/new database might reveal something interesting/useful.

thumper369

unread,
Sep 9, 2011, 12:17:59 PM9/9/11
to Got Your Back: Gmail Backup
I wonder how many characters the duplicate match comes on. Some of my
labels were the same up to the 10th character then they were
different. I shortened that and now its working much better.


On Sep 9, 11:13 am, Brett Carver <brett.car...@gmail.com> wrote:
> *On Fri, Sep 9, 2011 at 8:29 AM, thumper369 <j...@byersplace.com> wrote:
> *
>
> > *Traceback (most recent call last):
> >   File "gyb.py", line 921, in <module>
> >   File "gyb.py", line 667, in main
> > sqlite3.IntegrityError: columns message_num, label are not unique*

Brett Carver

unread,
Sep 9, 2011, 12:30:03 PM9/9/11
to got-yo...@googlegroups.com
On Fri, Sep 9, 2011 at 9:17 AM, thumper369 <j...@byersplace.com> wrote:
I wonder how many characters the duplicate match comes on.

The program is open source and you have the exact line number if failed at.  If you're comfortable you could check the source and figure that out.

thumper369

unread,
Sep 9, 2011, 6:02:56 PM9/9/11
to Got Your Back: Gmail Backup
Agreed. I downloaded the source went to the Label section but got
lost in all the regular expression logic.



On Sep 9, 11:30 am, Brett Carver <brett.car...@gmail.com> wrote:
> *On Fri, Sep 9, 2011 at 9:17 AM, thumper369 <j...@byersplace.com> wrote:
> *
>
> > *I wonder how many characters the duplicate match comes on.*

Brian Kennelly

unread,
Sep 9, 2011, 6:11:13 PM9/9/11
to got-yo...@googlegroups.com
I am curious. It should not matter, but do any of your labels have spaces, quotes or other "special" characters? 

It is easy to fix the problem, but it would be better to figure out how we got there. 

--
You received this message because you are subscribed to the Google
Groups "Got Your Back: Gmail Backup" group.
To post to this group, send email to got-yo...@googlegroups.com
To unsubscribe from this group, send email to
got-your-bac...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/got-your-back?hl=en?hl=en



--
Brian Kennelly

Brian Kennelly

unread,
Sep 9, 2011, 6:19:14 PM9/9/11
to got-yo...@googlegroups.com
That should have been, "it is easy to change the code to ignore the problem". 

Send a list of the labels in your account.
--
Brian Kennelly

Sandip Shah

unread,
Sep 9, 2011, 6:26:44 PM9/9/11
to Got Your Back: Gmail Backup
Hi,

The regular expression just parses the data that comes with the
email ... e.g. (a part) of the message is like this:

(X-GM-LABELS ("\\Inbox") UID 5835 INTERNALDATE "17-Aug-2010 15:16:54
+0000" FLAGS () BODY[] {21993}

The regular expresion just finds the "labels" associated with that
particular message ("Inbox" in this case), the UID (5385),
internaldate (17-Aug-2010 15:16:54 +0000) and the flags (none here ...
but it would be something like 'seen' or other gmail specific flags).

The labels are then split (shlex.split) into multiple labels before
they are inserted into the db. If your subfolder structure was
something like Folder1/Folder2/Folder3/Folder1 (notice that Folder1 is
getting repeated), then during insertion in the db, this would have
caused a duplicated which would generate an error.

SS

thumper369

unread,
Sep 9, 2011, 6:33:24 PM9/9/11
to Got Your Back: Gmail Backup
Unfortunately I have already changed the labels that caused the
problem. But yes there were both nesting and special characters.

Brian Kennelly

unread,
Sep 9, 2011, 6:35:30 PM9/9/11
to got-yo...@googlegroups.com
On Fri, Sep 9, 2011 at 15:26, Sandip Shah <sandi...@vthrive.com> wrote:
 If your subfolder structure was
something like Folder1/Folder2/Folder3/Folder1 (notice that Folder1 is
getting repeated), then during insertion in the db, this would have
caused a duplicated which would generate an error.

No, that should not be a problem. Labels are reported and stored as simple strings. A label like "Folder1/Folder2/Folder3/Folder1" would just get stored as that name.

A more likely problem would be a character in the label that caused the shlex.split function to split the label name incorrectly, so that it was treated as two labels, one of which matched another.


--
Brian Kennelly

Brian Kennelly

unread,
Sep 9, 2011, 6:54:15 PM9/9/11
to got-yo...@googlegroups.com
Did you have any labels with backslash characters? - "\"
--
Brian Kennelly

Sandip Shah

unread,
Sep 10, 2011, 2:21:58 AM9/10/11
to Got Your Back: Gmail Backup
I did a quick test and from what I can tell, shlex.split function is
only splitting on spaces ... not '/', '\', '?', or '-'.

If there was a folder like 'folder1 folder2 folder1' ... then the
shlex.split function would create a list ['folder1', 'folder2',
'folder1'] ... the first two entries would go fine in the labels
table, but the third one would give an error.

SS

On Sep 9, 3:54 pm, Brian Kennelly <bkenne...@gmail.com> wrote:
> Did you have any labels with backslash characters? - "\"
>
>
>
>
>
>
>
>
>
> On Fri, Sep 9, 2011 at 15:35, Brian Kennelly <bkenne...@gmail.com> wrote:

Brian Kennelly

unread,
Sep 10, 2011, 11:50:19 AM9/10/11
to got-yo...@googlegroups.com
On Fri, Sep 9, 2011 at 23:21, Sandip Shah <sandi...@vthrive.com> wrote:
If there was a folder like 'folder1 folder2 folder1' ... then the
shlex.split function would create a list ['folder1', 'folder2',
'folder1'] ... the first two entries would go fine in the labels
table, but the third one would give an error.

No. The shlex.split method respects the quotes, and returns the label as the single token "folder1 folder2 folder1" and stores it correctly in the database. (Try it!)

I wonder though, if the shlex defaults are different in the Windows version. I only use it from Linux, so that could be a possible difference. I'll test it, and, if necessary, specify the explicit options.


--
Brian Kennelly

Brian Kennelly

unread,
Sep 10, 2011, 1:22:23 PM9/10/11
to got-yo...@googlegroups.com
Update:
I found the problem, and the reason I didn't detect it. I have the source fixed and, as soon as I finish testing, i will check it in. 

I am not sure when I will be able to create the windows executable, but I will try not to take too long.

Brian Kennelly

unread,
Sep 10, 2011, 1:48:11 PM9/10/11
to got-yo...@googlegroups.com
Alpha-0.16 should work correctly.  You can find it on the download page. The bug was introduced in Alpha 0.17

--
You received this message because you are subscribed to the Google
Groups "Got Your Back: Gmail Backup" group.
To post to this group, send email to got-yo...@googlegroups.com
To unsubscribe from this group, send email to
got-your-bac...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/got-your-back?hl=en?hl=en



--
Brian Kennelly

Jay Lee

unread,
Sep 11, 2011, 3:50:26 PM9/11/11
to got-yo...@googlegroups.com
The changes in 0.17 were meant to correct issues with labels that had quotes in them but apparently they broke other special characters.

We need to determine what characters are allowed in labels, setup a test account with all such possible characters in various lables (and at least one message with each label) and use it to test the regex code.

Jay
--
Jay Lee

Brian Kennelly

unread,
Sep 11, 2011, 4:21:08 PM9/11/11
to got-yo...@googlegroups.com
I have several test labels with single and double quotes in pairs and alone, and do not have any problems backing up or restoring them with Alpha 0.16 or 0.18, but they don't work properly with 0.17.  (I also have labels with many other characters for testing.)

Labels in Gmail can contain most Unicode characters, but only printable ASCII characters appear in the IMAP responses. (Non-ASCII characters are passed in "modified UTF-7", as described in RFC3501.) So, we should only need to worry about printable ASCII for testing.

If there are any known labels that don't work, we can work from them.

dterborg

unread,
Dec 14, 2011, 2:00:17 PM12/14/11
to got-yo...@googlegroups.com
I am having this exact same problem, with an identical error message (down to the line numbers).  I have renamed a few of my labels , as a few had a backslash in them, to ensure this was not a problem, and this did not solve it.  The backup goes to 600 of 4331 messages before the error occurs.
Reply all
Reply to author
Forward
0 new messages