Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years 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 4 years ago.
file found in cache
mirror_https___josm.openstreetmap.de_remote_geofabrik-index-v1-nogeom.2.json (52 bytes ) - added by GerdP 4 years ago.
possible replacement for the corrupted file in cache to make JOSM work.
18772.patch (784 bytes ) - added by GerdP 4 years ago.
18772.2.patch (911 bytes ) - added by GerdP 4 years ago.
log warning instead of showing a bug report

Download all attachments as: .zip

Change History (68)

comment:1 by stoecker, 4 years ago

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

comment:2 by stoecker, 4 years ago

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

comment:3 by stoecker, 4 years ago

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

comment:4 by stoecker, 4 years ago

Summary: Non expected exceptionJsonParsingException: Invalid token=EOF

comment:5 by stoecker, 4 years ago

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

comment:6 by GerdP, 4 years ago

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 by GerdP, 4 years ago

Keywords: taginfo added
Priority: normalblocker

comment:8 by GerdP, 4 years ago

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

comment:9 by as@…, 4 years ago

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 by GerdP, 4 years ago

JOSM before r15876 should be okay.

comment:11 by GerdP, 4 years ago

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

by GerdP, 4 years ago

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

comment:12 by GerdP, 4 years ago

@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 by anonymous, 4 years ago

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

by GerdP, 4 years ago

Attachment: 18772.patch added

comment:14 by GerdP, 4 years ago

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 by anonymous, 4 years ago

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

comment:16 by stoecker, 4 years ago

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

comment:17 by stoecker, 4 years ago

See #18729

comment:18 by stoecker, 4 years ago

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

comment:19 by stoecker, 4 years ago

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

comment:20 by stoecker, 4 years ago

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

comment:21 by anonymous, 4 years ago

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

by GerdP, 4 years ago

Attachment: 18772.2.patch added

log warning instead of showing a bug report

comment:22 by stoecker, 4 years ago

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

comment:23 by stoecker, 4 years ago

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

comment:24 by stoecker, 4 years ago

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

comment:25 by GerdP, 4 years ago

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

comment:26 by stoecker, 4 years ago

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

comment:27 by stoecker, 4 years ago

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

comment:28 by stoecker, 4 years ago

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

comment:29 by stoecker, 4 years ago

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

comment:30 by stoecker, 4 years ago

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

in reply to:  25 comment:31 by stoecker, 4 years ago

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 by stoecker, 4 years ago

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

comment:33 by stoecker, 4 years ago

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

comment:34 by stoecker, 4 years ago

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

comment:35 by stoecker, 4 years ago

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

comment:36 by stoecker, 4 years ago

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

comment:37 by GerdP, 4 years ago

Resolution: fixed
Status: newclosed

In 15937/josm:

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

comment:38 by GerdP, 4 years ago

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

comment:39 by GerdP, 4 years ago

Content of my work around file looks like this

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

I've just added the missing closing brackets.

Version 0, edited 4 years ago by GerdP (next)

in reply to:  38 comment:40 by stoecker, 4 years ago

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 by stoecker, 4 years ago

Hotfix released. Everybody please update to most recent version!

Last edited 4 years ago by stoecker (previous) (diff)

comment:42 by stoecker, 4 years ago

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

in reply to:  42 comment:43 by stoecker, 4 years ago

Replying to stoecker:

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

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

in reply to:  22 comment:44 by stoecker, 4 years ago

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 by GerdP, 4 years ago

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.

in reply to:  45 ; comment:46 by stoecker, 4 years ago

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 by stoecker, 4 years ago

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

in reply to:  46 comment:48 by GerdP, 4 years ago

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 by Klumbumbus, 4 years ago

Milestone: 20.02

in reply to:  36 comment:50 by Klumbumbus, 4 years ago

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 by Don-vip, 4 years ago

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

comment:52 by Don-vip, 4 years ago

Keywords: json geofabrik added

comment:53 by Don-vip, 4 years ago

@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 by GerdP, 4 years ago

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 by stoecker, 4 years ago

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

comment:56 by GerdP, 4 years ago

+1 (I am not working on this)

comment:57 by Don-vip, 4 years ago

In 15952/josm:

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

comment:58 by Don-vip, 4 years ago

In 15956/josm:

see #18772 - remove accidental JUnit5 assertion

comment:59 by Don-vip, 4 years ago

In 15957/josm:

see #18772 - fix unit test

comment:60 by GerdP, 4 years ago

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 4 years ago by GerdP (previous) (diff)

comment:61 by GerdP, 4 years ago

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

Last edited 4 years ago by GerdP (previous) (diff)

comment:62 by GerdP, 4 years ago

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

comment:63 by simon04, 4 years ago

Description: modified (diff)

comment:64 by Don-vip, 4 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.