confluence-helloworld-addon - Failed to Establish Local Tunnel
Asked by Tim Brown:

I am trying to run the Confluence-helloworld-addon as per the guide :<https://developer.atlassian.com/cloud/confluence/getting-started/>  

However when I run the the app I get the following output/error:  

$ npm start

\> helloworld-addon@0.0.1 start C:\\devwork\\MCC_Demo_App  
\> node app.js

Watching atlassian-connect.json for changes  
Initialized memory storage adapter  
Add-on server running at http://Skywalker:3000  
Failed to establish local tunnel  
err = Error: ngrok is not yet ready to start tunnels  
Error: ngrok is not yet ready to start tunnels  
Error: ngrok is not yet ready to start tunnels  
at Request._callback (C:\\devwork\\MCC_Demo_App\\node_modules\\atlassian-connect-express\\node_modules\\ngrok\\index.js:192:30)  
at Request.self.callback (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:185:22)  
at emitTwo (events.js:87:13)  
at Request.emit (events.js:172:7)  
at Request.\<anonymous\> (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:1161:10)  
at emitOne (events.js:77:13)  
at Request.emit (events.js:169:7)  
at IncomingMessage.\<anonymous\> (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:1083:12)  
at IncomingMessage.g (events.js:260:16)  
at emitNone (events.js:72:20)  
at IncomingMessage.emit (events.js:166:7)  
at endReadableNT (_stream_readable.js:921:12)  
at nextTickCallbackWith2Args (node.js:442:9)  
at process._tickCallback (node.js:356:17)  
Unhandled error: Error: ngrok is not yet ready to start tunnels  
at Request._callback (C:\\devwork\\MCC_Demo_App\\node_modules\\atlassian-connect-express\\node_modules\\ngrok\\index.js:192:30)  
at Request.self.callback (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:185:22)  
at emitTwo (events.js:87:13)  
at Request.emit (events.js:172:7)  
at Request.\<anonymous\> (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:1161:10)  
at emitOne (events.js:77:13)  
at Request.emit (events.js:169:7)  
at IncomingMessage.\<anonymous\> (C:\\devwork\\MCC_Demo_App\\node_modules\\request\\request.js:1083:12)  
at IncomingMessage.g (events.js:260:16)  
at emitNone (events.js:72:20)  
at IncomingMessage.emit (events.js:166:7)  
at endReadableNT (_stream_readable.js:921:12)  
at nextTickCallbackWith2Args (node.js:442:9)  
at process._tickCallback (node.js:356:17)

I have checked the adddon server and it is running.  

I am using Node.js 4.50 as per the doco.

Any help would be appreciated.


Answers:
author: Anne Calantog
body: Hello everyone, a fix <https://ecosystem.atlassian.net/browse/ACEJS-139> has been published. Cheers

comments: author: Tim Brown
body: Hi Anne - I am unable to access that link - I just get taken to a portal page.  

I cannot access any of the links provided by Dario either.


author: Pim Janissen
body: Hi [@Anne Calantog](/t5/user/viewprofilepage/user-id/1130311)

Thank you. I was able to access that link. Great to see it was fixed. I will test it later today.

[@Dario B](/t5/user/viewprofilepage/user-id/502402) I still get the no permission error.


author: Tim Brown
body: Hi Anne, just checked and its still broken.


author: Adriaan Knapen
body: Make sure to bump the versions of your dependency, as the fix got pushed in ACE 3.5.0, e.g. like this:

```
"atlassian-connect-express": "^3.5.0",
```

It also uses ngrok 3 as a development dependency.

```
"ngrok": "^3.2.3",
```


author: Pim Janissen
body: Works for me now. Thank you.


author: Tim Brown
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) I couldn't get it to work - what did you do?  
I am a Node newbie so please be gentle :)


author: Pim Janissen
body: Using nodejs version 10.16.0  

package.json -\>

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

1. Open CMD and go to the root folder of the project (with the package.json in it)  
2. npm install  
3. npm start  

This did the trick.


author: Anne Calantog
body: Awesome! Thanks for confirming on your end. Cheers!


author: Tim Brown
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) did you get the hello world macro to appear? I get the tunnel and what looks like a successful install of the macro but it does not show up in the macros.


author: Pim Janissen
body: When i create a new confluence document in my dev environment and type '/hello' the macro pops up as a suggestion.

See below:

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/61436i911DBCEF95F8B831/image-size/large?v=v2&px=999 "Capture.PNG")


author: Dario B
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) I am happy to know that this is now working for you! :)

However, since I added you again to the ticket and I can see you in the list of the participants, can you kindly confirm you can now open:

* <https://ecosystem.atlassian.net/servicedesk/customer/portal/14/DEVHELP-3179>

For the rest:

[@Tim_Brown](/t5/user/viewprofilepage/user-id/396243) is this now working for you? In case it is, can you please accept the answer in order to mark this thread as 'solved'? (provide more details on what is failing otherwise)

Cheers,  
Dario


author: Pim Janissen
body: [@Dario B](/t5/user/viewprofilepage/user-id/502402) That did the trick, I can now see the ticket you opened.


author: Addono
body: Ran into the same issue, basically ngrok 2 is broken right now, as the server sided API was extended in a non-backwards compatible manner.

Find a little bit more elaborate answer here:

<https://community.developer.atlassian.com/t/error-ngrok-is-not-yet-ready-to-start-tunnels/30570/2?u=addono>


author: Pim Janissen
body: \<deleted\>


author: Dario B
body: Hi [@Tim_Brown](/t5/user/viewprofilepage/user-id/396243),

If my understanding is correct, you are trying to follow the steps in <https://developer.atlassian.com/cloud/confluence/getting-started/> and you are getting stuck since you cannot start the server.

If this is correct, then looking at the provided logs I can see that the problem here is that ngrok is not managing to create a tunnel to make the add-on server running on your local machine available over the Internet:
> Failed to establish local tunnel  
> err = Error: ngrok is not yet ready to start tunnels

Now, I might not be the best person to answer this question, but I can see that the syntax of the example showing how to create the **credentials.json file**is wrong, it is not a valid JSON and this could be causing the issue you are facing.

Indeed, the example in that page shows:

````
 ``` json {  "hosts" : {   "": {    "product" : "confluence",    "username" : "<user@example.com>",    "password" : ""   }  } } ```
````

While, in order to be a valid JSON file it should be:

```
 {  "hosts" : {   "": {    "product" : "confluence",    "username" : "<user@example.com>",    "password" : ""   }  } }
```

Can you kindly check if your **credentials.json**file looks like the latter one and not like the one above (that is indeed wrong)?

Also, in case this is not helping, please notice that this is not the best place to get support on development related questions. As you can find in [https://developer.atlassian.com/resources/,](https://developer.atlassian.com/resources/) in order to get support on developers related questions you can either:

* Ask the Developers Community: <https://community.developer.atlassian.com/>
* Open a request in the Developers Service Desk: <https://ecosystem.atlassian.net/servicedesk/customer/portal/14>

Please let us know if this helps.

Cheers,  
Dario

comments: author: Tim Brown
body: Thanks Dario,

I had already figured that the JSON was invalid and updated as per your suggestion.  

I have been debugging the problem at have tracked it down to ngrok thinking there are multiple sessions open, which when looking at the status page at localhost:4040 it shows just two. I am guessing that there has been an update to ngrok that has broken this demo.  

It would be good if Atlassion had a tool that maybe did some automated build and tests of their examples ;P

Thanks,

Tim.


author: Dario B
body: Thanks for your feedback [@Tim_Brown](/t5/user/viewprofilepage/user-id/396243) ,

I have reproduced the issue and I have created the below development bug report in order to have the example (and the related documentation page) fixed:

* [\[DEVHELP-3179\] Issue with the Confluence Cloud 'getting started' example: it does not start due to ngrok error and typos in doc](https://ecosystem.atlassian.net/browse/DEVHELP-3179)

Please watch above bug ticket in order to be updated on its status.

Have a nice day.

Dario


author: Pim Janissen
body: Hi Dario,  

I've encountered the same issue. However, your link to the issue seems to be broken. I can't open the issue you shared. Also I can't find a project with key DEVHELP.

Kind regards,

Pim


author: Dario B
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) are you logged in or trying to access as anonymous user?

I might have also shared the wrong link. Can you try to access below link instead and let me know if that works?

<https://ecosystem.atlassian.net/servicedesk/customer/portal/14/DEVHELP-3179>


author: Pim Janissen
body: [@Dario B](/t5/user/viewprofilepage/user-id/502402) I am logged in. And I can see a lot of projects, but not that one.  

Is there somewhere I need to sign up before I can join?


author: Dario B
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) you were faster than me :)

As I have added to my comment above, can you try to access <https://ecosystem.atlassian.net/servicedesk/customer/portal/14/DEVHELP-3179> and let me know if that works?

Thanks,  
Dario


author: Pim Janissen
body: [@Dario B](/t5/user/viewprofilepage/user-id/502402) I am very eager to be updated on the bugfix ;)  

That link also does not work for me.

EDIT: to be more specific

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/61329iB9D7B957B90BC619/image-size/large?v=v2&px=999 "Capture.PNG")


author: Dario B
body: [@Pim Janissen](/t5/user/viewprofilepage/user-id/2885389) I have just shared the issue with you (and the other people in this thread) so that you should be able to access it.

Please confirm you can now access the bug ticket.


Tags: atl-dev

cloud

confluence-cloud

confluence-development

development