influitive / apartment-sidekiq

Sidekiq support for the Apartment Gem
MIT License
126 stars 54 forks source link

Error Apartment::TenantNotFound #10

Closed Frank004 closed 8 years ago

Frank004 commented 8 years ago

Hi I get this error whe I try to process a img in the background.

09:37:22 redis_s.1 | 33693:M 07 Dec 09:37:22.096 * 100 changes in 300 seconds. Saving...
09:37:22 redis_s.1 | 33693:M 07 Dec 09:37:22.097 * Background saving started by pid 71671
09:37:22 redis_s.1 | 71671:C 07 Dec 09:37:22.099 * DB saved on disk
09:37:22 redis_s.1 | 33693:M 07 Dec 09:37:22.197 * Background saving terminated with success
09:39:27 worker.1  | 2015-12-07T13:39:27.825Z 33694 TID-ougbxml30 DelayedPaperclip::Jobs::ActiveJob JID-9570d2fa326ad3b1bbc24651 INFO: start
09:39:28 worker.1  | 2015-12-07T13:39:28.299Z 33694 TID-ougbxml30 DelayedPaperclip::Jobs::ActiveJob JID-9570d2fa326ad3b1bbc24651 INFO: fail: 0.474 sec
09:39:28 worker.1  | 2015-12-07T13:39:28.300Z 33694 TID-ougbxml30 WARN: {"class"=>"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper", "wrapped"=>"DelayedPaperclip::Jobs::ActiveJob", "queue"=>"paperclip", "args"=>[{"job_class"=>"DelayedPaperclip::Jobs::ActiveJob", "job_id"=>"44d6026e-5aca-4a07-9d18-054e75bd0eb7", "queue_name"=>"paperclip", "arguments"=>["TaskTran", 449, "signature_manager"], "locale"=>"es"}], "retry"=>true, "jid"=>"9570d2fa326ad3b1bbc24651", "created_at"=>1449495208.7341068, "apartment"=>"companydemo", "enqueued_at"=>1449495567.8203, "error_message"=>"One of the following schema(s) is invalid: \"companydemo\" \"public\"", "error_class"=>"Apartment::TenantNotFound", "failed_at"=>1449495209.205343, "retry_count"=>4, "retried_at"=>1449495568.298719}
09:39:28 worker.1  | 2015-12-07T13:39:28.300Z 33694 TID-ougbxml30 WARN: Apartment::TenantNotFound: One of the following schema(s) is invalid: "companydemo" "public"
09:39:28 worker.1  | 2015-12-07T13:39:28.301Z 33694 TID-ougbxml30 WARN: /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/apartment-1.0.2/lib/apartment/adapters/postgresql_adapter.rb:92:in `rescue in connect_to_new'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/apartment-1.0.2/lib/apartment/adapters/postgresql_adapter.rb:85:in `connect_to_new'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/apartment-1.0.2/lib/apartment/adapters/abstract_adapter.rb:84:in `switch!'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/apartment-1.0.2/lib/apartment/adapters/abstract_adapter.rb:97:in `switch'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/apartment-sidekiq-0.2.0/lib/apartment/sidekiq/middleware/server.rb:4:in `call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/logging.rb:30:in `with_context'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/server/logging.rb:7:in `call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:129:in `block in invoke'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:132:in `call'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/middleware/chain.rb:132:in `invoke'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/processor.rb:51:in `block in process'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/processor.rb:104:in `stats'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sidekiq-3.5.3/lib/sidekiq/processor.rb:50:in `process'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/calls.rb:28:in `public_send'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/calls.rb:28:in `dispatch'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/call/async.rb:7:in `dispatch'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/cell.rb:50:in `block in dispatch'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/cell.rb:76:in `block in task'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/actor.rb:339:in `block in task'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/task.rb:44:in `block in initialize'
09:39:28 worker.1  | /Users/IFrank/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/celluloid-0.17.2/lib/celluloid/task/fibered.rb:14:in `block in create'
typeoneerror commented 8 years ago

