Skip to content

Instantly share code, notes, and snippets.

@d-m-u
d-m-u / not working.md
Last active September 4, 2019 11:17
rails 2.5.5 threading things

2.5.5 rails console output from simulate_queue_worker

the first ~180 lines

** Delivering Message id: [92],  id: [], Zone: [], Role: [], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [18], Task id: [], Command: [ServiceTemplateProvisionRequest.call_automate_event], Timeout: [3600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: ["request_created"]

  ServiceTemplateProvisionRequest Load (1.8ms)  SELECT  "miq_requests".* FROM "miq_requests" WHERE "miq_requests"."type" IN ('ServiceTemplateProvisionRequest', 'ServiceTemplateTransformationPlanRequest') AND "miq_requests"."id" = $1 LIMIT $2  [["id", 18], ["LIMIT", 1]]
  ServiceTemplateProvisionRequest Inst Including Associations (44.6ms - 1rows)
@d-m-u
d-m-u / gist:13dea93840fb8a1795a2be6c31a732c8
Created October 1, 2019 10:53
undefined method `lookup_by_userid'
F, [2019-10-01T06:50:58.317694 #78907:3ff75b85dea4] FATAL -- : Error caught: [NoMethodError] undefined method `lookup_by_userid' for #<Class:0x00007feeb5d30b48>
Did you mean? lookup_by_identity
/Users/duhlmann/.rvm/gems/ruby-2.5.3/gems/activerecord-5.1.7/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/Users/duhlmann/manageiq-ui-classic/app/services/user_validation_service.rb:36:in `validate_user'
/Users/duhlmann/manageiq-ui-classic/app/controllers/dashboard_controller.rb:658:in `validate_user'
/Users/duhlmann/manageiq-ui-classic/app/controllers/dashboard_controller.rb:545:in `authenticate'
/Users/duhlmann/.rvm/gems/ruby-2.5.3/gems/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.3/gems/actionpack-5.1.7/lib/abstract_controller/base.rb:186:in `process_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.3/gems/actionpack-5.1.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.3/gems/
@d-m-u
d-m-u / gist:5782340cb21cd836be75fe3c96663617
Created October 1, 2019 11:03
automate domain import ImportFileUpload error
[2019-10-01T07:01:20.382292 #81380:3fddf931d640] ERROR -- : MIQ(miq_ae_tools_controller-automate_json): Error: import processing failed: Couldn't find ImportFileUpload with 'id'=8
@d-m-u
d-m-u / gist:84bc154c4d32622aa5a0f8f7e0e3110b
Created November 19, 2019 19:33
custom button add error
FATAL -- : Error caught: [NoMethodError] undefined method `[]' for nil:NilClass
/Users/duhlmann/.rvm/gems/ruby-2.5.7/bundler/gems/manageiq-ui-classic-6e87da71221f/app/controllers/application_controller/buttons.rb:478:in `button_create_update'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/bundler/gems/manageiq-ui-classic-6e87da71221f/app/controllers/application_controller/buttons.rb:190:in `button_create'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/gems/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/gems/actionpack-5.1.7/lib/abstract_controller/base.rb:186:in `process_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/gems/actionpack-5.1.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/gems/actionpack-5.1.7/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/Users/duhlmann/.rvm/gems/ruby-2.5.7/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:131:in `run_callbacks'
/Users/duh
Failures:
1) ManageIQ::Providers::Inventory::Persister tests we can serialize inventory object with nested lazy references
Failure/Error: self.miq_group ||= tenant_group || current_user_group || ems_tenant_group || root_tenant_group
ActiveModel::MissingAttributeError:
missing attribute: miq_group_id
# /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.3/lib/active_record/attribute_methods/read.rb:77:in `block in _read_attribute'
# /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.3/lib/active_model/attribute_set.rb:48:in `block in fetch_value'
# /Users/drewmu/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.3/lib/active_model/attribute.rb:222:in `value'
@d-m-u
d-m-u / gist:d51a7d20e56b9946cf5136f5897b7628
Created July 16, 2020 22:13
testing migration issues part 300
without the schema symlink: `REGION=702 bundle exec rake db:migrate`
fails in the same way... so it's not our code. and I can't change regions so I have to test this ... some other way.
so if i run it locally and spin up vms
I will have to create relationships
or if you could rspec this somehow?
-- Converting ems_ref_obj to ems_ref_type for MigrateEmsRefObjToEmsRefType::Host
-> 1.1567s

Dropping Migration Table, Models, Controller

Command Line

1. Drop Table/Migration

rails generate migration DropTablename

A file will be created, in the db > migrate folder, make sure it looks like: