Modify

Opened 11 years ago

Closed 9 years ago

#8274 closed defect (duplicate)

JOSM prevents opening of local files if OSM server is down

Reported by: rickmastfan67 Owned by: team
Priority: blocker Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

Right now, the API is down for the main OSM website. Because of that, I can't edit any local files in JOSM because has completely frozen trying to get my "details".
GET http://api.openstreetmap.org/api/0.6/user/details
In fact, I can't even close the "Opening files" window or hit the "Cancel" button because of that, hence the blocker priority.

There should be a way to limit this check when you're ready to upload maybe? Or at least have a timeout after, say, 15 seconds. I wanted to at least work on some stuff in my saved file right now while the server was down...

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-12-15 02:31:55
Last Changed Author: bastiK
Revision: 5620
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-12-14 15:51:12 +0100 (Fri, 14 Dec 2012)
Last Changed Rev: 5620

Identification: JOSM/1.5 (5620 en)
Memory Usage: 154 MB / 2730 MB (91 MB allocated, but free)
Java version: 1.7.0_09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

Plugin: OpeningHoursEditor (28656)
Plugin: buildings_tools (28891)
Plugin: mapdust (28807)
Plugin: measurement (28898)
Plugin: mirrored_download (28939)
Plugin: openstreetbugs (28807)
Plugin: reverter (28820)
Plugin: turnrestrictions (28807)
Plugin: undelete (28807)
Plugin: utilsplugin2 (28807)

Attachments (0)

Change History (14)

comment:1 by stoecker, 11 years ago

Probably disconnecting network will help as a temporary solution...

comment:2 by Don-vip, 11 years ago

Do we have a mean to reproduce this behaviour when the API is not down ?

comment:3 by rickmastfan67, 11 years ago

Well, maybe if the User Details command could only be called if you try to download/upload data from/to the OSM server, that might be a good workaround for local files if you're online and the main API crashes completely and doesn't send you the 500 message. Still, I think forcing a timeout of 10-15 seconds max on that command might be the best action here.

And stoecker, I did do a quick test and yes, you can get local files to load if you turn your network off for a bit. So, that is a possible workaround as well.

in reply to:  2 comment:4 by stoecker, 11 years ago

Replying to Don-vip:

Do we have a mean to reproduce this behaviour when the API is not down ?

You can set your firewall to drop all outgoing packets to port 80. Should have same result.

Very likely for this API call the timeouts aren't set correctly. Usually we have a 30 second (I believe this is default, is configurable) timeout for everything.

comment:5 by bastiK, 11 years ago

We have connect timeout of 15 seconds and no read timeout when getting user details: OsmApi.java

You have to be careful with read timeout (see [4859]) but in this case it should be set.

in reply to:  2 comment:6 by bastiK, 11 years ago

Replying to Don-vip:

Do we have a mean to reproduce this behaviour when the API is not down ?

Yes, see http://josm.openstreetmap.de/ticket/6823#comment:3

comment:7 by Don-vip, 11 years ago

http://wiki.openstreetmap.org/wiki/March_2013_server_maintenance

There's a maintenance today (API read-only from 0900H to 1500H UTC), this is the perfect occasion to fix this ticket.

Last edited 11 years ago by Don-vip (previous) (diff)

in reply to:  7 comment:8 by rickmastfan67, 11 years ago

Replying to Don-vip:

http://wiki.openstreetmap.org/wiki/March_2013_server_maintenance

There's a maintenance today (API read-only from 0900H to 1500H UTC), this is the perfect occasion to fix this ticket.

Don't think this can be fully fixed today. I just tried it, and while it hangs for about 1-4 seconds, the main OSM website is sending the 500 error this time unlike previously. Once JOSM gets that message, the file loads properly.

Last edited 11 years ago by rickmastfan67 (previous) (diff)

comment:9 by rickmastfan67, 11 years ago

Alright, the API server is completely down right now and not in "read-only" mode for emergency maintenance.

This time, there is a problem with the GET http://api.openstreetmap.org/api/capabilites... function. This doesn't seem to hamper the start up of JOSM, it does hamper opening a local file, but doesn't completely freeze JOSM. Instead, you have to wait about 50 seconds before you can view your saved file. JOSM attempts to do the GET http://api.openstreetmap.org/api/capabilites... call 5 times, but each time, gets the "Internal Server Error" message in the CL. After it gets that message, it waits 10 seconds and then tries again up to the 5 times.

To be honest, if it gets the "500" error of "Internal Server Error" after the first two attempts almost immediately, you can almost reliably assume 99.9% of the time that the next 3 times will get the same message. It would save the person 30 seconds at least when they are opening a local file to edit.

So, is there any way that could be tweaked a little bit to cut the check to just 2 if JOSM gets the "500" right away on the first 2 attempts?

comment:10 by stoecker, 11 years ago

Capabilities should be handled like any other external link. Download it through mirrored download.

comment:11 by rickmastfan67, 11 years ago

JOSM wouldn't let me for some odd reason. But now since the API came back up (but still in read-only), everything is working again.

comment:12 by akks, 11 years ago

I am working on cancel function for opening files...

comment:13 by akks, 11 years ago

In 5859/josm:

see #8274, #8601 : cancel now works while parsing OSM

comment:14 by Don-vip, 9 years ago

Resolution: duplicate
Status: newclosed

Closed as duplicate of #8885.
JOSM has now an offline mode. If OSM server is down, you should launch it with --offline=osm_api program argument.

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.