Skip to content


Sample App for Shard Issues #88

jihaia opened this Issue · 8 comments

8 participants


I hope this is the right forum for this question/issue. I attempted to run the sample app but noticed that none of the shards were being populated. After a little exploring I determined that Octopus.enabled? was false and that Octopus.environments was ["production"]. Using the defaults in the app however I'm not sure how to overcome this as I'm in development mode and the shards.yml has no reference to this environment.

Am I missing something?



It happens to me as well ... any ways to avoid this ?


I will look at the sample app and fix it. thanks for the reports.


I'm experiencing the same issue, Octopus is not enabled with current git revision in Rails 3.2.3 in development environment.

After some debug with rails console I found that calling ActiveRecord::Base.connection_proxy restore Octopus behavior. Hope this help in order to find the actual issue.

[1] pry(main)> Octopus.enabled?
=> false
[2] pry(main)> Octopus.environments
=> ["production"]
[3] pry(main)> ActiveRecord::Base.connection_proxy
=> #<Octopus::Proxy:0x007ff8ecbb7500
 @adapters=#<Set: {"mysql2"}>,
[4] pry(main)> Octopus.environments
=> ["production", "development"]
[5] pry(main)> Octopus.enabled?
=> true

It seems that the issue is in this commit ed41314, reverting exactly this line of that commit solves the issue in my case.

@fabn fabn added a commit to fabn/octopus that referenced this issue
@fabn fabn Force loading of octopus configuration, should fix #88. 70eb013
@fabn fabn referenced this issue

Fix for #88 #94


Ran into this issue trying to use octopus; basically it only works for 'production' environment without the fix. Verified that the fix solves my problem.


:+1: ed41314 broke my db:migrate. verified that the fix solves my problem.


Confirmed this actually fixed issue 100 as well

@baseliners baseliners pushed a commit to baseliners/octopus that referenced this issue
Nirmal Govind Merge branch 'fabn-master' into mergepull94
* fabn-master:
  Force loading of octopus configuration, should fix #88.
  Block does not receive bugfix
  Refactoring how groups are accessed to remove enapsulation breaking.
  Fixed a couple missed table renamings
  Remove ActionPack as a dependency.
  Refactoring to Octopus.enabled? for checking if we should hook into ActiveRecord or not.
  Remove using_enabled flag as it was never being read.
  Refactoring to make the switch a little more obvious.
  Default Octopus::Proxy to use the Octopus config on initialization.
  Require just "spec_helper" instead of the expanded path.
  Removing controller spec as it's pending and doesn't make sense.
  Add ar-octopus that auto-requires octopus.
  Shameless renaming of tables to include an underscore before the number.
  Rails 3.2.x compatability.
  Add rails32 appraisal and remove generated gemfiles.
  Removing MetricFu due to it not working on 1.9.3.
  Generalize the require to ActiveSupport class extensions.
  Ignore vim swap files.
  Fixing update_attributes on rails 3.0.x

@sobrinho sobrinho closed this in 9f8862e
@choonkeat choonkeat referenced this issue
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.