Opened 2 years ago

Closed 2 years ago

#1976 closed defect (fixed)

BuildTime.EARLIEST datetime string is unparseable on older Android devices

Reported by: str4d Owned by: zzz
Priority: critical Milestone: 0.9.30
Component: api/utils Version: 0.9.28
Keywords: Cc: zzz
Parent Tickets: Sensitive: no

Description

Spotted this error on Google Play. Several variants depending on entry point, but all centered on Clock initialization:

java.lang.ExceptionInInitializerError
	at net.i2p.util.Clock.<init>(Clock.java:35)
	at net.i2p.router.RouterClock.<init>(RouterClock.java:65)
	at net.i2p.router.RouterContext.initializeClock(RouterContext.java:493)
	at net.i2p.I2PAppContext.clock(I2PAppContext.java:827)
	at net.i2p.router.util.EventLog.addEvent(EventLog.java:95)
	at net.i2p.router.Router.runRouter(Router.java:594)
	at net.i2p.router.Router.main(Router.java:1590)
	at net.i2p.router.RouterLaunch.main(RouterLaunch.java:24)
	at net.i2p.android.router.service.RouterService$Starter.run(RouterService.java:216)
	at java.lang.Thread.run(Thread.java:1027)
Caused by: java.lang.RuntimeException: BuildTime FAIL
	at net.i2p.time.BuildTime.<clinit>(BuildTime.java:53)
	... 10 more
Caused by: java.text.ParseException: Unparseable date: "2016-02-19 12:00:00 UTC"
	at java.text.DateFormat.parse(DateFormat.java:626)
	at net.i2p.time.BuildTime.<clinit>(BuildTime.java:46)
	... 10 more

Only occurring since the 0.9.28 Android release. 20 reports in total, 19 from Android 2.3.3 - 2.3.7, one from Android 3.2.

Subtickets

Change History (5)

comment:1 Changed 2 years ago by str4d

Cc: zzz added

I spotted this after pushing 0.9.29, but have continued doing so as this is a problem inside i2p.jar (which is already on Maven Central) and therefore not something that can be fixed before 0.9.30.

comment:2 Changed 2 years ago by str4d

Hmm, the code in question was added in February 2016, and there have been three Android releases since then without reports. So maybe it was a problem before, but there weren't any reports (or any users with those older devices).

Last edited 2 years ago by str4d (previous) (diff)

comment:3 Changed 2 years ago by zzz

It's certainly the time zone. Will try to chase it down.

comment:4 Changed 2 years ago by zzz

Owner: set to zzz
Status: newaccepted

'z' supported since API 1 https://developer.android.com/reference/java/text/SimpleDateFormat.html

Whatever the issue, clearly we need to not throw a RuntimeException?, but just deal with it and fail soft. I'll fix it somehow.

comment:5 Changed 2 years ago by zzz

Resolution: fixed
Status: acceptedclosed

In 49f1abae144331c6e28f68959401284ead7621da 0.9.29-12

Sorry about that, don't know what I was thinking throwing a RuntimeException? from a static block.

It would be helpful if we check the GPlay reports before each desktop release so we can fix things in the next release, or come up with some automated way of pulling new reports.

Note: See TracTickets for help on using tickets.