onetimesecret/onetimesecret · error · Onetime::Problem

Invalid domain format

Error message

Invalid domain format

What it means

Error "Invalid domain format" thrown in onetimesecret/onetimesecret.

Source

Thrown at lib/onetime/models/custom_domain.rb:991

      #
      # @param input [String] The domain name to parse
      # @param org_id [String] Organization ID to associate with this domain
      #
      # @return [Onetime::CustomDomain]
      #
      # @raise [PublicSuffix::DomainInvalid] If domain is invalid
      # @raise [PublicSuffix::DomainNotAllowed] If domain is not allowed
      # @raise [PublicSuffix::Error] For other PublicSuffix errors
      # @raise [Onetime::Problem] If domain exceeds MAX_SUBDOMAIN_DEPTH or MAX_TOTAL_LENGTH
      #
      # @note BREAKING CHANGE: Second parameter changed from custid to org_id.
      #   See {create!} for migration details.
      #
      def parse(input, org_id)
        raise Onetime::Problem, 'Organization ID required' if org_id.to_s.empty?

        segments = input.to_s.split('.').reject(&:empty?)
        raise Onetime::Problem, 'Invalid domain format' if segments.empty?

        raise Onetime::Problem, "Domain too deep (max: #{MAX_SUBDOMAIN_DEPTH})" if segments.length > MAX_SUBDOMAIN_DEPTH

        raise Onetime::Problem, "Domain too long (max: #{MAX_TOTAL_LENGTH})" if input.length > MAX_TOTAL_LENGTH

        display_domain      = self.display_domain(input)
        OT.ld "[CustomDomain.parse] Creating with display_domain=#{display_domain.inspect}, org_id=#{org_id.inspect}"
        obj                 = new(display_domain: display_domain, org_id: org_id)
        obj._original_value = input

        # Debug the created object
        OT.ld "[CustomDomain.parse] display_domain=#{obj.display_domain.inspect}, org_id=#{obj.org_id.inspect}, identifier=#{obj.identifier.inspect}"

        obj
      end

      # Takes the given input domain and returns the base domain,
      # the one that the zone record would be created for. So

View on GitHub (pinned to f81295e41b)

Solutions

  1. Enter a valid hostname (e.g. example.com) without protocol, port, or path, then retry.

When it happens

Trigger: Thrown at lib/onetime/models/custom_domain.rb:991 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of onetimesecret/onetimesecret@f81295e41b (2026-08-23). Data as JSON: /api/errors/b667e4860a6cce6a. Report an issue: GitHub.