theforeman/foreman · error · Foreman::Exception

Error has occurred while communicating with %{cr}: %{e}

Error message

Error has occurred while communicating with %{cr}: %{e}

What it means

Error "Error has occurred while communicating with %{cr}: %{e}" thrown in theforeman/foreman.

Source

Thrown at app/services/power_manager/virt.rb:15

require 'timeout'

module PowerManager
  class Virt < Base
    def initialize(opts = {})
      super(opts)
      begin
        Timeout.timeout(15) do
          @vm = host.compute_resource.find_vm_by_uuid(host.uuid)
        end
      rescue Timeout::Error
        raise Foreman::Exception.new(N_("Timeout has occurred while communicating with %s"), host.compute_resource)
      rescue => e
        Foreman::Logging.exception("Error has occurred while communicating to #{host.compute_resource}", e)
        raise Foreman::Exception.new(N_("Error has occurred while communicating with %{cr}: %{e}"), { :cr => host.compute_resource, :e => e })
      end
    end

    def virt_state
      # make sure we fetch latest vm status
      vm.reload
      vm.state
    end

    def state_output(result)
      result = result.to_s
      return 'on' if result.match?(/started|running/i)
      return 'off' if result.match?(/paused|stopped/i)
      translate_status(result) # unknown output
    end

    def default_action(action)
      vm.send(action)

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/power_manager/virt.rb:15 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/b90d8e1d51ff46f9. Report an issue: GitHub.