{"record":{"id":"6bca2ebfd42bf193","repo":"onetimesecret/onetimesecret","slug":"txt-record-hostname-can-only-contain-letters-numb","errorCode":null,"errorMessage":"TXT record hostname can only contain letters, numbers, dots, underscores, and hyphens","messagePattern":"TXT record hostname can only contain letters, numbers, dots, underscores, and hyphens","errorType":"validation","errorClass":"Onetime::Problem","httpStatus":null,"severity":"error","filePath":"lib/onetime/models/custom_domain.rb","lineNumber":592,"sourceCode":"    def allow_public_api?\n      api_config = ApiConfig.find_by_domain_id(identifier)\n      unless api_config\n        OT.le \"[CustomDomain] ApiConfig missing for domain #{identifier}; using safe default (false). Run migration 20260417_01_backfill_homepage_config to repair.\"\n        return false\n      end\n\n      api_config.enabled?\n    end\n\n    # Validates the format of TXT record host and value used for domain verification.\n    # The host must be alphanumeric with dots, underscores, or hyphens only.\n    # The value must be a 32-character hexadecimal string.\n    #\n    # @raise [Onetime::Problem] If the TXT record host or value format is invalid\n    # @return [void]\n    def validate_txt_record!\n      unless txt_validation_host.to_s.match?(/\\A[a-zA-Z0-9._-]+\\z/)\n        raise Onetime::Problem, 'TXT record hostname can only contain letters, numbers, dots, underscores, and hyphens'\n      end\n\n      return if txt_validation_value.to_s.match?(/\\A[a-f0-9]{32}\\z/)\n\n      raise Onetime::Problem, 'TXT record value must be a 32-character hexadecimal string'\n    end\n\n    # Generates a TXT record for domain ownership verification.\n    # Format: _onetime-challenge-<short_id>[.subdomain]\n    #\n    # The record consists of:\n    # - A prefix (_onetime-challenge-)\n    # - First 7 chars of the domain identifier\n    # - Subdomain parts if present (e.g. .www or .status.www)\n    # - A 32-char random hex value\n    #\n    # @return [Array<String, String>] The TXT record host and value\n    # @raise [Onetime::Problem] If the generated record is invalid","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/onetimesecret/onetimesecret/blob/f81295e41bc3e808a3dd2cbea03ef65401a662e4/lib/onetime/models/custom_domain.rb#L574-L610","documentation":"Error \"TXT record hostname can only contain letters, numbers, dots, underscores, and hyphens\" thrown in onetimesecret/onetimesecret.","triggerScenarios":"Thrown at lib/onetime/models/custom_domain.rb:592 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove invalid characters from the TXT record hostname; use only letters, numbers, dots, underscores, and hyphens."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f81295e41bc3e808a3dd2cbea03ef65401a662e4","analyzedAt":"2026-08-23T21:13:10.635Z","schemaVersion":2},"datasetVersion":"2026-08-24T02:17:37.098Z"}