I'm currently trying to deploy an Ruby on Rails 3.0.9 app on a production server. Everything seems to be going fine untill passenger gives an 'We're sorry, but something went wrong.' error upon requesting the website.
The production log shows this error:
Rendered sessions/new.html.haml within layouts/application (5.7ms)
Completed 500 Internal Server Error in 8ms
ActionView::Template::Error (syntax error on line 7, col 7: `'):
2: %h2 Sign in
3: = form_for( :sessions, :url => sessions_path) do |f|
4: .field
5: = f.label :email
6: %br/
7: = f.text_field :email
8: .field
app/views/sessions/new.html.haml:5:in
_app_views_sessions_new_html_haml__1068828667_250539460_0'
app/views/sessions/new.html.haml:3:in
_app_views_sessions_new_html_haml__1068828667_250539460_0'
*Edit: Removing the f.label :email and f.label :password rows makes this error disappear, but this obviously isn't a fix *
Some information about this error:
I develop with aptana on windows
A co-developer who works with this project on a mac, was subject to this error a while ago, but fixed this with some unknown magic with gemsets and rvm.
Bundle list of the production server: http://pastie.org/private/0itpfmbfwqvhpheptqz4ha
Github repository: http://github.com/boersmamarcel/Into-Reality-Portal
I'm deploying with capistrano 2.0 and the bundle recipe for it
A similar error also happens on other views, but somehow this error also points to line 7 of the file, and the error message sometimes shows random strings after
col 7:
I can't manage the global gemset on the production server
Weird fact: If I remove the = f.label :password and = f.label :email rows, the error is gone :s
I would be very grateful if someone could help me with this. We have been working on this error for the whole day and it's driving me nuts.
Thanks
- Bas
Edit: the f.label function seems to be causing the problem. I uploaded a trimmed down version of the view which generated the following error:
http://pastie.org/private/cqqipdvqod3r50x9ciwytq
This application runs succesfully on other mac-based and windows-based computers.
If you copied the above exactly, what is the %br doing with a trailing slash? If you're rending this in HTML (not XHTML) the trailing slash is no longer valid. I don't know if it matters but sometimes the slash character throws off HAML in strange ways for me.
After puzzling with this error for hours and hours, it turned out the I18n gem caused this problem.
I had a unclosed entity in my en.yml which looked like this:
en:
time:
formats:
hourminute: "%H:%M"
date:
Removing the date: part fixed this -in my opinion- very obscure error
Thanks to all the people who used their braincycles on this problem :)!
Related
On the redmine of my company, there is this bug where I get an internal error if I want to search into a project.
Here is the log corresponding to the error:
Processing by SearchController#index as HTML
Parameters: {"utf8"=>"✓", "issues"=>"1", "q"=>"test", "id"=>"sprint"}
Current user: me (id=60)
Completed 500 Internal Server Error in 85.0ms
TypeError (no implicit conversion of nil into String):
lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:126:in `search'
app/controllers/search_controller.rb:74:in `block in index'
app/controllers/search_controller.rb:73:in `each'
app/controllers/search_controller.rb:73:in `index'
The lines corresponding to the error in the controller are :
if !#tokens.empty?
# no more than 5 tokens to search for
#tokens.slice! 5..-1 if #tokens.size > 5
#results = []
#results_by_type = Hash.new {|h,k| h[k] = 0}
limit = 10
#scope.each do |s|
r, c = s.singularize.camelcase.constantize.search(#tokens, projects_to_search,
:all_words => #all_words,
:titles_only => #titles_only,
:limit => (limit+1),
:offset => offset,
:before => params[:previous].nil?)
#results += r
Here is my config :
Environment:
Redmine version 2.6.9.stable
Ruby version 2.3.0-p0 (2015-12-25) [x86_64-linux]
Rails version 3.2.22
Environment production
Database adapter PostgreSQL
SCM:
Git 1.9.1
Filesystem
Redmine plugins:
no plugin installed
What is interesting is that when I search only one letter, i'm redirected on the search page, but I don't have an internal error.
I'm very new to Redmine developpement and to Ruby, I was just assigned to try to fix this bug. Do any of you have an idea of how to fix it ?
Thanks.
I had the same issue, I was able to fix it by downgrading my ruby & rails version, a working set is :
Rails 3.2.19
Ruby 2.1.4p265
It's look like it's due to a braking change in ruby-2.3.0.
It's really odd. We are using 'Redmine' -2.0.3.1 and we do not have that kind of behaviour.
It seems that "someone" messed up the form linked to the search input. Try to follow that data from when you press enter until it answer you with the 500 error code.
If you can , change the environment to development, this way it will show you more detailed errors.
But I can't help you much more , you didn't provide enough info about the problem.
I have installed the "issue-id" plugin to Bitnami Redmine 3.1.1 running on Windows Server 2012R2.
Issue Ids have successfully changed for the new ones like "Project-1" on the issue list. (/projects/{Project Name}/issues)
However link URLs to issue details have been broken so I cannot view details for each issue. (I just get the "Internal error" screen as shown on the attached image.)
"production" log file says as follows:
Started GET "/issues/Project-1" for 127.0.0.1 at 2016-01-20 11:00:07
Processing by IssuesController#show as HTML Parameters:
{"id"=>"Project-1"} Current user: jungal (id=1) Rendered
issues/_action_menu.html.erb (34.0ms) Rendered
plugins/redmine_contacts/app/views/deals_issues/_show.html.erb (2.0ms)
Rendered
plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data.html.erb
(0.0ms) Rendered
plugins/redmine_products/app/views/products_issues/_products.html.erb
(32.0ms) Rendered issues/show.html.erb within layouts/base
(1043.0ms) Completed 500 Internal Server Error in 1632ms
(ActiveRecord: 319.5ms)
ActionView::Template::Error (No route matches {:action=>"new",
:controller=>"journals", :id=>#} missing
required keys: [:id])
77: <% if #issue.description? %>
78: <div class="description">
79: <div class="contextual">
80: <%= link_to l(:button_quote), quoted_issue_path(#issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
81: </div>
82:
83: <p><strong><%=l(:field_description)%></strong></p> app/views/issues/show.html.erb:80:in
_app_views_issues_show_html_erb___574665212_71239980'
app/controllers/issues_controller.rb:118:inblock (2 levels) in show'
app/controllers/issues_controller.rb:115:in show'
lib/redmine/sudo_mode.rb:63:insudo_mode'
I have checked the actual issue id which is number and tried to set the URL like /issues/{number} but it was no use.
Does anybody know how to fix this?
That version of ISSUE-id plugin did not support Redmine 3.x. This was noted on the plugin's page of the official Redmine website and on the official plugin's webpage. Installing such plugin versions on an unsupported Redmine version, unfortunately, means breaking the work of Redmine, like in this case (that's not the only issue you would experience under Redmine 3.x with that version of the plugin).
If the plugin does not support the version of Redmine, that you are using, the only solution is to attempt to find a fork of the plugin, that does support such version (or to ask author to prioritize adding such support). ISSUE-id had such forks. Alternatively, you could check the development version in SVN, which, in theory, could include fixes for such issues already (not released yet). In any way, it's always a good idea to report such issues on the official plugin's page (thus, you could get support from the plugin's community).
P.S. At the moment, the official plugin already supports Redmine 3.x, so this issue is fixed there.
I did update my application to Rails 4.1.10 and it works fine on my staging environment.
Now as soon as I deploy my App to production I get the following fatal error in one of my views:
F, [2015-03-26T18:12:21.159599 #4741] FATAL -- :
ActionView::Template::Error (795: unexpected token at [[iI""$2a$10$2BUwvWEvQzm404VPpY71BO:ET'):
5: .row
6: .col-xs-8
7: h1 = search_highlight(#programme.title, params)
8: - if current_admin_user
9: i.fa.fa-edit
10: '
11: = link_to t('edit'), (admin_programme_path(#programme) + '/edit'), target: '_blank'
app/views/programmes/show.html.slim:8:in `_app_views_programmes_show_html_slim__2487450803659794271_70344829653360'
The hint I get is very misleading and I can't seem to figure out what is wrong here.
795: unexpected token at [[iI""$2a$10$2BUwvWEvQzm404VPpY71BO:ET'
It turned out that the issue was not directly related to slim at all. When I access current_admin_user then the cookies from the client were parsed and since I did upgrade my Rails app from 4.0 to 4.1 the cookies were stored in the old format and the default for Rails 4.1 is :json.
So changing the following setting from :json to :hybrid in cookies_serializer.rb did the trick
Rails.application.config.action_dispatch.cookies_serializer = :hybrid
I just moved my working Heroku app from Bamboo to Cedar, and now it crashes with:
Rendered devise/sessions/new.html.erb within layouts/application (4.6ms)
ActionView::Template::Error (no implicit conversion of nil into String):
8: <%= t("website_title") %>
As you can see, t("website_title") seems to be nil, despite the fact that website_title is still in config/locales/en.yml as usual:
en:
website_title: Cats (All about cats)
Is it a known issue when moving from Bamboo to Cedar?
Any idea how to solve it?
Actually, heroku logs was showing log lines in non-chronological order, which lead me to think the problem was line 8, but in fact it was this problem:
https://github.com/rails/rails/issues/9619
Which I solved as explained by dvdplm there.
[update2] One of those problems I solved & can't remember how... :)
[update1] could this be a problem in the model?
PAYPAL_CERT_PEM = File.read("#{Rails.root}/certs/paypal_cert.pem")
APP_CERT_PEM = File.read("#{Rails.root}/certs/app_cert.pem")
APP_KEY_PEM = File.read("#{Rails.root}/certs/app_key.pem")
The page I'm trying to access on my site is the cart page for paypal purchases. Notwithstanding the trouble of getting to this error in the production log amidst an apparent DoS attack, I have no experience working with the exception notifier. What's being called (by my code) is an encryption method in the model for each 'buy now' button. Please help me diagnose the problem.
Rendering .../public/500.html (500 Error)
rendering section "request"
/!\ FAILSAFE /!\ Fri Jan 16 14:59:54 +0000 2009
Status: 500 Internal Server Error
ActionView::TemplateError (protected method `filter_parameters' called for #<PurchaseController:0x7f053d26e280>) on line #3 of vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml:
1: * URL : <%= #request.protocol %><%= #host %><%= #request.request_uri %>
2: * IP address: <%= #request.env["HTTP_X_FORWARDED_FOR"] || #request.env["REMOTE_ADDR"] %>
3: * Parameters: <%= filter_sensitive_post_data_parameters(#request.parameters).inspect %>
4: * Rails root: <%= #rails_root %>
If you are using a "later" version of rails, you probably need to make this change: http://www.floydprice.com/2008/08/exception-notifier-in-rails-21/
The ActionView::TemplateError you've posted is caused by a failure of Exception Notifier in rendering a 500 error page (line #3 of Exception Notifier's own _request.html partial). The more interesting exception is probably the one that came before and caused the 500 in the first place.
Not an answer to your question, but something that will help.
I've recently come to love the Hoptoad gem and site for grouping and reporting exceptions with my app in production. Extremely easy to install and no more trawling through my production logs.
I say switch to this from excpetion notification and see if it helps.