@Frank004 can you connect to your local psql and verify that the schema called "companydemo" exists? the error is telling you it doesn't.

Frank004 commented 8 years ago

@typeoneerror yes it its as im using it. This happen after the last update of sidekiq

Frank004 commented 8 years ago
irb(main):009:0> Apartment::Tenant.switch!('companydemo')
=> "\"companydemo\""
irb(main):010:0> 
typeoneerror commented 8 years ago

@Frank004 is this during a retry? 0.2.1 and 1.0.0 introduced some changes that look to be breaking. I'm working on trying some things now, but I had to roll back to 0.2.0 myself.

https://github.com/influitive/apartment-sidekiq/issues/11

Frank004 commented 8 years ago

@typeoneerror thank you. if you find something out you let me know. ill keep looking at the code.

bradrobertson commented 8 years ago

Fixed #11

Frank004 commented 8 years ago

I'm still having the same problem. ill keep look at the code maybe some setup or confict with another

02:39:04 worker.1  | 2016-06-09T06:39:04.412Z 21809 TID-ov3dsii2s MyWorker JID-0513e166b0363945760c8a50 INFO: start
02:39:04 worker.1  | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s MyWorker JID-0513e166b0363945760c8a50 INFO: fail: 0.004 sec
02:39:04 worker.1  | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: {"class":"MyWorker","args":["testing","juan",5],"retry":true,"queue":"default","jid":"0513e166b0363945760c8a50","created_at":1465454206.3338182,"apartment":"companydemo2","enqueued_at":1465454344.410656,"error_message":"One of the following schema(s) is invalid: \"companydemo2\" \"public\"","error_class":"Apartment::TenantNotFound","failed_at":1465454242.2405062,"retry_count":2,"retried_at":1465454344.4156559}
02:39:04 worker.1  | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: Apartment::TenantNotFound: One of the following schema(s) is invalid: "companydemo2" "public"
02:39:04 worker.1  | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/postgresql_adapter.rb:72:in `rescue in connect_to_new'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/postgresql_adapter.rb:65:in `connect_to_new'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/abstract_adapter.rb:85:in `switch!'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/abstract_adapter.rb:98:in `switch'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-sidekiq-1.1.0/lib/apartment/sidekiq/middleware/server.rb:4:in `call'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:in `with_context'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:7:in `call'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in `invoke'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:129:in `block in process'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:168:in `stats'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:128:in `process'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:80:in `process_one'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:68:in `run'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:17:in `watchdog'
02:39:04 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:25:in `block in safe_thread'
typeoneerror commented 8 years ago

I can pair with you some time next week if you like and we can try to get to the bottom of it.

On Wed, Jun 8, 2016 at 11:42 PM francisco Quinones notifications@github.com wrote:

I'm still having the same problem. ill keep look at the code maybe some setup or confict with another gem. if I run the job in the public schema the job run as normal.

02:39:04 worker.1 | 2016-06-09T06:39:04.412Z 21809 TID-ov3dsii2s MyWorker JID-0513e166b0363945760c8a50 INFO: start 02:39:04 worker.1 | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s MyWorker JID-0513e166b0363945760c8a50 INFO: fail: 0.004 sec 02:39:04 worker.1 | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: {"class":"MyWorker","args":["testing","juan",5],"retry":true,"queue":"default","jid":"0513e166b0363945760c8a50","created_at":1465454206.3338182,"apartment":"companydemo2","enqueued_at":1465454344.410656,"error_message":"One of the following schema(s) is invalid: \"companydemo2\" \"public\"","error_class":"Apartment::TenantNotFound","failed_at":1465454242.2405062,"retry_count":2,"retried_at":1465454344.4156559} 02:39:04 worker.1 | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: Apartment::TenantNotFound: One of the following schema(s) is invalid: "companydemo2" "public" 02:39:04 worker.1 | 2016-06-09T06:39:04.416Z 21809 TID-ov3dsii2s WARN: /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/postgresql_adapter.rb:72:in rescue in connect_to_new' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/postgresql_adapter.rb:65:inconnect_to_new' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/abstract_adapter.rb:85:in switch!' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/abstract_adapter.rb:98:inswitch' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-sidekiq-1.1.0/lib/apartment/sidekiq/middleware/server.rb:4:in call' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/active_record.rb:6:in call' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in call' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:11:in block in call' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:inwith_context' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:7:in call' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in invoke' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:129:inblock in process' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:168:in stats' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:128:inprocess' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:80:in process_one' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:68:inrun' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:17:in watchdog' 02:39:04 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:25:inblock in safe_thread'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/influitive/apartment-sidekiq/issues/10#issuecomment-224812758, or mute the thread https://github.com/notifications/unsubscribe/AANWTLRDcCJ6OfOp36svx4rf0aLso4MVks5qJ7W6gaJpZM4GwI8v .

Frank004 commented 8 years ago

@typeoneerror thank you. I'm trying to find where is going wrong with my little knowledge, trying to get as much output as I can for you guys.

Frank004 commented 8 years ago
Gemfile
---------------
gem 'apartment', '~> 1.0', '>= 1.0.2'
gem 'sidekiq', '~> 4.0', '>= 4.1'
gem 'apartment-sidekiq', '~> 1.1.0'
group :production do
  gem 'autoscaler', '~> 0.11.0'
end
Procfile
---------------
web: bundle exec puma -C config/puma.rb
log: tail -f log/development.log
redis_s: redis-server
worker: bundle exec sidekiq -e production -C ./config/sidekiq.yml
sidekiq.rb
---------------
require 'sidekiq'
require 'autoscaler/sidekiq'
require 'autoscaler/heroku_scaler'

Rails.logger = Sidekiq::Logging.logger

heroku = nil
if ENV['HEROKU_APP']
  heroku = Autoscaler::HerokuScaler.new
end

Sidekiq.configure_client do |config|
  config.redis = { size: 1}
  if heroku
    config.client_middleware do |chain|
      chain.add Autoscaler::Sidekiq::Client, 'default' => heroku
    end
  end
end

Sidekiq.configure_server do |config|
  config.redis = { size: 27}
  database_url = ENV['DATABASE_URL']
  if database_url
    ENV['DATABASE_URL'] = "#{database_url}?pool=25"
    ActiveRecord::Base.establish_connection
  end
  config.server_middleware do |chain|
    if heroku
      p "[Sidekiq] Running on Heroku, autoscaler is used"
      chain.add(Autoscaler::Sidekiq::Server, heroku, 60) # 60 seconds timeout
    else
      p "[Sidekiq] Running locally, so autoscaler isn't used"
    end
  end
end
sidekiq.yml
---------------
:concurrency: 10
# you can override concurrency based on environment
production:
  :concurrency: 25
# Set timeout to 8 on Heroku, longer if you manage your own systems.
:timeout: 8
:queues:
  - critical
  - default
  - paperclip
  - low
rails c
MyWorker.perform_in(1.seconds, Apartment::Tenant.current)
class MyWorker
  include Sidekiq::Worker
  def perform(tenant)
      puts  "------------------------"
      puts  "------------------------"
      puts  "Current Tenant #{Apartment::Tenant.current}"
      puts  "------------------------"
      puts  "------------------------"
  end
end

screen shot 2016-06-09 at 3 05 54 am

Frank004 commented 8 years ago

So I add it some puts on different parts of the process looking where the item["apartment"] pass and this the output.

If you can see the Apartment::Tenant.switch(item['apartment']) works with "public" but when you switch to any other tenant get the error.

module Apartment::Sidekiq::Middleware
  class Server
    def call(worker_class, item, queue)
      puts "----------------------------"
      puts "The item param for apartment: #{item["apartment"]}"
      puts "----------------------------"
      puts "Worker Class: #{worker_class}"
      puts "----------------------------"
      puts "The queue: #{queue}"
      puts "----------------------------"
      puts "Tenant: #{Apartment::Tenant.switch(item['apartment'])}"
      puts "----------------------------"
     #this just so the job run it will fail im just looking for the top part output
      Apartment::Tenant.current do
        yield
      end
    end
  end
end
11:20:24 worker.1  | 2016-06-09T15:20:24.581Z 30781 TID-ow4pahmoc MyWorker JID-a5a0ca08afbaaf0b10f37774 INFO: start
11:20:24 worker.1  | ----------------------------
11:20:24 worker.1  | The item param for apartment: public
11:20:24 worker.1  | ----------------------------
11:20:24 worker.1  | Worker Class: #<MyWorker:0x007fbcdc0004b0>
11:20:24 worker.1  | ----------------------------
11:20:24 worker.1  | The queue: default
11:20:24 worker.1  | ----------------------------
11:20:24 worker.1  | Tenant: "public"
11:20:24 worker.1  | ----------------------------
11:20:24 worker.1  | ------------------------
11:20:24 worker.1  | ------------------------
11:20:24 worker.1  | Current Tenant public
11:20:24 worker.1  | ------------------------
11:20:24 worker.1  | ------------------------
11:20:24 worker.1  | 2016-06-09T15:20:24.584Z 30781 TID-ow4pahmoc MyWorker JID-a5a0ca08afbaaf0b10f37774 INFO: done: 0.003 sec
11:20:54 worker.1  | 2016-06-09T15:20:54.436Z 30781 TID-ow4pashdc MyWorker JID-d27f2334ac2452d15e6bf9ba INFO: start
11:20:54 worker.1  | ----------------------------
11:20:54 worker.1  | The item param for apartment: companydemo
11:20:54 worker.1  | ----------------------------
11:20:54 worker.1  | Worker Class: #<MyWorker:0x007fbcd836c968>
11:20:54 worker.1  | ----------------------------
11:20:54 worker.1  | The queue: default
11:20:54 worker.1  | ----------------------------
11:20:54 worker.1  | 2016-06-09T15:20:54.439Z 30781 TID-ow4pashdc MyWorker JID-d27f2334ac2452d15e6bf9ba INFO: fail: 0.003 sec
11:20:54 worker.1  | 2016-06-09T15:20:54.439Z 30781 TID-ow4pashdc WARN: {"class":"MyWorker","args":["companydemo"],"retry":true,"queue":"default","jid":"d27f2334ac2452d15e6bf9ba","created_at":1465485640.888371,"apartment":"companydemo","enqueued_at":1465485654.435481,"error_message":"One of the following schema(s) is invalid: \"companydemo\" \"public\"","error_class":"Apartment::TenantNotFound","failed_at":1465485654.439004,"retry_count":0}
11:20:54 worker.1  | 2016-06-09T15:20:54.439Z 30781 TID-ow4pashdc WARN: Apartment::TenantNotFound: One of the following schema(s) is invalid: "companydemo" "public"
11:20:54 worker.1  | 2016-06-09T15:20:54.439Z 30781 TID-ow4pashdc WARN: /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-1.1.0/lib/apartment/adapters/postgresql_adapter.rb:72:in `rescue in connect_to_new'
Frank004 commented 8 years ago

