Modify

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#18772 closed defect (fixed)

JsonParsingException: Invalid token=EOF

Reported by: anonymous Owned by: team
Priority: blocker Milestone: 20.02
Component: Core Version:
Keywords: template_report taginfo json geofabrik Cc:

Description (last modified by simon04)

UPDATE TO JOSM 15937 OR NEWER

What steps will reproduce the problem?

  1. Windows installation 15927
  2. Start JOSM 15927
  3. Non expected exception

What is the expected result?

What happens instead?

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-02-24 22:06:28 +0100 (Mon, 24 Feb 2020)
Build-Date:2020-02-24 21:08:22
Revision:15927
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15927 cs) Windows 10 64-Bit
OS Build number: Windows 10 Home 1909 (18363)
Memory Usage: 247 MB / 989 MB (167 MB allocated, but free)
Java version: 1.8.0_241-b07, Oracle Corporation, Java HotSpot(TM) Client VM
Screen: \Display0 1366x768, \Display1 1920x1080
Maximum Screen Size: 1920x1080

Plugins:
+ FastDraw
+ buildings_tools
+ imagery_offset_db
+ mapathoner
+ markseen
+ measurement
+ scripting
+ terracer
+ todo
+ utilsplugin2

Last errors/warnings:
- E: Handled by bug report queue: javax.json.stream.JsonParsingException: Invalid token=EOF at (line no=3, column no=49, offset=97). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL, SQUARECLOSE]


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: main (1)
javax.json.stream.JsonParsingException: Invalid token=EOF at (line no=3, column no=49, offset=97). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL, SQUARECLOSE]
	at org.glassfish.json.JsonParserImpl.parsingException(JsonParserImpl.java:437)
	at org.glassfish.json.JsonParserImpl.getArray(JsonParserImpl.java:328)
	at org.glassfish.json.JsonParserImpl.getValue(JsonParserImpl.java:180)
	at org.glassfish.json.JsonParserImpl.getObject(JsonParserImpl.java:339)
	at org.glassfish.json.JsonParserImpl.getObject(JsonParserImpl.java:173)
	at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:170)
	at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:123)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:99)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:903)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:276)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:703)

Attachments (4)

mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.json (49 bytes) - added by GerdP 3 months ago.
file found in cache
mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.2.json (52 bytes) - added by GerdP 3 months ago.
possible replacement for the corrupted file in cache to make JOSM work.
18772.patch (784 bytes) - added by GerdP 3 months ago.
18772.2.patch (911 bytes) - added by GerdP 3 months ago.
log warning instead of showing a bug report

Download all attachments as: .zip

Change History (68)

comment:1 Changed 3 months ago by stoecker

Ticket #18773 has been marked as a duplicate of this ticket.

comment:2 Changed 3 months ago by stoecker

Ticket #18774 has been marked as a duplicate of this ticket.

comment:3 Changed 3 months ago by stoecker

Ticket #18776 has been marked as a duplicate of this ticket.

comment:4 Changed 3 months ago by stoecker

Summary: Non expected exceptionJsonParsingException: Invalid token=EOF

comment:5 Changed 3 months ago by stoecker

Ticket #18775 has been marked as a duplicate of this ticket.

comment:6 Changed 3 months ago by GerdP

Maybe an invalid file at Geofabrik? I see this error with the same stack trace:

2020-02-26 08:15:04.831 FINE: Contacting Server...
2020-02-26 08:15:05.083 INFO: GET https://josm.openstreetmap.de/remote/geofabrik-index-v1-nogeom.json -> HTTP/1.1 200 (252 ms; 49 B)
2020-02-26 08:15:05.084 FINE: RESPONSE: {Keep-Alive=[timeout=5, max=100], null=[HTTP/1.1 200 OK], Server=[Apache/2.4.29 (Ubuntu)], Connection=[Keep-Alive], Last-Modified=[Wed, 26 Feb 2020 04:55:02 GMT], Date=[Wed, 26 Feb 2020 07:15:06 GMT], Accept-Ranges=[bytes], Strict-Transport-Security=[max-age=16070400; includeSubDomains], ETag=["31-59f73683ea4ad"], Content-Length=[49], Age=[7927], X-Clacks-Overhead=[GNU Terry Pratchett], Content-Type=[application/json]}
2020-02-26 08:15:05.084 FINE: Downloading data...
2020-02-26 08:15:12.405 SEVERE: Handled by bug report queue: javax.json.stream.JsonParsingException: Invalid token=EOF at (line no=3, column no=49, offset=97). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL, SQUARECLOSE]
javax.json.stream.JsonParsingException: Invalid token=EOF at (line no=3, column no=49, offset=97). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL, SQUARECLOSE]

