11

I'm trying to add a custom domain name to my heroku app and I'm seemingly using the correct command to do this, at least according to heroku docs.

heroku domains:add domain.com -a heroku-app

But I'm getting the following error.

Error: Require params: sni_endpoint.
Error ID: invalid params

I was unable to find this error on google in relation to my case. I'd appreciate any assistance with this. Thanks!

mdlsvensson
  • 111
  • 1
  • 3

3 Answers3

4

SOLVED: I solved the problem updating the heroku cli from 7.59.o to 7.59.2.

In your terminal run: sudo npm update -g heroku

once updated, I run:

heroku domains:add www.YOURDOMAIN.com --app YOUR_HEROKU_APP_NAME

Example:

Domain www.myverygooddomain.com My Heroku app name: my-great-app Command: heroku domains:add www.myverygooddomain.com --app my-great-app

Magofoco
  • 5,098
  • 6
  • 35
  • 77
1

Their documentation and their error reporting is terrible.

Basically, as of Nov 1, 2021, you have to tack on the "--cert" parameter and provide the name of your cert (sni_endpoint).

So, first, manually look up your sni_endpoint(s) by running:

heroku domains --app your-app-name

This will provide of list of all of your current domains/subdomains and the sni_endpoint(s) for each of them.

Then, add your new subdomain with:

heroku domains:add yoursubdomain.yourdomain.com --app your-app-name --cert your_sni_endpoint_name
MikeToTheP
  • 11
  • 2
0

https://devcenter.heroku.com/changelog-items/1938

Beginning October 31, 2020, API requests to the Domain Create endpoint will accept an additional sni_endpoint parameter. This is a new attribute that can either be:

  • A reference to a valid SNI endpoint or,
  • null if the domain should not be associated with an SNI endpoint.

On November 1, 2021, the API will respond with 422 errors if no sni_endpoint parameter is provided.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • Thanks for responding. I saw this earlier but got no indication about what additional parameter should be added. And I was following guides on how to add domains, one of which was created only two weeks ago, and they included no additional parameters in their commands. So that's why I came here. I also looked at the help commands of the domans:add command in the cli and it too made no mention of this param. So I am still confused. Thanks for you help nevertheless. Good evening. – mdlsvensson Nov 02 '21 at 20:02
  • @mdlsvensson I'd try updating your Heroku CLI, or creating the domain via the website. – ceejayoz Nov 02 '21 at 20:02
  • I will try that. Thanks a lot! – mdlsvensson Nov 02 '21 at 20:03
  • Can you provide the full command Pls – vatsalay Nov 16 '21 at 03:29
  • 3
    I have been able to solve the "heroku domain:add, Error: require params: sni_endpoint. error ID: invalid_params". First of all update the heroku cli to the latest version of 7.59.2 using "heroku update" command. It is said that with the latest version of the cli, sni_endpoint params problem will be avoided. Then try the "heroku domains: add your-domain-name" command again. Make sure that you have your domain name and dns target configured correctly in heroku. Use the "heroku domains" command to be see that your domain name is correct in Heroky. The "host domain-name" did not work for me. – Djesu Nov 18 '21 at 20:57
  • how to provide eni_endpoint in cli command is there any default value or where to find sni info? – user269867 Dec 04 '21 at 00:39