Failed to register with host Confluence
Asked by Brenda Blanco:

Hi!

I am working on installing the example add-on :

<https://bitbucket.org/atlassianlabs/atlassian-connect-confluence-example>

I followed these instructions:

* Copy credentials.json.sample to credentials.json and fill in the blanks to enable auto registration of the add-on into your JIRA instance.
* npm install to install dependencies
* npm start to run the add-on

I could see the addon (macro) in my Confluence Cloud instance, but I am getting this error message:

D:\\devroot\\Atlassian-example\>npm start

\> confluence-connect-example@0.1.0 start D:\\devroot\\Atlassian-example  
\> node app.js

Watching atlassian-connect.json for changes  
Add-on server running at http://TYCVDINRS7801:3000  
Initialized sqlite3 storage adapter  
Local tunnel established at <https://84bbd884.ngrok.io/>  
Check <http://127.0.0.1:4040> for tunnel status  
Registering add-on...  
GET /atlassian-connect.json 200 17.365 ms - -  
Failed to register with host Confluence:5551410787  
Add-on installation timed out  
Add-on not registered; no compatible hosts detected  
Re-registering due to atlassian-connect.json change  
GET /atlassian-connect.json 200 5.954 ms - -  
Failed to register with host Confluence:5551410787  
Add-on installation timed out  
Add-on not registered; no compatible hosts detected

Any idea what am I doing wrong? I created the credentials.json file with my info:

```
{     "hosts" : {           "company.atlassian.net": {                "product": "confluence",                "username" : "myUser",                "password" : "*********"              }       }}
```

Why ACE is not register the addon successfully?

Thank you in advance


Answers:
author: Caterina Curti
body: A few more things that could help with the troubleshooting and resolution here. I'll keep adding more as I discover them

**Enable development mode**

One more thing to check is that the **Enable development mode** checkbox needs to be enabled.

This is explained here (<https://developer.atlassian.com/cloud/confluence/getting-set-up-with-ace/#enable-development-mode-in-your-site>) but I didn't enable it right away on the Confluence side, just the Jira one when I followed the tutorial the first time.

**Uninstall the app and restart it with npm start**
> With the app not running. Go into your Manage Apps Admin and see if it's listed. If it is uninstall it and then try running your app again.

More details on this here: <https://community.developer.atlassian.com/t/the-app-host-returned-http-response-code-404-when-we-tried-to-contact-it-during-installation/48367/6>

**The POST to /installed returns 404**

See the suggestions shared here: <https://community.developer.atlassian.com/t/development-v-s-production-atlassian-cloud-add-on/48886/10>

**Product site license is not valid**

Check the license of the product for the site. If the license is not valid (e.g. the subscription expired), the app will be installed and automatically removed.   
Sometimes it will also fail to install.


author: Jason Immerman
body: Another potential problem is that the port that should be used by the express server is already being used by something else, so the express server isn't actually listening on that port. Just try hitting the local port (for me, localhost:5000), to see if you get to your server as expected.

comments: author: Caterina Curti
body: Just a note to add that, when using the default ACE settings, the port is the \`3000\` one so the URL to check is http://localhost:3000/.


author: Thomas Hery
body: Had exactly the same issue and this solved it:

In atlasssian-connect.json **replace this :**

      "lifecycle": {        "installed": "/installed"    },

**for this:**

     "lifecycle": {        "installed": "installed"    },

Source:

<https://stackoverflow.com/a/60507647/15033600>


author: Sophia Chen
body: Hi,

I am trying to install and use ACE but I keep getting the following:

```
Registering add-on...
Failed to register with host https://<username>:<token>@<my-company>.atlassian.net/wiki (401)
Add-on not registered; no compatible hosts detected
```

I have even tried using my password directly and I still get the same error. It fails to register then fails to authenticate because a proper JWT token is never created.

Anyone have any ideas? I've run out of Google links and forum links to try.

comments: author: Sophia Chen
body: Things to note, my CURL requests work perfectly fine with my user and token


author: Jerry Laster _Divim_ Inc__
body: Hi

Did you solve your problem? My test instance, which was working fine, stopped working today.

Jerry


author: Mo
body: I'm having the same issue


author: Chris Beswick
body: If anyone still has this problem I solved this by having in your credentials.json file include the full url of your domain like so - this wasn't immediately clear to me.  

```
{
  "hosts" : {
    "https://<your-domain>.atlassian.net": {
      "product" : "confluence",
      "username" : "<user>",
      "password" : "<APItoken>"
    }
  }
}
```

<br />

<br />


author: Michael Dugah
body: I have faced this same issue.

Make sure you have enabled development mode in Confluence


author: Lava Kumar Dukanam _Appfire_
body: Hello there,

I was able to solve this by adding this configuration to **credentials.json**

<br />

{  
"hosts" : {  
"\<domain-name\>.atlassian.net/wiki": {  
"username" : "admin",  
"password" : "\*\*atlassian-password\*\*" }  
}  
}

Let me know if this is still a problem.

Hope this helps someone!

Thanks,

Lava


author: Kin
body: It suddenly happened to me at some point. It kinda fails at random point...

<br />

What I did in order to solve these issues is to manually uninstall previously installed connect-app on my confluence cloud dev at ie.:  
https://\<your_installation\>.atlassian.net/wiki/plugins/servlet/upm?source=side_nav_manage_addons

Then after that I ran "npm start", error is gone and connect-app is installed.  

Another option is to wait out the yellow error messages and eventually it is installed according to the logger in console.


author: Jorge Colon
body: Make sure to create an API Token for your Atlassian user and use that value as the password in your credentials.json file. Also make sure to delete the sqlite file so that it creates a fresh one and doesn't try to authenticate with an old JWT.


author: Nicol?s Wernli
body: Any updates within this gusy? I'm having same problem here.


author: Sam Hall
body: Atlassian Cloud services are having many outages today, particularly related to logins, so this might be the cause.

Check:

<https://atlassian.statuspage.io>

and the current incident:

<https://atlassian.statuspage.io/incidents/kz9n65qlcljd>

I'd recommend subscribing to updates about the incident, and waiting until the issues are resolved before then trying again.

comments: author: Brenda Blanco
body: Thank you Sam! I will try later!


author: Brenda Blanco
body: Hi Sam

I think the login issues were not related to this problem, I have it already.


author: Rushwell Dzvetero
body: Hi Brenda, im having the same issue, how were you able to resolve it?


Tags: developer