Failed to Register when attempting Confluence Cloud Hello World

Hello World,

I am having trouble when I follow the instructions for Getting Started, with Confluence Cloud Development. It used to be very easy to build a simple Macro in Confluence. The community post rules prevent me from putting URI’s in my posting, so the domain and some of the error messages are gone. But I can post them individually if you need them. Here are my details.
I hope someone can help me out.

I followed all the instructions and I think node.js is ok. git clone is good. npm install is good, no errors.

My credentials.json contains:

{
   "hosts" : {
      "<domain>": {
         "product" : "confluence",
         "username" : "<Confluence UID>",
         "password" : "<My Token>"
      }
   }
}

I get the following error with npm start:

Failed to register with host <domain>/wiki
Error: Invalid URI "..."
Error: Invalid URI "..."

I have tested navigating to /wiki and that lands me in my domain.

HELP!!

Hi,

credentials.json looks like

{
    "hosts" : {
        "<site-url>": {
            "product" : "confluence",
            "username" : "<email@address.com>",
            "password" : "<api-token>"
        }
    }
}

Have you made sure <site-url> is in format your-site.atlassian.net?

My file contents, API token removed:

{
   "hosts" : {
      "sebdevsite.atlassian.net": {
         "product" : "confluence",
         "username" : "steven.bierenbaum@duckcreek.com",
         "password" : "<token>"
      }
   }
}

Update:

Found this recent post.

I have the same issue in my error message. There are three “/” in my domain URL. I must assume we have the same issue.

1 Like

More:
I decided to skip the Getting Started and move to Lesson 1 as maybe there is an issue with it. I installed atlas-connect, ngrok and sqlite. They went fine. I had run the npm install for the awesome-app directory. I got the same errors when running npm start. Here are the errors below:
Failed to register with host https:///sebdevsite.atlassian.net/wiki
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
at Request.init (C:\Users\steven.bierenbaum\awesome-app\node_modules\request\request.js:273:31)

Help!

I was able to replicate this issue. Let me discuss this with our team and will be back to you soon.

@SteveB @aagrawal2 - this looks like it might be a Windows-related issue. This worked for me out of the box on Mac. Lets see if someone here has a Windows setup that we can try/debug this on.

Hi @nmansilla and @aagrawal2 : I’m on Linux and experiencing this issue.

Thank you. Great to know you are on the case. Holding tight to hear from you.

I am guessing this is a tool version mixed with Windows 10. The versions of the tools looks very different than the tutorial example. Here is my version set:

All,

I hate to say this but I have been four days trying to get a solution to what should be a very simple issue. I am going to have to find a different product other than confluence. This is the most basic part of creating dynamic content.

Someone please give me an update?

I’m having the exact same problem in Windows 10, node v12.13.0 npm 6.12.0

Curl seems to be returning a response that indicates no problems, but npm start results in the same chicanery others have described here.

Worthy of noting my curl results all look great, except this happens:

User-Agent: curl/7.65.3

Accept: /

{ [5 bytes data]

  • Connection state changed (MAX_CONCURRENT_STREAMS == 200)!
    } [5 bytes data]
    < HTTP/2 302

A manual patch fix / path for you would be this:

  1. Run ngrok manually (i.e. ngrok http 3000), and copy that Forwarding URL (i.e. https://x1111.ngrok.io)
  2. Edit your atlassian-connect.json file, and replace {{localBaseUrl}} with the Forwarding URL above.
  3. Run your app with node app.js

This will run the app on localhost:3000, and then ngrok will be porting that to the public internet. You can go to https://x1111.ngrok.io/atlassian-connect.json and you should see your descriptor. Can you try that?

If you’re successful at that, then the next step would go to Confluence, and go to Settings > Manage Apps > Upload app – and this is where you’ll paste that descriptor URL.

BTW, the manual patch directions above are to workaround that weird URL issue you’re encountering.

I gave this a whirl but still wasn’t able to get it working unfortunately . Bad gateway 502 error when I try to run NGROK like that.

I’ll try from my windows box at home, and try again with my Linux box and see how it works out.

Alright… damn it. Found the issue. The urijs library was updated on npm the other day, and there’s something funky in there that’s adding the extra slash. Haven’t had time to debug that yet.

So, forget that last post I made, and just add this to your package.json file as the last line in dependencies object:

"urijs": "1.19.1"

Then run:
npm install

And finally:
npm start

1 Like

Filed an issue on the URI.js (urijs) project:

For now, I’m going to ask someone from the team to put a static version number for this dependency until it’s fixed. Sorry you had all of those problems @TorfinnOlsen and @SteveB. :frowning:

1 Like

I’m sorry, but I am still having the issue.

Here’s my package.json:

{
  "name": "helloworld-app",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "atlassian-connect-express": "^3.0.2",
    "body-parser": "^1.14.2",
    "compression": "^1.6.0",
    "cookie-parser": "^1.4.0",
    "errorhandler": "^1.4.2",
    "express": "^4.13.3",
    "express-hbs": "*",
    "morgan": "^1.6.1",
    "sequelize": "^4.38.0",
    "static-expiry": ">=0.0.5",
    "jugglingdb-sqlite3": "0.0.5",
    "async": "2.0.1",
    "urijs": "1.19.1"
  }
}

npm install:
"
npm install
audited 1684 packages in 2.521s
found 2 high severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
"
then nmp start ends with this:
"
Local tunnel established at https://72d46d43.ngrok.io/
Check http://127.0.0.1:4040 for tunnel status
Registering add-on…
Failed to register with host https:///sebdevsite.atlassian.net/wiki
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
"

Can you try deleting the node_modules folder and then rerunning npm install? This will ensure it’s pulling the version requested.

Still there. Same error:
Local tunnel established at https://ec09fbfe.ngrok.io/
Check http://127.0.0.1:4040 for tunnel status
Registering add-on…
Failed to register with host https:///sebdevsite.atlassian.net/wiki
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
Error: Invalid URI “https:///sebdevsite.atlassian.net/wiki/rest/plugins/1.0/”
.
.
.
at flush (C:\users\steven.bierenbaum\confluence-helloworld-addon\node_modules\rsvp\dist\rsvp.js:2441:7)
at process._tickCallback (internal/process/next_tick.js:61:11)
Add-on not registered; no compatible hosts detected