Getting Started step 3.2 npm start fails

npm-api-token

#1

Hi all,
I am trying to get into Confluence Cloud plugin development. Found this fairly new documentation:
https://developer.atlassian.com/cloud/confluence/getting-started/

I did all the steps, registered a dev cloud site, enabled plugin development mode there, created an API token, cloned the repo and ran npm install. All good.

I made the changes to the credentials.json file and then I ran: npm start
Getting this error

Failed to register with host https://john%40doe.com:12345abcdefghijklmn@johndoe.atlassian.net (200)
{"type":"INSTALL","pingAfter":300,"status":{"done":true,"statusCode":200,"contentType":"application/vnd.atl.plugins.task.install.err+json","subCode":"upm.pluginInstall.error.descriptor.not.from.marketplace","source":"https://2a743b4c.ngrok.io/atlassian-connect.json","name":"https://2a743b4c.ngrok.io/atlassian-connect.json"},"links":{"self":"/rest/plugins/1.0/pending/f81f9f93-6d56-45fb-8198-d34d093dd9f7","alternate":"/rest/plugins/1.0/tasks/f81f9f93-6d56-45fb-8198-d34d093dd9f7"},"timestamp":1548350150017,"userKey":"admin","id":"f81f9f93-6d56-45fb-8198-d34d093dd9f7"}
Add-on not registered; no compatible hosts detected

What am I missing?

Best regards
George


#2

Hello @george,

If you use confluence as the value for product in credentials.json, the URL above should have a trailing /wiki. Did you just remove it when you posted it here? Can you share the contents of your credentials.json? When you do, kindly remove the password part :slight_smile:

Thanks,
Ian


#3

Thanks @iragudo,

that was definitley getting me further. The Getting started guide says to put “your-domain” in the credentials file and forgot to mention to add the /wiki part when it is about Confluence.

My credentials.json file now is:

{
   "hosts" : {
       "johndoe-dev.atlassian.net/wiki": {
           "product" : "Confluence",
           "username" : "john@doe.com",
           "password" : "12345abc..."
       }
   }
}

npm.start now gives me this:

> helloworld-addon@0.0.1 start d:\Dev\Confluence Plugins\confluence-helloworld-addon
> node app.js

Watching atlassian-connect.json for changes
Initialized memory storage adapter
Add-on server running at http://localhost:3000
Local tunnel established at https://32fd7f99.ngrok.io/
Check http://127.0.0.1:4040 for tunnel status
Registering add-on...
Failed to register with host https://john%40doe.com:12345abc...@johndoe-dev.atlassian.net/wiki/wiki (200)
Add-on not registered; no compatible hosts detected

I noticed that now the /wiki appears twice in the output error message.

Best regards
George


#4

Apologies for the confusion, @george. What I meant before was, if you are using confluence as the product in credentials.json, a trailing /wiki will be automatically added to your provided host URL; since it does not have a trailing wiki in the error message mentioned in the first comment, my concern is you might have been using a different product.

In your provided credentials.json, since you are using confluence as the product, kindly remove the trailing /wiki in the host URL as it will be automatically added by the framework.

Cheers,
Ian


#5

Thanks, iragudo. That solved the problem.