heroku / heroku-connect-plugin

CLI plugin for Heroku Connect (experimental)
Apache License 2.0
23 stars 8 forks source link

Db-set command not working #106

Closed Isa14 closed 4 years ago

Isa14 commented 4 years ago

Hi, I'm currently using your plugin and it is very useful! :) but when I try to use db-set command I always get an error before trying to set the database.

Screen Shot 2020-02-10 at 13 31 40

However, I could do it through the endpoint using directly curl.

It seems to me that the problem is on this method fetchKeys and maybe the error was introduced when doing this change on the db-set.js file but I'm not completely sure.

Screen Shot 2020-02-10 at 13 34 58

I wanted to let you know about it. Thanks in advance!

lambacck commented 4 years ago

@Isa14 are you able to set the db from the Heroku Connect Dashboard?

lambacck commented 4 years ago

@Isa14 I recommend you open a support ticket because we'll be able to better diagnose the issue from there.

Isa14 commented 4 years ago

Hi @lambacck Thank you for your answer! Yes, I'm able to set the db from the Heroku Connect Dashboard and also using curl like it is described here https://devcenter.heroku.com/articles/heroku-connect-api#step-4-configure-the-database-key-and-schema-for-the-connection

Ok, I don't know if that will help but I will open a support ticket telling them about this plugin.

CalgaryMichael commented 4 years ago

I am having the same issue with this function. I ran the same API endpoint that this information is being built from and I saw that there is one entry in the db_keys array that has a null value for addon (which is expected from the error message). In my situation, this entry was the database endpoint created as part of our Amazon VPC tunnel.

It seems that this could be fixed by including something informational in the name value if there is no addon variable. Such as:

name: `${key.name} (${key.addon ? key.addon.plan : 'No plan specified')})
sigmavirus24 commented 4 years ago

@CalgaryMichael Except that the only supported configuration for Heroku Connect is Heroku PostgreSQL

CalgaryMichael commented 4 years ago

@sigmavirus24 this documentation page outlines the set up for Amazon VPC tunneling. You can see here that it adds a config variable to the Heroku app. This shows up in the db_keys section:

{
  ...
  "db_keys": [
    {
      "name": "DATABASE_ENDPOINT_<ENDPOINT_ID>_URL",
      "addon": null
    },
    ...
  ]
}

This is what is tripping this error.

sigmavirus24 commented 4 years ago

Ah, I see