Modify

Opened 15 years ago

Closed 13 years ago

#4071 closed defect (worksforme)

JOSM doesn't get the hint about 401 Unauthorized

Reported by: avarab@… Owned by: team
Priority: major Milestone:
Component: Core Version: latest
Keywords: upload Cc:

Description

Here's a JOSM exception / a tcpflow dump of JOSM trying to upload to the API with the wrong password set in the preferences. It tries to carry on with the upload even though the server sends a 401 error and pops up a dialog with "org.openstreetmap.josm.io.OsmTransferCancelledException".

PUT http://api.openstreetmap.org/api/0.6/changeset/create... Internal Server Error
Waiting 10 seconds ... org.openstreetmap.josm.io.OsmTransferCancelledException
	at org.openstreetmap.josm.io.OsmApi.sleepAndListen(OsmApi.java:445)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:525)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:464)
	at org.openstreetmap.josm.io.OsmApi.openChangeset(OsmApi.java:318)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:157)
	at org.openstreetmap.josm.actions.UploadAction$UploadPrimitivesTask.realRun(UploadAction.java:630)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:63)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:105)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
org.openstreetmap.josm.io.OsmTransferCancelledException
	at org.openstreetmap.josm.io.OsmApi.sleepAndListen(OsmApi.java:445)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:525)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:464)
	at org.openstreetmap.josm.io.OsmApi.openChangeset(OsmApi.java:318)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:157)
	at org.openstreetmap.josm.actions.UploadAction$UploadPrimitivesTask.realRun(UploadAction.java:630)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:63)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:105)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
tcpflow[18860]: listening on wlan0
192.168.002.101.50403-128.040.168.098.00080: PUT /api/0.6/changeset/create HTTP/1.1
Authorization: Basic SEEKRT
Content-type: text/xml
User-Agent: JOSM/1.5 (2556 SVN is) Java/1.6.0_16
Host: api.openstreetmap.org
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 295


192.168.002.101.50403-128.040.168.098.00080: <?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <changeset  id='0' open='false'>
    <tag k='created_by' v='JOSM/1.5 (2556 SVN is)' />
    <tag k='source' v='nearmap' />
    <tag k='comment' v='Tracing Rottnest Island from nearmap imagery' />
  </changeset>
</osm>

128.040.168.098.00080-192.168.002.101.50403: HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="Web Password"
X-Runtime: 6
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Content-Length: 25
Date: Tue, 01 Dec 2009 16:01:19 GMT
Server: lighttpd/1.4.22

Couldn't authenticate you
192.168.002.101.50404-128.040.168.098.00080: PUT /api/0.6/changeset/create HTTP/1.1
Authorization: Basic SEEKRT
Content-type: text/xml
User-Agent: JOSM/1.5 (2556 SVN is) Java/1.6.0_16
Host: api.openstreetmap.org
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 295

192.168.002.101.50404-128.040.168.098.00080: <?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <changeset  id='0' open='false'>
    <tag k='created_by' v='JOSM/1.5 (2556 SVN is)' />
    <tag k='source' v='nearmap' />
    <tag k='comment' v='Tracing Rottnest Island from nearmap imagery' />
  </changeset>
</osm>

128.040.168.098.00080-192.168.002.101.50404: HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Content-Length: 835
Date: Tue, 01 Dec 2009 16:01:19 GMT
Server: lighttpd/1.4.22

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
  <img src="http://www.openstreetmap.org/images/osm_logo.png" style="float:left; margin:10px">
  <div style="float:left;">
    <h1>Application error</h1>
    <p>The OpenStreetMap server encountered an unexpected condition that prevented it from fulfilling the request (HTTP 500)</p>
    <p>Feel free to <a href="http://wiki.openstreetmap.org/wiki/Contact" title="Various contact channels explained">contact</a> the OpenStreetMap community if your problem persists. Make a note of the exact URL / post data of your request.</p>
    <p>This may be a problem in our Ruby On Rails code. 500 occurs with exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code)</p>
  </div>
</body>
</html>

Attachments (0)

Change History (1)

comment:1 by xeen, 13 years ago

Resolution: worksforme
Status: newclosed

As far as I can tell JOSM now reacts to the 401 hints and pops up the "please enter auth data" plugin. Please reopen if you can still reproduce.

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.