Has I keep looking around I found that it never connect to my DB at this point as I call for the last user to be display.

module Apartment::Sidekiq::Middleware
  class Server
    def call(worker_class, item, queue)
      puts "----------------------------"
      puts "The item param for apartment: #{item["apartment"]}"
      puts User.last
      puts "----------------------------"
      Apartment::Tenant.switch(item['apartment']) do
        yield
      end
    end
  end
end
11:45:46 worker.1  | 2016-06-09T15:45:46.319Z 31427 TID-out6i5dqo MyWorker JID-e47ae7772c51dcdeef6e7e4a INFO: start
11:45:46 worker.1  | ----------------------------
11:45:46 worker.1  | The item param for apartment: public
11:45:46 worker.1  | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo MyWorker JID-e47ae7772c51dcdeef6e7e4a INFO: fail: 0.002 sec
11:45:46 worker.1  | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: {"class":"MyWorker","args":["public"],"retry":true,"queue":"default","jid":"e47ae7772c51dcdeef6e7e4a","created_at":1465487140.9516401,"apartment":"public","enqueued_at":1465487146.318733,"error_message":"PG::UndefinedTable: ERROR:  relation \"public.users\" does not exist\nLINE 1: SELECT  \"public\".\"users\".* FROM \"public\".\"users\"  ORDER BY \"...\n                                        ^\n: SELECT  \"public\".\"users\".* FROM \"public\".\"users\"  ORDER BY \"public\".\"users\".\"id\" DESC LIMIT 1","error_class":"ActiveRecord::StatementInvalid","failed_at":1465487146.3210812,"retry_count":0}
11:45:46 worker.1  | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "public.users" does not exist
11:45:46 worker.1  | LINE 1: SELECT  "public"."users".* FROM "public"."users"  ORDER BY "...
11:45:46 worker.1  |                                         ^
11:45:46 worker.1  | : SELECT  "public"."users".* FROM "public"."users"  ORDER BY "public"."users"."id" DESC LIMIT 1
11:45:46 worker.1  | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `async_exec'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:355:in `select'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/querying.rb:39:in `find_by_sql'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:639:in `exec_queries'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:515:in `load'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:243:in `to_a'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:511:in `find_last'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:160:in `last'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/querying.rb:3:in `last'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-sidekiq-1.1.0/lib/apartment/sidekiq/middleware/server.rb:6:in `call'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:in `with_context'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:7:in `call'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in `invoke'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:129:in `block in process'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:168:in `stats'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:128:in `process'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:80:in `process_one'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:68:in `run'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:17:in `watchdog'
11:45:46 worker.1  | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:25:in `block in safe_thread'
typeoneerror commented 8 years ago

