AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
846 stars 315 forks source link

When I enter demo page #612

Closed inclooder closed 10 years ago

inclooder commented 10 years ago

http://demo.alchemy-cms.com/admin/dashboard

An error happened
I18n::InvalidLocale "pl" is not a valid locale
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n.rb:288:in `enforce_available_locales!'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n/config.rb:11:in `locale='
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_view/lookup_context.rb:226:in `locale='
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/abstract_controller/rendering.rb:28:in `locale='
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n.rb:35:in `locale='
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/bundler/gems/alchemy_cms-18c8d7aaefa0/lib/alchemy/locale.rb:25:in `set_translation'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:467:in `_run__2984642054052582962__process_action__callbacks'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/callbacks.rb:80:in `run_callbacks'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/abstract_controller/callbacks.rb:17:in `process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `block in instrument'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `instrument'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/abstract_controller/base.rb:136:in `process'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/abstract_controller/rendering.rb:44:in `process'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal.rb:195:in `dispatch'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_controller/metal.rb:231:in `block in action'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:80:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:48:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/mapper.rb:44:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `each'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:674:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/railties-4.0.5/lib/rails/engine.rb:511:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/railties-4.0.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `each'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/journey/router.rb:59:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/routing/route_set.rb:674:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/flash.rb:241:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/cookies.rb:486:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/bundler/gems/alchemy_cms-18c8d7aaefa0/lib/alchemy/middleware/rescue_old_cookies.rb:10:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.5/lib/active_record/query_cache.rb:36:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
/var/www/alchemy-edge-demo/shared/bundle/ruby/2.1.0/gems/actionpack-4.0.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
v-fedorov commented 10 years ago

Had this happen with 'es' before,

I18n.config.enforce_available_locales = false

in application.rb resolved it

inclooder commented 10 years ago

This should be fixed at http://demo.alchemy-cms.com/admin/dashboard

tvdeyen commented 10 years ago

How can we reproduce this? If I switch locales in the demo I don't get any errors? Does this happen because of the Accepted-Language headers from your browsers?

inclooder commented 10 years ago

Here is my Accepted-Language

Accept-Language:pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
tvdeyen commented 10 years ago

Ok, guessed so. I will fix this.

Thanks for reporting.

robinboening commented 10 years ago

I reproduced it by clearing cookies for the demo page, setting the browsers language to something not available and trying to login to the demo application.

tvdeyen commented 10 years ago

Should be resolved now.

inclooder commented 10 years ago

Looks good :)

duarme commented 10 years ago

This happened again today with alchemy-cms 3.0.0 and rails 4.1.5 with the "it" locale but, here comes the weird part: only on one of ours machines. In order to resolve we had to put I18n.config.enforce_available_locales = false in application.rb and now it seems ok on both of ours machines.