theforeman/foreman · error · Foreman::Renderer::Errors::WrongSubnetError

%{object_name} is a %{object_class}, expected a subnet

Error message

%{object_name} is a %{object_class}, expected a subnet

What it means

Error "%{object_name} is a %{object_class}, expected a subnet" thrown in theforeman/foreman.

Source

Thrown at app/services/foreman/renderer/scope/macros/base.rb:480

            Foreman::Version.new.short
          end

          apipie :method, 'Parses a URL string and returns a URI object' do
            required :url, String, desc: 'URL string to parse'
            returns URI::Generic, desc: 'Parsed URI object; use .hostname, .host, .port, .path, .scheme, .query on the result'
            example "parse_url('https://tower.example.com:443').hostname # => 'tower.example.com'"
            example "parse_url('https://[::1]').hostname # => '::1'"
          end
          def parse_url(url)
            URI.parse(url.to_s)
          rescue URI::InvalidURIError
            URI.parse('')
          end

          private

          def validate_subnet(subnet)
            raise WrongSubnetError.new(object_name: subnet.to_s, object_class: subnet.class.to_s) unless subnet.is_a?(Subnet)
          end
        end
      end
    end
  end
end

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/foreman/renderer/scope/macros/base.rb:480 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/17151a3d6656ecae. Report an issue: GitHub.