After seeing this, I don't think your issue is related to sidekiq or apartment. Let's take this off of their github and either pair or im next week. On Thu, Jun 9, 2016 at 8:51 AM francisco Quinones notifications@github.com wrote:

Has I keep looking around I found that it never connect to my DB at this point as I call for the last user tu be display.

module Apartment::Sidekiq::Middleware class Server def call(worker_class, item, queue) puts "----------------------------" puts "The item param for apartment: #{item["apartment"]}" puts User.last puts "----------------------------" Apartment::Tenant.switch(item['apartment']) do yield end end end end

11:45:46 worker.1 | 2016-06-09T15:45:46.319Z 31427 TID-out6i5dqo MyWorker JID-e47ae7772c51dcdeef6e7e4a INFO: start 11:45:46 worker.1 | ---------------------------- 11:45:46 worker.1 | The item param for apartment: public 11:45:46 worker.1 | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo MyWorker JID-e47ae7772c51dcdeef6e7e4a INFO: fail: 0.002 sec 11:45:46 worker.1 | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: {"class":"MyWorker","args":["public"],"retry":true,"queue":"default","jid":"e47ae7772c51dcdeef6e7e4a","created_at":1465487140.9516401,"apartment":"public","enqueued_at":1465487146.318733,"error_message":"PG::UndefinedTable: ERROR: relation \"public.users\" does not exist\nLINE 1: SELECT \"public\".\"users\".* FROM \"public\".\"users\" ORDER BY \"...\n ^\n: SELECT \"public\".\"users\".* FROM \"public\".\"users\" ORDER BY \"public\".\"users\".\"id\" DESC LIMIT 1","error_class":"ActiveRecord::StatementInvalid","failed_at":1465487146.3210812,"retry_count":0} 11:45:46 worker.1 | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "public.users" does not exist 11:45:46 worker.1 | LINE 1: SELECT "public"."users".* FROM "public"."users" ORDER BY "... 11:45:46 worker.1 | ^ 11:45:46 worker.1 | : SELECT "public"."users".* FROM "public"."users" ORDER BY "public"."users"."id" DESC LIMIT 1 11:45:46 worker.1 | 2016-06-09T15:45:46.321Z 31427 TID-out6i5dqo WARN: /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in async_exec' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:inblock in exec_no_cache' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:472:in block in log' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:ininstrument' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:466:in log' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:592:inexec_no_cache' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in execute_and_clear' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:inexec_query' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:355:in select' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:32:inselect_all' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in select_all' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/querying.rb:39:infind_by_sql' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:639:in exec_queries' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:515:inload' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation.rb:243:in to_a' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:511:infind_last' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:160:in last' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.5/lib/active_record/querying.rb:3:inlast' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/apartment-sidekiq-1.1.0/lib/apartment/sidekiq/middleware/server.rb:6:in call' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/active_record.rb:6:in call' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/retry_jobs.rb:74:in call' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:11:in block in call' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:inwith_context' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/server/logging.rb:7:in call' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:inblock in invoke' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in invoke' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:129:inblock in process' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:168:in stats' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:128:inprocess' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:80:in process_one' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/processor.rb:68:inrun' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:17:in watchdog' 11:45:46 worker.1 | /Users/IFrank/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-4.1.2/lib/sidekiq/util.rb:25:inblock in safe_thread'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/influitive/apartment-sidekiq/issues/10#issuecomment-224938807, or mute the thread https://github.com/notifications/unsubscribe/AANWTEL7-aooTSdMxA0fqZ41nr6lcw6pks5qKDZlgaJpZM4GwI8v .

