Closed tguen closed 7 months ago
same for me... tested with Chrome, Opera and Firefox
do you even have that option after force-refresh (i.e. clearing the browser cache and/or ctrl-f5
/ctrl-shift-r
) ?
That feature seems to be missing completely for me, see https://github.com/tyrasd/overpass-turbo/issues/665
After making sure to use https://
so that load/save on OSM
option is visible, I can confirm that saving to OSM does not work anymore. I've tried force-refreshing, logging out and back in, with no change.
Saving does not save anything (this issue) and it also does not show any error or close the form (as reported in https://github.com/tyrasd/overpass-turbo/issues/534).
Looking in console, it fails with 400 bad request
error when trying to PUT
on https://www.openstreetmap.org/api/0.6/user/preferences
:
XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "https://www.openstreetmap.org/api/0.6/user/preferences", status: 400, statusText: "Bad Request", responseType: "", response: "", responseText: "" }
index-fd1ab5c5.js:757:3528
Same for me. The last time I saved a query on the server, it worked; that was in May 2023. Then I haven't tried it again until now.
This bug is now fixed with 34fac47f29e7fac896c03be96b4c67b7dd9204a1.
According to Help
on https://overpass-turbo.eu/ (which says it is overpass-turbo 2023-12-16/ 6215541), that fix should be live now? However, I'm still unable (even after CTRL-F5 force refreshing, and logout/login) to save queries on osm.org, getting:
400 Bad request
on that PUT https://www.openstreetmap.org/api/0.6/user/preferences
:
XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "https://www.openstreetmap.org/api/0.6/user/preferences", status: 400, statusText: "Bad Request", responseType: "", response: "", responseText: "" }
index-544492d9.js:757:3528
I have just tested it and it worked for me.
I have now tried it on another account (where I had no previous saved OSM queries) and save on osm.org
works there.
I tried in same browser multiple times - one account works just fine, other fails to save any query on OSM. Even on failing account, the queries all seem to load just fine from OSM. The issue is just trying to save them
It thus seems likely that the issue might be related to previously stored queries. On problematic account, there are 16 Overpass-turbo queries saved, with total plaintext size of about 9.1kB. Is it perhaps hitting some limit?
@tyrasd do you need me to provide additional data to help track this down (and how would I gather it)?
Is it perhaps hitting some limit?
@tyrasd do you need me to provide additional data to help track this down (and how would I gather it)?
Hmm… Possibly. Although I could not trigger the documented limit of 150 preferences per user in a quick test where I was able to upload 200+ preferences in a single PUT request (~51kB of plain text xml). But even if the limit of 150 preferences were to hold, it should be plenty to store 16 queries (except maybe if the queries are particularly long).
Do you see any error messages in either the javascript console or the network tab of the browser's development tool?
Do you see any error messages in either the javascript console or the network tab of the browser's development tool?
No other errors that I can see.
Some interesting bits:
PUT
s the whole of the preferences (and not just the newly created query that is being chosen to save) and FAILS.PUT
just the changed key (like e.g. https://mapcomplete.org/ preferences), also WORK just finePOST
method instead. [...some time later, after messing with Copy as cURL
and manually editing query...]
It seems that my OSM preferences of my problematic account contain some preferences from very old tools, with things like:
<preference k="MerkaartorTmsServer003" v="OSM Mapnik;tile.openstreetmap.org;/%1/%2/%3.png;256;0;17"/>
While the whole thing seems like perfectly valid XML, by method of elimination I've found that OSM API aborts uploading the preferences which contain %
character (IOW, when I remove all lines with %
, I can manually PUT the preferences with curl(1)
, and when I leave even one of those lines, it fails to upload with 400
again).
So, because I was able to save new overpass-turbo queries at earlier point in time, it seems to me that either:
PUT
ting those old preferences, while it didn't do it before (e.g. perhaps it also did save only the changed preference instead of all of them; or it used to PUT
only keys starting with overpass
etc.), orI should report that issue for API v0.6, so it can be either fix or at least documented.
So the issue is that overpass turbo sends the PUT https://www.openstreetmap.org/api/0.6/user/preferences with Content-Type application/x-www-form-urlencoded, although it should be application/xml.
I found this bit in https://github.com/tyrasd/overpass-turbo/blob/master/js/sync-with-osm.ts#L161 saying the the Content-Type should be text/xml, though somehow that's not what's used when sending out the request to osm.org server.
Aah, yes, you're right. Thanks for the pointer @mmd-osm. This should be fixed with 8db5c43. PS: this used to work correctly before I upgraded to osm-auth v2 (see 638643b, for OAuth2 support), but I had overlooked that there was a sneaky breaking API change for how to specify request headers.
Thanks @mmd-osm and @tyrasd; I can confirm that I can now save queries on osm.org using my main OSM account again!
When I save a query, I enter a name in the dialog and click "save on osm.org". Then I open the load menu and it's not in the "Saved Queries (osm.org)" list, even after reloading the page. Clicking the (x) button on a query in the list gives me a confirmation dialog, and when I click delete, the query remains. No error messages are shown on the page or in the console.