Giter Site home page Giter Site logo

Comments (7)

romanblanco avatar romanblanco commented on May 25, 2024

@miq-bot add_label bug

from manageiq-automation_engine.

gmcculloug avatar gmcculloug commented on May 25, 2024

@d-m-u Can you try to reproduce this error with the suggested dialog?

@romanblanco Can you provide some details on the context in which you are using the dialog? Is it connected to a Service order, Custom Button or Catalog Item?

from manageiq-automation_engine.

romanblanco avatar romanblanco commented on May 25, 2024

@gmcculloug I've imported the dialog (Automate → Automation → Customization → Import/Export accordion) and tried to edit it in the Dialog Editor, it's not connected to any order, button or item.

from manageiq-automation_engine.

d-m-u avatar d-m-u commented on May 25, 2024

I cannot reproduce this, but I do occasionally see errors close to it if I need to restart the server.

from manageiq-automation_engine.

gmcculloug avatar gmcculloug commented on May 25, 2024

@romanblanco This issue has always been the result of running Rails in development mode and modifying code for a model. When Rails reloads the class it has the same name but the class object has a new object_id which ultimately causes the failure. We do not have any accounts of this issue happening in production.

As @d-m-u mentioned above the only real solution is to restart the server.

Here is an example of how the class object gets updated in Rails dev mode:

 [master x] ~/work/manageiq $ ber c
Loading development environment (Rails 5.0.6)
irb(main):001:0> a = Account.first
=> #<Account id: 1, name: "Test", acctid: nil, homedir: nil, local: nil, domain: nil, accttype: nil, vm_or_template_id: nil, display_name: nil, comment: nil, expires: nil, enabled: nil, last_logon: nil, host_id: nil>

Then comment out some methods in the app/model/account.rb file and save the file.

irb(main):002:0> reload!
Reloading...
=> true
irb(main):003:0> b = Account.first
=> #<Account id: 1, name: "Test", acctid: nil, homedir: nil, local: nil, domain: nil, accttype: nil, vm_or_template_id: nil, display_name: nil, comment: nil, expires: nil, enabled: nil, last_logon: nil, host_id: nil>

irb(main):004:0> a.class.name
=> "Account"
irb(main):005:0> a.class.object_id
=> 70107371952440

irb(main):006:0> b.class.name
=> "Account"
irb(main):007:0> b.class.object_id
=> 70107299065540
irb(main):008:0> 

As you can see objects a and b are object say the are based on the Account class but each class object has a different object_id.

Running the same basic test but with Automate Service models reproduces the error:

irb(main):002:0> $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
=> #<MiqAeMethodService::MiqAeService:0x00007f83643a1e18 @drb_server_references=[], @inputs={}, @workspace=#<MiqAeEngine::MiqAeWorkspaceRuntime:0x00007f83643a20e8 @readonly=false, @nodes=[], @current=[], @datastore_cache={}, @class_methods={}, @dom_search=#<MiqAeEngine::MiqAeDomainSearch:0x00007f83643a1fa8 @fqns_id_cache={}, @fqns_id_class_cache={}, @partial_ns=[], @prepend_namespace=nil>, @persist_state_hash={}, @current_state_info={}, @state_machine_objects=[], @ae_user=nil, @rbac=false>, @persist_state_hash={}, @logger=#<Vmdb::Loggers::MulticastLogger:0x00007f8361858a18 @loggers=#<Set: {#<VMDBLogger:0x00007f8361858cc0 @level=1, @progname=nil, @default_formatter=#<Logger::Formatter:0x00007f8361858c20 @datetime_format=nil>, @formatter=#<VMDBLogger::Formatter:0x00007f8361858ab8 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x00007f8361858bd0 @shift_period_suffix="%Y%m%d", @shift_size=1048576, @shift_age=0, @filename=#<Pathname:/Users/gmccullough/work/manageiq/log/automation.log>, @dev=#<File:/Users/gmccullough/work/manageiq/log/automation.log>, @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x00007f8361858b80>>, @write_lock=#<Thread::Mutex:0x00007f8361858a68>, @local_levels={}>}>, @level=0>>

irb(main):003:0> a = $evm.vmdb('account').first
=> #<MiqAeServiceAccount:0x3fc1b21b1904 @object=#<Account id: 1, name: "Test", acctid: nil, homedir: nil, local: nil, domain: nil, accttype: nil, vm_or_template_id: nil, display_name: nil, comment: nil, expires: nil, enabled: nil, last_logon: nil, host_id: nil>, @virtual_columns=["href_slug", "region_description", "region_number"], @associations=["host", "vm_or_template"]>

irb(main):004:0> reload!
Reloading...
=> true

irb(main):005:0> b = $evm.vmdb('account').first
SystemStackError: stack level too deep
	from /Users/gmccullough/.gem/ruby/2.4.3/bundler/gems/manageiq-automation_engine-2b24b4e0421e/lib/miq_automation_engine/engine/miq_ae_method_service.rb:3:in `const_missing'
	from /Users/gmccullough/.gem/ruby/2.4.3/bundler/gems/manageiq-automation_engine-2b24b4e0421e/lib/miq_automation_engine/engine/miq_ae_method_service.rb:3:in `const_missing'
	from /Users/gmccullough/.gem/ruby/2.4.3/bundler/gems/manageiq-automation_engine-2b24b4e0421e/lib/miq_automation_engine/engine/miq_ae_method_service.rb:3:in `const_missing'

To work around this issue you'll need to restart the Rails server.

from manageiq-automation_engine.

romanblanco avatar romanblanco commented on May 25, 2024

@gmcculloug Thanks for the explaination 👍

from manageiq-automation_engine.

romanblanco avatar romanblanco commented on May 25, 2024

@fdupont-redhat ☝️ January 22, 2018 11:23 AM

from manageiq-automation_engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.