Notices


Reply
Thread Tools
Posts: 5 | Thanked: 2 times | Joined on Dec 2010
#481
Hello all, I've been having crashes from an overflow in erminig.

It seems that google has a date somehow in there with year > 2038, which is past the Unix Epoch overflow, causing a crash.

This is with the patches provided by thomasvs, which fixes a crash earlier in the sync.

Anyone know of a way to fix this?


Code:
Traceback (most recent call last):
  File "/usr/bin/erminig", line 153, sync_all_profiles(widget=<gtk.ToolButton object at 0x41f79a08 (GtkToolButton at 0x4c71f0)>, data=<hildon.StackableWindow object at 0x41f79030 (HildonStackableWindow at 0x457060)>)
        id = i[0]
        do_profile_sync(id, data)
  variables: {'data': ('local', <hildon.StackableWindow object at 0x41f79030 (HildonStackableWindow at 0x457060)>), 'id': ('local', 1), 'do_profile_sync': ('global', <function do_profile_sync at 0x41fa62f0>)}
  File "/usr/bin/erminig", line 125, do_profile_sync(id=1, data=<hildon.StackableWindow object at 0x41f79030 (HildonStackableWindow at 0x457060)>)
            profile['remoteSource'], \
            profile['lastUpdate'], progress)
  variables: {'profile': ('local', {'lastUpdate': 1291137278, 'direction': 0, 'lastLocalUpdate': 1291137281, 'remoteSourceTitle': u'Gabriel Devenyi', 'remoteAccountId': 1, 'enabled': 1, 'localSource': u'1', 'remoteSource': u'myemail', 'localSourceTitle': u'N900', 'id': 1}), 'progress': ('local', <gtk.ProgressBar object at 0x41f7b210 (GtkProgressBar at 0x4dd8d0)>)}
  File "/usr/share/erminig/erminig_core.py", line 524, syncFromGoogle(pid=1, localSource=u'1', remoteSource=u'myemail', lastSync=1291137278, progress=<gtk.ProgressBar object at 0x41f7b210 (GtkProgressBar at 0x4dd8d0)>)
      getNewEventsFromGoogle(pid, int(localSource), remoteSource, lastSync, \
          progress)
  variables: {'progress': ('local', <gtk.ProgressBar object at 0x41f7b210 (GtkProgressBar at 0x4dd8d0)>)}
  File "/usr/share/erminig/erminig_core.py", line 262, getNewEventsFromGoogle(pid=1, localSource=1, remoteSource=u'myemail', lastSync=1291137278, progress=<gtk.ProgressBar object at 0x41f7b210 (GtkProgressBar at 0x4dd8d0)>)
        else:
          start_time = iso8601ToTimestamp(e.when[0].start_time)
          end_time = iso8601ToTimestamp(e.when[0].end_time)
  variables: {'start_time': ('local', None), 'e.when': ('local', [<gdata.calendar.When object at 0x42061fd0>]), 'iso8601ToTimestamp': ('global', <function iso8601ToTimestamp at 0x4107ab70>)}
  File "/usr/share/erminig/erminig_core.py", line 136, iso8601ToTimestamp(date='2050-12-24T22:00:00.000Z')
      return int(iso8601.parse(date))
  variables: {'int': ('builtin', <type 'int'>), 'date': ('local', '2050-12-24T22:00:00.000Z'), 'iso8601.parse': ('global', <function parse at 0x4107a470>)}
  File "/usr/share/erminig/iso8601.py", line 24, parse(s='2050-12-24T22:00:00.000Z')
        gmt = __extract_date(m) + __extract_time(m) + (0, 0, 0)
        return time.mktime(gmt) + __extract_tzd(m) - time.timezone
  variables: {'time.timezone': ('global', 18000), 'time.mktime': ('global', <built-in function mktime>), 'm': ('local', <_sre.SRE_Match object at 0x4107f9a0>), '__extract_tzd': ('global', <function __extract_tzd at 0x4107a5f0>), 'gmt': ('local', (2050, 12, 24, 22, 0, 0, 0, 0, 0))}
OverflowError: mktime argument out of range
 
Posts: 5 | Thanked: 2 times | Joined on Dec 2010
#482
Okay, I have a naive solution for the problem, not sure what this is going to do in the future, in erminig_core.py I made the following modification:

Code:
def iso8601ToTimestamp(date):
	"""
	@type date: str
	"""
	# FIXME: Google passes dtstart like 2008-12-10T00:00:00
	if not date[-6] in ('+', '-') and not date.endswith('Z'):
		date += 'Z'

+	if int(date[0:4]) > 2037:
+		return int(iso8601.parse(string.replace(date, date[:4], "2037", 1)))

	return int(iso8601.parse(date))
This wraps the dates above 2038 to the year 2037 in the phone calendar and prevents the overflow bug. I do not know if this screws things up elsewhere so proceed with caution.
 

The Following User Says Thank You to gdevenyi For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#483
I think I'm just bumping but nevertheless. Great software, got me back to -Devel, thanks for this, just what I needed since NuevaSync came payware (as mentioned earlier). However, I did notice few random bugs.

1. Titles for syncable entries (such as Holiday, Work and Misc) do not always show up and are left as blank. Syncing still works though.
2. One title stopped mysteriously working. The title was for Finnish Vapaa-aika (free time). Don't know why but it just stopped working. No syncs whatsoever. I assume, that three different entries was too much, since I use three different entries and sync them all from one account.
3. Trying to edit the added Google Account results in "bug". This means that the app tells the user, that a bug has occurred and thus the action can not be completed. Log can be printed though (this is the most re-active bug and most likely can be re-produced).
4. An old one. Alarms do not sync.

Otherwise great app, even though it's in -Devel. I'd though request some sort of clarification to the icons, I didn't know what the one with "1" was, until I read the thread (it's for syncing just the selected entry).
 
Posts: 5 | Thanked: 12 times | Joined on Oct 2010
#484
Hi,

I've been missing reminder sync from Erminig, so today, finally, I opened my toolbox called vim ;-). erminig-0.2.11.patch adds support for alarm/reminder sync. You can uncompress erminig-0.2.11.patched.tgz under /: tar zxvf erminig-0.2.11.patched.tgz. This tarball replaces:

/usr/share/erminig/Event.py
/usr/share/erminig/cwrapper.py
/usr/share/erminig/erminig_core.py
/usr/share/erminig/libcalaccess.so

Note that Python Google Calendar API supports reminders only in the primary calendar. One workaround for this limitation is to add reminders from non-primary Google calendars and sync them to N900.

Thanks.
 

The Following 6 Users Say Thank You to geni4u For This Useful Post:
Posts: 5 | Thanked: 2 times | Joined on Dec 2010
#485
Thanks for this! I look forward to trying it out. Have you considered integrating the other patches floating around in this thread which fix some bugs?
 
rebhana's Avatar
Posts: 579 | Thanked: 471 times | Joined on Jan 2010 @ Austria
#486
Originally Posted by Jaffa View Post
Thanks. 16 pages of forum threads do not documentation make; so I've added the start of instructions to wiki.maemo.org/Sync.
I would be willing to help with the wiki, but even after having read through most of the 16 pages, I'm a bit at a loss at how erminig needs to be set up. I've followed the instructions, but after the first sync between my built-in calendar and my google calendar which were synced until now by nuevasync every entry in the future got duplicated.

Do I have to empty one of the calenars before starting the sync with erminig?

And would anyone have a good suggestion of how to clean a google calendar from zillions of duplicated entries...?
__________________
Need more apps for the N900? Check out Qole's Easy Debian and read the wiki!
My Easy Debian installation log

Last edited by rebhana; 2010-12-04 at 11:11.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#487
Originally Posted by rebhana View Post
I would be willing to help with the wiki, but even after having read through most of the 16 pages, I'm a bit at a loss at how erminig needs to be set up. I've followed the instructions, but after the first sync between my built-in calendar and my google calendar which were synced until now by nuevasync every entry in the future got duplicated.

Do I have to empty one of the calenars before starting the sync with erminig?

And would anyone have a good suggestion of how to clean a google calendar from zillions of duplicated entries...?
Yeah, I got duplicates as well. You may want to use more titles for entries (e.g. vacation, home, work) to avoid massive work of deleting the duplicates from one calendar. Also, the good way to avoid the duplicates is to use "From Google"-sync only. This way you can't get duplicates. If you let your calendar add entries to the Google Calendar and vice versa you might get duplicates, again.

So in short : use more than one title for entries and sync from Google. One way sync should be fine, two way sync seems to be troublesome, for now (or maybe it's just PEBKAC).

Last edited by rantom; 2010-12-04 at 11:42. Reason: Fixing the last sentence.
 
rebhana's Avatar
Posts: 579 | Thanked: 471 times | Joined on Jan 2010 @ Austria
#488
Originally Posted by rantom View Post
Yeah, I got duplicates as well. You may want to use more titles for entries (e.g. vacation, home, work) to avoid massive work of deleting the duplicates from one calendar. Also, the good way to avoid the duplicates is to use "From Google"-sync only. This way you can't get duplicates. If you let your calendar add entries to the Google Calendar and vice versa you might get duplicates, again.

So in short : use more than one title for entries and sync from Google. One way sync should be fine, two way sync seems to be troublesome, for now (or maybe it's just PEBKAC).
What do you mean by "more than one title for entries"? And if I only can sync from google then it's not really what erminig is being advertised for. I can't believe I've missed this crucial bit of bad news after reading so much of this thread. Now my google calendar is really messed up.
__________________
Need more apps for the N900? Check out Qole's Easy Debian and read the wiki!
My Easy Debian installation log
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#489
Originally Posted by rebhana View Post
I would be willing to help with the wiki, but even after having read through most of the 16 pages, I'm a bit at a loss at how erminig needs to be set up. I've followed the instructions, but after the first sync between my built-in calendar and my google calendar which were synced until now by nuevasync every entry in the future got duplicated.
I started from scratch. It's an entirely different approach to Nuevasync (and I'm actually surprised it worked at all).

I create one calendar on the N900 per Google Calendar and then set up individual sync profiles; most two-way, but one is download only.

And would anyone have a good suggestion of how to clean a google calendar from zillions of duplicated entries...?
Apart from deleting it and starting again?
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 

The Following User Says Thank You to Jaffa For This Useful Post:
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#490
Originally Posted by gdevenyi View Post
Thanks for this! I look forward to trying it out. Have you considered integrating the other patches floating around in this thread which fix some bugs?
lorelei has said he's going to spend more time on it - I don't think we're at a fork position yet. And, if we were, a proper package in Extras-devel would be better than overwriting bits from tarballs.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 
Reply

Tags
erminig, erminig-ng, ernie nig, google calendar, google sync, synchronization


 
Forum Jump


All times are GMT. The time now is 17:20.