Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

HTTP 500 error with Potlach editor #4793

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 7 comments
Closed

HTTP 500 error with Potlach editor #4793

openstreetmap-trac opened this issue Jul 23, 2021 · 7 comments

Comments

@openstreetmap-trac
Copy link

Reporter: metkos[at]gmail.com
[Submitted to the original trac issue database at 11.02pm, Friday, 22nd February 2013]

Using any component in OSM site is fine, but starting Potlach2 editor produce an HTTP 500 error:

Application error

The OpenStreetMap server encountered an unexpected condition that prevented it from fulfilling the request (HTTP 500)

Feel free to contact the OpenStreetMap community if your problem persists. Make a note of the exact URL / post data of your request.

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)

I already found a cause. If I change "Preferred Languages" in OSM account settings and exclude serbian language ('sr') - P2 starts normally.

I tried croatian (hr) and russian (ru) on first place in that field, they do not
make problems. So to conclude, it is somehow connected to translations, serbian possibly.

People on IRC said that it is not connected to Potlach2, rather website itself.

Technical background:

auth = login or OpenID does not make a change;

browsers: tested with Firefox 19.x and Google Chrome;

OS: OpenSuse 12.2 x64

Cheers!

M.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 10.51pm, Sunday, 24th February 2013]

I've been unable to reproduce this so far, regardless of what I set my language settings to...

@openstreetmap-trac
Copy link
Author

Author: emj
[Added to the original trac issue at 1.56am, Monday, 25th February 2013]

I can reproduce with language set to "sr", but only in potlatch2, with editor set to "potlatch1" it works nicely. On Linux, chrome 25 and FF.

When was this working for you last time?

Unrelated, this also throws application error:
http://www.openstreetmap.org/edit?editor=RANDOMJUNK

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 9.47am, Monday, 25th February 2013]

I've managed to find one of emj's attempts in the log - the error is:

ActionView::Template::Error (potlatch2/locales/.swf isn't precompiled):
    31:     flashvars.assets = "<%= asset_path "potlatch2/assets.zip" %>";
    32:     flashvars.font_library = "<%= asset_path "potlatch2/FontLibrary.swf" %>";
    33:     flashvars.locale = "<%= Potlatch2::LOCALES[locale] %>";
    34:     flashvars.locale_paths = "<%= Potlatch2::LOCALES[locale] %>=<%= asset_path("potlatch2/locales/#{Potlatch2::LOCALES[locale]}.swf") %>";
    35:     <% if params['gpx'] %>
    36:     flashvars.gpx = '<%= h(params['gpx']) %>';
    37:     <% end %>
  app/views/site/_potlatch2.html.erb:34:in `_app_views_site__potlatch__html_erb__595222280942956594_53566660'
  app/views/site/edit.html.erb:20:in `_app_views_site_edit_html_erb___2741719446329565646_49458780'
  config/initializers/memory_limits.rb:17:in `call'

which suggests that something went wrong in the locale selection.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 9.58am, Monday, 25th February 2013]

Specifically it means that this line:

<% locale = request.compatible_language_from(Potlatch2::LOCALES.keys) || "en" %>

must have failed to set locale to anything, despite the "en" fallback.

One thing I do notice is that "sr" is a bit special as we don't have a mapping for it in the Potlatch list, because I wasn't sure which of "sr-EC" and "sr-EL" should be the default. To be honest neither of those codes seems valid anyway - the first would be "Serbian as spoke in Ecuador" and the second is nothing at all because there is no country with "EL" as it's code.

It seems that what Potlatch 2 has as sr-ec is actually the cyrillic variant and sr-el is the latin variant... I will try updating our mappings to match that.

@openstreetmap-trac
Copy link
Author

Author: emj
[Added to the original trac issue at 10.36am, Monday, 25th February 2013]

Both of them work if you set your preference to that value, sr_el is the latin version, sr_ec is the crylic version. I have some samples from the SWF files, if someone who speaks serbian wants to chip in:

<String2 value="help.tag"/>
el:    <String2 value="Oznaavanje"/>
ec:    <String2 value=""/>

<String2 value="save.editDescription"/>
el:      <String2 value="Unesite opis vaih izmena. Tako e drugi kartografi imati predstavu kakve ste izmene napravili."/>
ec:      <String2 value="   .          ."/>


http://cldr.unicode.org/translation/default-content

States that it should be: Serbian (Cyrillic) [sr_Cyrl] or Serbian (Latin) [sr_Latn], with sr defaulting to Crylic.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 10.39am, Monday, 25th February 2013]

Yes I know what the codes should be, and the web site are ones are correct as "sr" and "sr-Latn". We don't bother with the "-Cyrl" because that is the default script.

Potlatch 2 has it's own weird ideas though, possibly inherited from Flash, which is why we have a mapping table in lib/potlatch2.rb to fix things up. That is what I have just corrected.

I still don't understand why you weren't just getting english though, which is what I was getting.

Anyway, my fix should be live now if people want to test it...

@openstreetmap-trac
Copy link
Author

Author: metkos[at]gmail.com
[Added to the original trac issue at 2.02pm, Monday, 25th February 2013]

Replying to [comment:6 TomH]:

I still don't understand why you weren't just getting english though, which is what I was getting.

Anyway, my fix should be live now if people want to test it...

I did a test, your fix is fine. Potlach2 is now starting correctly with "sr,en-US,en" in preffered language settings.

Editor's interface is mix of Serbian and English, but that's probably expected because of incomplete translation.

Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant