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.
Related
Trying to follow the setup here to create a simple SAML application (full project I got here).
I went through and did the setup
bundle install
rails s
This went fine, but when I navigate to
http://localhost:3000/
I get hit with
NoMethodError in SamlController#init
undefined method `+' for nil:NilClass
Extracted source (around line #9):
def init
request = OneLogin::RubySaml::Authrequest.new
direct_to(request.create(saml_settings))
end
def consume
I added some logging to check nil status of request and saml_settings but that seems to return false for both of them
puts request.nil?
puts saml_settings.nil?
Error trace:
Processing by SamlController#init as HTML
false
false
Created AuthnRequest: <samlp:AuthnRequest AssertionConsumerServiceURL='http://localhost:3000/saml/consume' ID='_394fa0a0-f313-0135-85a4-6a0001e18280' IssueInstant='2018-02-13T17:42:45Z' Version='2.0' xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion' xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol'><saml:Issuer>http://localhost:3000/saml/consume</saml:Issuer></samlp:AuthnRequest>
Completed 500 Internal Server Error in 15ms (ActiveRecord: 0.0ms)
NoMethodError (undefined method `+' for nil:NilClass):
app/controllers/saml_controller.rb:9:in `init'
(Note: the error is line 5, it says line 9 for me because of debug logging I added)
I'm not too sure what else it could be, not sure what method it can't find and what is nil?
I have never messed with ruby stuff, but from my initial looks I'm not sure where the nil is coming from, the logs show the request being created so not sure. Any help would be appreciated, thanks!
Firstly I think you're using a pretty old ruby-saml gem version. That might be the problem.
I haven't tested your code, but it seems to me that you forgot to set idp_sso_target_url in your settings, and apparently that's the only place it can throw the exception you got. https://github.com/onelogin/ruby-saml/blob/v1.1.2/lib/onelogin/ruby-saml/authrequest.rb#L39
Posting the answer here, turns out that i was using a metadata url for the OKTA_METADATA environment variable.
Had to modify
settings = idp_metadata_parser.parse(ENV['OKTA_METADATA'])
to
settings = idp_metadata_parser.parse_remote(ENV['OKTA_METADATA'])
where
OKTA_METADATA=http://blahblahblah.com/metadata
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'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 :)!
For some reason I keep getting a response code of 500 when I run cucumber, even though all the tests pass. The error occurs randomly for different tests, every time I run it. Sometimes all tests pass as well.
I thought it was a memory issue, so I tried restarting my computer, but that didn't do anything.
An example of the error is:
And I follow "link" # features/step_definitions/web_steps.rb:33
Failed. Response code = 500. Response message = Internal Server Error. (ActiveResource::ServerError)
./app/controllers/companies_controller.rb:23:in `show'
./features/step_definitions/web_steps.rb:35
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:34:in `/^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/'
features/manage_sites.feature:256:in `And I follow "link"'
It seems related to the tagging feature. I was using the #wip tag, and when I moved it around, it would cause the sporadic 500 errors. Removing all #wip tags makes all the tests pass.
I could be wrong though. I'll need to try and replicate it consistently.
Would anybody be able to help?