Using Google Cloud Talent Solution (aka Google Cloud Job Discovery), I am getting the following stack trace even though all Google API credentials are in place and enabled. Error message seems to be generic ("Permission denied")and not sure what could be wrong. Any insight is much appreciated.
====================================================================
Error message
Google::Cloud::PermissionDeniedError: 7:User not authorized to perform this action.
Sample stack trace (hide Rails)
…cloud-pubsub-0.31.0/lib/google/cloud/pubsub/
service.rb: 459:in rescue in execute'
…cloud-pubsub-0.31.0/lib/google/cloud/pubsub/
service.rb: 455:inexecute'
…cloud-pubsub-0.31.0/lib/google/cloud/pubsub/
service.rb: 150:in publish'
…e-cloud-pubsub-0.31.0/lib/google/cloud/pubsub/
topic.rb: 573:inpublish_batch_messages'
…e-cloud-pubsub-0.31.0/lib/google/cloud/pubsub/
topic.rb: 314:in publish'
…emetry_job_google/lib/google_jobs/
google_jobs_event.rb: 22:inpublish_event'
…metry_careersites/app/mixins/
job_search_event_mixin.rb: 88:in record_google_search_impressions'
…metry_careersites/app/mixins/
job_search_event_mixin.rb: 17:inevent_job_search_impressions'
…ersites/app/controllers/public_site/
jobs_controller.rb: 59:in block (2 levels) in search'
…k-5.2.1.1/lib/action_controller/metal/
mime_responds.rb: 203:inrespond_to'
…ersites/app/controllers/public_site/
jobs_controller.rb: 53:in search'
…1/lib/action_controller/metal/
basic_implicit_render.rb: 6:insend_action'
…ems/actionpack-5.2.1.1/lib/abstract_controller/
base.rb: 194:in process_action'
…npack-5.2.1.1/lib/action_controller/metal/
rendering.rb: 30:inprocess_action'
…ctionpack-5.2.1.1/lib/abstract_controller/
callbacks.rb: 42:in block in process_action'
…/activesupport-5.2.1.1/lib/active_support/
callbacks.rb: 109:inblock in run_callbacks'
…try_careersites/app/controllers/
eventing_controller.rb: 23:in block in append_tracking_info_to_rails_log'
…vesupport-5.2.1.1/lib/active_support/
tagged_logging.rb: 71:inblock in tagged'
…vesupport-5.2.1.1/lib/active_support/
tagged_logging.rb: 28:in tagged'
…vesupport-5.2.1.1/lib/active_support/
tagged_logging.rb: 71:intagged'
…try_careersites/app/controllers/
eventing_controller.rb: 22:in append_tracking_info_to_rails_log'
…/activesupport-5.2.1.1/lib/active_support/
callbacks.rb: 118:inblock in run_callbacks'
…/activesupport-5.2.1.1/lib/active_support/
callbacks.rb: 136:in run_callbacks'
…ctionpack-5.2.1.1/lib/abstract_controller/
callbacks.rb: 41:inprocess_action'
…tionpack-5.2.1.1/lib/action_controller/metal/
rescue.rb: 22:in process_action'
<truncated 60 additional frames>
…2.5.0/gems/rack-timeout-0.5.1/lib/rack/timeout/
core.rb: 123:inblock in call'
…rack-timeout-0.5.1/lib/rack/timeout/support/
timeout.rb: 19:in timeout'
…2.5.0/gems/rack-timeout-0.5.1/lib/rack/timeout/
core.rb: 122:incall'
…k-5.2.1.1/lib/action_dispatch/middleware/
request_id.rb: 27:in call'
…ruby/2.5.0/gems/rack-2.0.6/lib/rack/
method_override.rb: 22:incall'
…/vendor/ruby/2.5.0/gems/rack-2.0.6/lib/rack/
runtime.rb: 22:in call'
…ctive_support/cache/strategy/
local_cache_middleware.rb: 29:incall'
…ack-5.2.1.1/lib/action_dispatch/middleware/
executor.rb: 14:in call'
…npack-5.2.1.1/lib/action_dispatch/middleware/
static.rb: 127:incall'
…vendor/ruby/2.5.0/gems/rack-2.0.6/lib/rack/
sendfile.rb: 111:in call'
…r/ruby/2.5.0/gems/railties-5.2.1.1/lib/rails/
engine.rb: 524:incall'
…/ruby/2.5.0/gems/puma-3.12.0/lib/puma/
configuration.rb: 225:in call'
…/vendor/ruby/2.5.0/gems/puma-3.12.0/lib/puma/
server.rb: 658:inhandle_request'
…/vendor/ruby/2.5.0/gems/puma-3.12.0/lib/puma/
server.rb: 472:in process_client'
…/vendor/ruby/2.5.0/gems/puma-3.12.0/lib/puma/
server.rb: 332:inblock in run'
…or/ruby/2.5.0/gems/puma-3.12.0/lib/puma/
thread_pool.rb: 133:in `block in spawn_thread
You will need to explicitly connect the service account to the Talent Solution api and then use that service account key for the auth. See here for details.
Related
I have an Expenditure model:
class Expenditure < ApplicationRecord
multi_tenant :company
after_commit :related_reindex
def related_reindex
ExpenditureRelatedReindex.perform_async(id)
end
end
Here is my worker expenditure_related_reindex.rb:
class ExpenditureRelatedReindex
include Sidekiq::Worker
sidekiq_options :queue => :critical, :retry => true, :backtrace => true
def perform(record_id)
e = Expenditure.find(record_id)
MultiTenant.with(e.company) do
return unless e
e.expenditure_items.each(&:reindex)
e.children&.each(&:reindex)
end
end
end
The reindex can take some time so I want these to spin off to SideKiq. I have sime multi tenant code I should mention but I don't think it's the issue. After the record is updated I get:
NameError: uninitialized constant ExpenditureRelatedReindex
Did you mean? ExpenditureItemsHelper
from sidekiq/processor.rb:268:in `const_get'
from sidekiq/processor.rb:268:in `constantize'
from sidekiq/processor.rb:132:in `block (5 levels) in dispatch'
from sidekiq/rails.rb:43:in `block in call'
from active_support/execution_wrapper.rb:87:in `wrap'
from active_support/reloader.rb:73:in `block in wrap'
from active_support/execution_wrapper.rb:87:in `wrap'
from active_support/reloader.rb:72:in `wrap'
from sidekiq/rails.rb:42:in `call'
from sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
from sidekiq/processor.rb:257:in `stats'
from sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
from sidekiq/job_logger.rb:13:in `call'
from sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
from sidekiq/job_retry.rb:78:in `global'
from sidekiq/processor.rb:124:in `block in dispatch'
from sidekiq/logger.rb:10:in `with'
from sidekiq/job_logger.rb:33:in `prepare'
from sidekiq/processor.rb:123:in `dispatch'
from sidekiq/processor.rb:162:in `process'
from sidekiq/processor.rb:78:in `process_one'
from sidekiq/processor.rb:68:in `run'
from sidekiq/util.rb:15:in `watchdog'
from sidekiq/util.rb:24:in `block in safe_thread'
I have even taken out the entire 'perform' block of code i.e. the worker does nothing to confirm I don't have some sort of regressive call etc. I confirm that my other workers fire and process just fine. Checked for obvious typos - banging my head against the wall at this point.
UPDATE
Ok - I have confirmed one thing - if I add any new workers with any name this triggers the same error. I even rebooted the entire production server to confirm the whole code was reloaded etc.
It ended up being Redis (or at least my fix was related). Found this post:
https://github.com/mperham/sidekiq/issues/2834#issuecomment-184800981
and it was a Redis namespace conflict. My server does have elasticsearch running also so that makes sense. I am not sure why the old workers run but the new ones failed. My fix looks like this:
config.redis = {
url: ENV['REDIS_URL'],
namespace: "some_namespace_different_for_each_app"
}
You also need the redis-namespace gem BTW
I'm using Flexirest to make a request to an endpoint that returns an array of strings with Content-Type: application\json.
This is the model:
class Neighborhood < BaseModel
get :by_location, "/neighborhoods/by_location"
end
And this is how I make the request:
def get_neighborhood_list
city_to_use = ApplicationHelper.user_location[:city] || Rails.configuration.default_location[:city]
#hoods = Neighborhood.by_location(city: city_to_use)
end
And this is called but it only reaches the super line since it breaks inside there:
def handle_response(response, cached = nil)
result = super(response, cached)
setup_paging_variables result, response
setup_paging_variables result.data, response if result.respond_to? 'data'
result
end
The endpoint returns an array of strings:
[
"Ahwatukee Foothills Village",
"Alhambra",
"Camelback East Village",
"Central City",
]
With this headers
My problem is that Flexirest is treating the strings as json objects instead due to the value on the Content-Type header.
I get this error
TypeError: no implicit conversion of Symbol into Integer
on this line on the if attributes[:_links].
It's getting there because hal_response? is true
Do I need to do something in particular in order for Flexirest to stop behaving like this?
Update
I guess I didn't explained it properly. The error is occurring on the gem side.
Here is the full error:
TypeError - no implicit conversion of Symbol into Integer:
flexirest (1.5.5) lib/flexirest/request.rb:612:in `handle_hal_links_embedded'
flexirest (1.5.5) lib/flexirest/request.rb:553:in `new_object'
flexirest (1.5.5) lib/flexirest/request.rb:704:in `block in generate_new_object'
flexirest (1.5.5) lib/flexirest/request.rb:703:in `generate_new_object'
flexirest (1.5.5) lib/flexirest/request.rb:501:in `handle_response'
config/initializers/01_flexirest.rb:7:in `handle_response'
flexirest (1.5.5) lib/flexirest/request.rb:219:in `block (2 levels) in call'
faraday (0.9.2) lib/faraday/response.rb:57:in `on_complete'
flexirest (1.5.5) lib/flexirest/request.rb:200:in `block in call'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
flexirest (1.5.5) lib/flexirest/request.rb:156:in `call'
flexirest (1.5.5) lib/flexirest/mapping.rb:46:in `_call'
flexirest (1.5.5) lib/flexirest/mapping.rb:28:in `block in _map_call'
app/controllers/application_controller.rb:93:in `get_neighborhood_list
The if attributes[:_links] line is part of the gem code, and it's here on this line
When it reaches this line the value of attributes is one of the strings inside the response, for instance: attributes = "Ahwatukee Foothills Village". That's why it gives the error.
What I'm trying to figure out if there is a way (maybe something in the configuration) that I can use Flexirest to handle this kind of responses.
This is a old question but thought I'd answer it. you need to add
plain: true
in your model like below.
class Neighborhood < BaseModel
get :by_location, "/neighborhoods/by_location", plain: true
end
It will then return the string array
I got a simple and free heroku app running where I added redis/sidekiq in order to send out mails in the background. I set everything up and once I start the worker, I get following error message in a loop:
Error fetching job: ERR max number of clients reached
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:114:in `call'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:95:in `block in connect'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:280:in `with_reconnect'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:93:in `connect'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:351:in `ensure_connected'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:208:in `block in process'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:293:in `logging'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:207:in `process'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:113:in `call'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:196:in `block in call_with_timeout'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:267:in `with_socket_timeout'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:195:in `call_with_timeout'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:1097:in `block in _bpop'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:57:in `block in synchronize'
/app/vendor/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:57:in `synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:1094:in `_bpop'
/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:1139:in `brpop'
/app/vendor/bundle/ruby/2.2.0/gems/redis-namespace-1.5.2/lib/redis/namespace.rb:393:in `call_with_namespace'
/app/vendor/bundle/ruby/2.2.0/gems/redis-namespace-1.5.2/lib/redis/namespace.rb:290:in `method_missing'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/fetch.rb:35:in `block in retrieve_work'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq.rb:84:in `block in redis'
/app/vendor/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:64:in `block (2 levels) in with'
/app/vendor/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `handle_interrupt'
/app/vendor/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `block in with'
/app/vendor/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `handle_interrupt'
/app/vendor/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `with'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq.rb:81:in `redis'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/fetch.rb:35:in `retrieve_work'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/processor.rb:85:in `get_one'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/processor.rb:95:in `fetch'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/processor.rb:78:in `process_one'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/processor.rb:67:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/util.rb:16:in `watchdog'
/app/vendor/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq/util.rb:24:in `block in safe_thread'
sidekiq.yml:
---
:queues:
- default
- mailers
sidekiq.rb:
Sidekiq.configure_server do |config|
config.redis = { :namespace => "mynamespace" }
end
Sidekiq.configure_client do |config|
config.redis = { :namespace => "mynamespace" }
end
require "sidekiq/web"
Sidekiq::Web.app_url = "/"
Sidekiq::Web.use(Rack::Auth::Basic, "Application") do |username, password|
username == ENV.fetch("SIDEKIQ_WEB_USERNAME") &&
password == ENV.fetch("SIDEKIQ_WEB_PASSWORD")
end
Anyone an idea what's wrong here? If you need any further info on the config files or something, let me know.
Changing sidekiq.yml to
---
:queues:
- default
- mailers
:concurrency: 5
did the trick. Setting concurrency to 9 did not for some reason even though heroku allows 10 for the redis nano addon.
This was the best solution that I found. If you are using the free heroku plan and the free redis nano plan. All the connections have to add up to 10 or less. To make sure that the connections add up check out this blog post. http://manuelvanrijn.nl/blog/2012/11/13/sidekiq-on-heroku-with-redistogo-nano/
He explains how everything adds up.
The writer also has a calculator that will help to calculate what the configuration should be for your particular server, sidekiq etc. It also tells you where the information needs to be added.
I was stuck on this too hope it saves somebody some time :)
I am attempting to deploy a site onto engineyard and I keep getting an error that seems to be a data formatting error. This only happens when deployed as production onto the server cluster. using the same DB and codebase locally or on a VPS we have no issues.
The errors seem to me to show that suddenly there is an array / hash type mismatch with some of the user data. It always seems to trace back to the model where it is tasked to get 'options'. The errors are triggered by the templates calling for access of checks on user attributes.
production log:
Completed 500 Internal Server Error in 32ms
** [Airbrake] Failure: Net::HTTPClientError
ActionView::Template::Error (can't convert Symbol into Integer):
18: = admin_user.username
19: = username_helper(admin_user)
20: %td= country_image admin_user
21: %td= admin_user.account_name
22: %td
23: - if admin_user.is_a?(Creative)
24: - if admin_user.is_juror?
app/models/user.rb:79:in `[]'
app/models/user.rb:79:in `has_option?'
app/models/contest_holder.rb:77:in `is_client_type?'
app/models/contest_holder.rb:81:in `is_agent?'
app/models/contest_holder.rb:70:in `ao_client_name'
app/models/contest_holder.rb:115:in `account_name'
app/views/admin/users/_users.html.haml:21:in `block in _app_views_admin_users__users_html_haml__845309245401675393_70184787547360'
trace:
ActionView::Template::Error: can't convert Symbol into Integer
Sample stack trace (show Rails)
/app/models/user.rb: 79:in `[]'
/app/models/user.rb: 79:in `has_option?'
…P/releases/20130814153250/app/models/contest_holder.rb: 77:in `is_client_type?'
…P/releases/20130814153250/app/models/contest_holder.rb: 81:in `is_agent?'
…P/releases/20130814153250/app/models/contest_holder.rb: 70:in `ao_client_name'
…P/releases/20130814153250/app/models/contest_holder.rb: 115:in `account_name'
…1/gems/haml-4.0.3/lib/haml/helpers/action_view_mods.rb: 10:in `block in render_with_haml'
…ed_gems/ruby/1.9.1/gems/haml-4.0.3/lib/haml/helpers.rb: 89:in `non_haml'
…1/gems/haml-4.0.3/lib/haml/helpers/action_view_mods.rb: 10:in `render_with_haml'
…ms/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb: 68:in `block in call'
…ms/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb: 56:in `each'
…ms/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb: 56:in `call'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 184:in `call!'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 164:in `call'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 184:in `call!'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 164:in `call'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 184:in `call!'
…uby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb: 164:in `call'
…ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/builder.rb: 49:in `call'
…VP/releases/20130814153250/lib/middleware/force_ssl.rb: 8:in `call'
…ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 35:in `block in call'
…ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 34:in `catch'
…ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 34:in `call'
…ndled_gems/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb: 23:in `call'
…/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb: 25:in `call'
…/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb: 210:in `context'
…/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb: 205:in `call'
…es/20130814153250/config/initializers/session_store.rb: 10:in `call'
code from user.rb which seems to be the point of contact for the error:
def has_option?(option)
self.options[option] && self.options[option].to_s == "1"
end
an example of an options value:
--- !map:ActiveSupport::HashWithIndifferentAccess is_agent: "1"
Came to find out that the issue was an additional line break within the database file. Specifically the application uses serialized yaml data a fair amount. An additional line break had been added between the yaml hash key and value causing an error within the object. We initially tried creating a script to cleanse the db and came to find it seemed to be simply corrupt from the original db file.
This was what wrong with my case
Error : ActionView::Template::Error (can't convert Symbol into Integer)
Reason:
In my haml.
I was trying to access a property from a json object.
object[:key]
But actually it was a json array(Array of entities from active record where clause). I just filtered the first element.
Hope someone will find useful.
I'm maintaining a rails 2.1 application that has some unfortunate choices for column names. For instance, an Event has a start and an end date. Instead of using start_at and end_at the original design uses start and end. Of course this leads to
def end
read_attribute(:end) || 1.hour.from_now
end
I'm surprised this even parses. Is this legal ruby? The real issue is that erb is blowing up with 'stack level too deep' when running a backgroundrb job to send the reminder emails. The template is
<%= [#event.name, #event.when_pretty, #event.location, #event.association,
#event.notes].reject(&:blank?) * "\n" %>
If I deliver_reminder in the console there is no error, but when deliver_reminder is called during the background job, the error occurs.
Question: should I refactor to remove the end method, or is the stack error being caused by something else?
On line #1 of foo/mailer/reminder.rhtml
1: <%= [#event.name, #event.when_pretty, #event.location, #event.association, #event.notes].reject(&:blank?) * "\n" %>
lib/virtual_attributes_and_associations.rb:59:in `virtual_attribute_names'
lib/virtual_attributes_and_associations.rb:83:in `read_attribute_without_virtual'
lib/virtual_attributes_and_associations.rb:86:in `read_attribute'
vendor/rails/activerecord/lib/active_record/base.rb:2720:in `send'
vendor/rails/activerecord/lib/active_record/base.rb:2720:in `clone_attribute_value'
vendor/rails/activerecord/lib/active_record/dirty.rb:127:in `write_attribute'
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:211:in `data='
lib/virtual_attributes_and_associations.rb:9:in `included'
vendor/rails/activesupport/lib/active_support/callbacks.rb:177:in `call'
vendor/rails/activesupport/lib/active_support/callbacks.rb:177:in `evaluate_method'
vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call'
vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in `run_callbacks'
vendor/rails/activerecord/lib/active_record/callbacks.rb:298:in `callback'
vendor/rails/activerecord/lib/active_record/base.rb:1450:in `send'
vendor/rails/activerecord/lib/active_record/base.rb:1450:in `instantiate'
vendor/rails/activerecord/lib/active_record/base.rb:582:in `find_by_sql'
vendor/rails/activerecord/lib/active_record/base.rb:582:in `collect!'
vendor/rails/activerecord/lib/active_record/base.rb:582:in `find_by_sql'
vendor/rails/activerecord/lib/active_record/base.rb:1341:in `find_every'
vendor/rails/activerecord/lib/active_record/base.rb:1376:in `find_one'
vendor/rails/activerecord/lib/active_record/base.rb:1362:in `find_from_ids'
vendor/rails/activerecord/lib/active_record/base.rb:537:in `find'
vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:in `find_target'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:196:in `load_target'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:99:in `reload'
vendor/rails/activerecord/lib/active_record/associations.rb:1084:in `contact'
lib/association.rb:52:in `associated_object'
lib/association.rb:48:in `association'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:177:in `send'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:177:in `method_missing'
app/views/foo/mailer/reminder.rhtml:1:in `_run_erb_47app47views47foo47mailer47reminder46rhtml'
Turns out the issue was with a library method called association, when I changed that to call associated_object (which was called by Association#association), the stack error no longer occurred.