Failed to add host with bmc ssh

I installed foreman 1.22 on debian stretch. I can add bmc ipmi host, but when I add a bmc ssh host it says “hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”

here is the log from /var/log/foreman/production.log:
https://paste.ubuntu.com/p/Q8v4htfzHg/

the bmc config file is:
:enabled: https
:bmc_default_provider: ipmitool
:bmc_ssh_user: root
:bmc_ssh_key: /usr/share/foreman/.ssh/id_rsa
:bmc_ssh_powerstatus: “true”
:bmc_ssh_powercycle: “shutdown -r +1”
:bmc_ssh_poweroff: “shutdown +1”
:bmc_ssh_poweron: “false”

Hey, this error has nothing to do with BMC or SSH-BMC provider. Hostname have strict rules in Foreman due to fact that Foreman can integrate with many other systems which have various limits. Do not use special characters - I see that your hostname part is correct, however domain name might not be correct perhaps?

I used some other names such as all-letter or all-number,same error as the log I posted above.

2019-06-24T17:20:05 [I|app|4b683aca] Parameters: {“utf8”=>“✓”, “authenticity_token”=>“2oc5dQkHTyrk4ErPaGRO4NejgMY/lxP4Gan7recooCBo/FRqZ1L2wwfJcLAOmRc7tWkzsetexecH8WFomlevNg==”, “host”=>{“name”=>“adaba
ssali”, “organization_id”=>“3”, “location_id”=>“2”, “hostgroup_id”=>"", “compute_resource_id”=>"", “environment_id”=>"", “managed”=>“true”, “progress_report_id”=>"[FILTERED]", “type”=>“Host::Managed”, "
interfaces_attributes"=>{“0”=>{“type”=>“Nic::BMC”, “mac”=>“00:15:5d:38:01:02”, “identifier”=>“eth0”, “name”=>“adabassali”, “domain_id”=>“3”, “ip”=>“192.168.107.247”, “ip6”=>"", “managed”=>“0”, “primary”
=>“1”, “provision”=>“1”, “username”=>“root”, “password”=>"[FILTERED]", “provider”=>“SSH”}}, “architecture_id”=>“1”, “operatingsystem_id”=>“2”, “provision_method”=>“build”, “build”=>“0”, “medium_id”=>"",
“ptable_id”=>"", “pxe_loader”=>"", “disk”=>"", “root_pass”=>"[FILTERED]", “is_owned_by”=>“5-Users”, “enabled”=>“1”, “model_id”=>"", “comment”=>"", “overwrite”=>“false”}, “fakepassword”=>"[FILTERED]"}
2019-06-24T17:20:05 [I|app|4b683aca] Current user set to jfliu (regular)
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Nic::BMC: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Nic::BMC: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Nic::BMC: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Host::Managed: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”, “Name hostname can
contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Host::Managed: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”, “Name hostname can
contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [W|app|4b683aca] Not queueing Host::Managed: [“Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”, “Name hostname can
contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123”]
2019-06-24T17:20:06 [E|app|4b683aca] Failed to save: Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123, Name hostname can contain only lo
wercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123

This applies both to host name and interface DNS name. Check that, I suspect that you have some invalid character in your domain name.

I see, my domain name is “terminal_zone”. I change it to “terminal” and everything goes right.