comment:7 Changed 3 months ago by GerdP

Keywords: taginfo added
Priority: normalblocker

comment:8 Changed 3 months ago by GerdP

Ticket #18777 has been marked as a duplicate of this ticket.

comment:9 Changed 3 months ago by as@…

Some more information on this problem:

I installed JDK for the first time on this computer.

JOSM was also installed for the first time on this computer.

Both were the latest versions.

Error message.

I tried to run JOSM with the JDK, but it didn't work.

Deinstalled everything and installed JRE and JOSM again.

Same problem.

Deinstalled JOSM.

Tried an older version of JOSM. Same problem.

comment:10 Changed 3 months ago by GerdP

JOSM before r15876 should be okay.

comment:11 Changed 3 months ago by GerdP

Ticket #18780 has been marked as a duplicate of this ticket.

Changed 3 months ago by GerdP

possible replacement for the corrupted file in cache to make JOSM work.

comment:12 Changed 3 months ago by GerdP

@Dirk: Don't know how a .json should look like but the attached file is accepted by JOSM. Maybe serve this until we have a better version?

comment:13 Changed 3 months ago by anonymous

The location of the file GerdP linked above is "/home/..../.cache/JOSM/" on Linux.

Changed 3 months ago by GerdP

Attachment: 18772.patch added

comment:14 Changed 3 months ago by GerdP

With the attached patch JOSM startup continues instead of waiting forever but the bug report popup is still shown, so it's not a fix, more a work around.

comment:15 Changed 3 months ago by anonymous

Ticket #18784 has been marked as a duplicate of this ticket.

comment:16 Changed 3 months ago by stoecker

JOSM should start with a notice that this file is corrupt, not with a bug report. :-)

comment:17 Changed 3 months ago by stoecker

See #18729

comment:18 Changed 3 months ago by stoecker

Ticket #18789 has been marked as a duplicate of this ticket.

comment:19 Changed 3 months ago by stoecker

Ticket #18788 has been marked as a duplicate of this ticket.

comment:20 Changed 3 months ago by stoecker

Ticket #18790 has been marked as a duplicate of this ticket.

comment:21 Changed 3 months ago by anonymous

it was reported on Telegram by Branko Kokanović that downloading https://josm.openstreetmap.de/download/josm-snapshot-15871.jar and running it works

Changed 3 months ago by GerdP

Attachment: 18772.2.patch added

log warning instead of showing a bug report

comment:22 Changed 3 months ago by stoecker

Temporary serve Gerd's fix so we don't get more and more reports, see also #18302.

comment:23 Changed 3 months ago by stoecker

Please do a checkin when you think that works fine. I'll release a hotfix then.

comment:24 Changed 3 months ago by stoecker

Ticket #18791 has been marked as a duplicate of this ticket.

comment:25 Changed 3 months ago by GerdP

Is there a way to tell JOSM that the cached file should be updated?

comment:26 Changed 3 months ago by stoecker

Ticket #18787 has been marked as a duplicate of this ticket.

comment:27 Changed 3 months ago by stoecker

Ticket #18786 has been marked as a duplicate of this ticket.

comment:28 Changed 3 months ago by stoecker

Ticket #18785 has been marked as a duplicate of this ticket.

comment:29 Changed 3 months ago by stoecker

Ticket #18783 has been marked as a duplicate of this ticket.

comment:30 Changed 3 months ago by stoecker

Ticket #18782 has been marked as a duplicate of this ticket.

comment:31 in reply to:  25 Changed 3 months ago by stoecker

Replying to GerdP:

Is there a way to tell JOSM that the cached file should be updated?

None that I'm aware of.

comment:32 Changed 3 months ago by stoecker

Ticket #18792 has been marked as a duplicate of this ticket.

comment:33 Changed 3 months ago by stoecker

Ticket #18781 has been marked as a duplicate of this ticket.

comment:34 Changed 3 months ago by stoecker

Ticket #18779 has been marked as a duplicate of this ticket.

comment:35 Changed 3 months ago by stoecker

Ticket #18778 has been marked as a duplicate of this ticket.

comment:36 Changed 3 months ago by stoecker

They are creating tickets faster than I can close them :-)

comment:37 Changed 3 months ago by GerdP

Resolution: fixed
Status: newclosed

In 15937/josm:

fix #18772: log warning instead of showing bug report popup and continue initialization

comment:38 Changed 3 months ago by GerdP

The file that is now served is also not ok. It contains html.

comment:39 Changed 3 months ago by GerdP

Content of my work around file looks like this

{ "type": "FeatureCollection",
    "features": []
} 