Frank004 commented 8 years ago

perfect I will create a gist with the info I can get. @typeoneerror https://gist.github.com/Frank004/48276206a96e45102e9004f2c19f38d0

typeoneerror commented 8 years ago

@Frank004 my skype is the same as my github handle. hit me up there next week.

Frank004 commented 7 years ago

rake middleware

use ActionDispatch::Static
use Rack::Lock
use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007febcb0e51f0>
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use MetaRequest::Middlewares::Headers
use WebConsole::Middleware
use ActionDispatch::DebugExceptions
use BetterErrors::Middleware
use Raygun::Middleware::RackExceptionInterceptor
use Raygun::Middleware::RailsInsertAffectedUser
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Apartment::Elevators::Subdomain
use Warden::Manager
use Apartment::Reloader
use JQuery::FileUpload::Rails::Middleware
use MetaRequest::Middlewares::MetaRequestHandler
use MetaRequest::Middlewares::AppRequestHandler
use Bullet::Rack
use Apartment::Elevators::Subdomain
use RecurringSelectMiddleware
run APP::Application.routes

can't find the sidekiq middleware on the list

typeoneerror commented 7 years ago

FYI, @Frank004 and I resolved this issue here in case anyone was experiencing a similar issue.

SimonBrazell commented 7 years ago

@typeoneerror how did you resolve this problem, I am currently experiencing the same error.

Frank004 commented 7 years ago

@simonbrazell what gems ver. are you using?

typeoneerror commented 7 years ago

@simonbrazell did you read the stackoverflow thread I linked above?

http://stackoverflow.com/questions/41229392/why-is-apartment-sidekiq-not-finding-the-tenant/41471241#41471241

For debugging, I'd recommend starting a question thread on stackoverflow instead of here on the repo.

SimonBrazell commented 7 years ago

@typeoneerror all good, it was a silly mistake by myself in the end, it was getting late and I started to despair... thanks for responding though!

Cheers!