I've just added the missing closing brackets.

Last edited 3 months ago by Don-vip (previous) (diff)

comment:40 in reply to:  38 Changed 3 months ago by stoecker

Replying to GerdP:

The file that is now served is also not ok. It contains html.

Ahhhh. Took the wiki display, not the raw file. Fixed.

comment:41 Changed 3 months ago by stoecker

Hotfix released. Everybody please update to most recent version!

Last edited 3 months ago by stoecker (previous) (diff)

comment:42 Changed 3 months ago by stoecker

Ticket #18793 has been marked as a duplicate of this ticket.

comment:43 in reply to:  42 Changed 3 months ago by stoecker

Replying to stoecker:

Ticket #18793 has been marked as a duplicate of this ticket.

The first report due to the HTML file delivery :-(

comment:44 in reply to:  22 Changed 3 months ago by stoecker

Replying to stoecker:

Temporary serve Gerd's fix so we don't get more and more reports, see also #18302.

Removed fix. Frederik fixed the data source.

comment:45 Changed 3 months ago by GerdP

Users should stop JOSM, remove the bad version of file mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.json in the cache directory and start JOSM again. The correct file is needed for the local taginfo instances and is > 400.000 bytes in size.

comment:46 in reply to:  45 ; Changed 3 months ago by stoecker

Replying to GerdP:

Users should stop JOSM, remove the bad version of file mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.json in the cache directory and start JOSM again. The correct file is needed for the local taginfo instances and is > 400.000 bytes in size.

If it starts with the broken file there is no problem. Without this file, the links to national taginfo instances aren't displayed until the next time the file is fetched. That's no big issue in my eyes.

comment:47 Changed 3 months ago by stoecker

Ticket #18794 has been marked as a duplicate of this ticket.

comment:48 in reply to:  46 Changed 3 months ago by GerdP

Replying to stoecker:

If it starts with the broken file there is no problem. Without this file, the links to national taginfo instances aren't displayed until the next time the file is fetched. That's no big issue in my eyes.

Yes, no problem as users can work. OTOH itis a new feature and it might not work for the next 7 days if I understand the comments in CachedFile correctly. So, my hint was for those who are interested in this new feature.

comment:49 Changed 3 months ago by Klumbumbus

Milestone: 20.02

comment:50 in reply to:  36 Changed 3 months ago by Klumbumbus

Replying to stoecker:

They are creating tickets faster than I can close them :-)

And we have a nice example of a ticket of priority blocker :-)

comment:51 Changed 3 months ago by Don-vip

Thanks guys for taking care of this while I was away :)

comment:52 Changed 3 months ago by Don-vip

Keywords: json geofabrik added

comment:53 Changed 3 months ago by Don-vip

@Gerd: I would change the translated string from:

tr("Failed to parse taginfo data geofabrik-index-v1-nogeom.json")

to:

tr("Failed to parse taginfo external data: {0}", "geofabrik-index-v1-nogeom.json")

This way we can keep the translation if the filename changes, or if we add more external sources.

comment:54 Changed 3 months ago by GerdP

Yes, looks good. I just tried to find a quick fix without even knowing what the file contains normally.
I assume that there may be other possible exceptions as well.
Maybe we can setup a test on the JOSM server (or maybe at Geofabrik) to make sure that the file is valid?

comment:55 Changed 3 months ago by stoecker

I'd also add the exception error message to the output.

comment:56 Changed 3 months ago by GerdP

+1 (I am not working on this)

comment:57 Changed 3 months ago by Don-vip

In 15952/josm:

see #18772 - better error message, add non-regression tests

comment:58 Changed 3 months ago by Don-vip

In 15956/josm:

see #18772 - remove accidental JUnit5 assertion

comment:59 Changed 3 months ago by Don-vip

In 15957/josm:

see #18772 - fix unit test

comment:60 Changed 3 months ago by GerdP

Seems we have a problem again:

2020-03-02 11:26:34.832 WARNING: Failed to parse external taginfo data at https://josm.openstreetmap.de/remote/geofabrik-index-v1-nogeom.json: Invalid token=EOF at (line no=6119, column no=2252, offset=359085). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL]
Last edited 3 months ago by GerdP (previous) (diff)

comment:61 Changed 3 months ago by GerdP

Downloaded file mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.json is truncated.

Last edited 3 months ago by GerdP (previous) (diff)

comment:62 Changed 3 months ago by GerdP

Ticket #18846 has been marked as a duplicate of this ticket.

comment:63 Changed 3 months ago by simon04

Description: modified (diff)

comment:64 Changed 3 months ago by Don-vip

In 16032/josm:

see #18772 - fix unit test

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.