JIRA Cloud addon can't start on CentOS platform

We are constructing a CentOS 6.5 (amd64) platform as our App Server, and moving App Server from Win7 platform to CentOS platform; however, during this process, we run into some issues which never occurred on Win7 platform as follows.

On CentOS platform, I firstly install a global ngrok with ‘npm install ngrok -g’ command, and check it:


$ ngrok -v
$ ngrok version 2.2.8


This ‘ngrok http’ command can establish a local tunnel for HTTP.

On our addon folder, I run ‘npm install’ and then ‘npm start’ command, but the latter hangs forever after ‘Initialized sqlite3 storage adapter’:


$ pwd
/jira/gadget
$ npm start

com.hitachiconsulting.gadget@0.0.1 start /jira/gadget
node app.js

Watching atlassian-connect.json for changes
Add-on server running at http://CDC-Jira-Cloud-01:3000
Initialized sqlite3 storage adapter


ngrok can not establish a local tunnel as expected.

I also find that ‘npm install’ installs a local ngrok on our addon subfolder–node_modules:


$ pwd
/jira/gadget
$ npm install --unsafe-perm

ngrok - downloading binary https://bin.equinox.io/a/b87faFPKrii/ngrok-2.1.1-linux-amd64.tar.gz
ngrok - binary downloaded…
ngrok - binary unpacked.
added 494 packages in 33.291s
$


But this lcoal ngrok does not work as follows:


$ pwd
/jira/gadget/node_modules/ngrok
$ ./bin/ngrok -v
Segmentation fault
$


Would anyone like to give us helps?

Any helps would be appreciated.

Thanks.

@xjiang - I would try downloading directly from ngrok’s website. https://ngrok.com/download . Try their latest stable build.

I am using the latest stable build: 2.28

if I only run ngrok, it is OK:

# ngrok http 8080
ngrok by @inconshreveable                                                                                                                                                                      (Ctrl+C to quit)

Session Status                online
Session Expires               7 hours, 59 minutes
Version                       2.2.8
Region                        United States (us)
Web Interface                 http://127.0.0.1:4041
Forwarding                    http://1d5db5c9.ngrok.io -> localhost:8080
Forwarding                    https://1d5db5c9.ngrok.io -> localhost:8080

Connections                   ttl     opn     rt1     rt5     p50     p90
                                   0       0       0.00    0.00    0.00    0.00

But if I run ‘npm start’ command on my gadget folder:

# pwd
/jira/gadget
# npm start

> com.hitachiconsulting.gadget@0.0.1 start /jira/gadget
> node app.js

Watching atlassian-connect.json for changes
Add-on server running at http://CDC-Jira-Cloud-01:3000
addon.register
Initialized sqlite3 storage adapter

It hangs here, and I find out ngrok is failed with the following error:

'panic: runtime error: invalid memory address or nil pointer dereference\n\ngithub.com/inconshreveable/olive/recover.go:40\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\n<autogenerated>:30\n<autogenerated>:132\ngithub.com/inconshreveable/olive/recover.go:29\nruntime/asm_amd64.s:514\nruntime/panic.go:489\ngithub.com/inconshreveable/olive/error.go:37\nruntime/asm_amd64.s:514\nruntime/panic.go:489\nruntime/panic.go:63\nruntime/signal_unix.go:290\nlib/tunnel/client/reconnecting.go:39\nlib/tunnel/client/session.go:97\nngrok/tunnel_session.go:138\nngrok/web_api.go:97\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\n<autogenerated>:30\ngithub.com/go-martini/martini/router.go:373\ngithub.com/go-martini/martini/router.go:367\ngithub.com/inconshreveable/olive/error.go:41\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\n<autogenerated>:30\ngithub.com/go-martini/martini/router.go:373\ngithub.com/go-martini/martini/router.go:367\ngithub.com/inconshreveable/olive/recover.go:32\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\n<autogenerated>:30\ngithub.com/go-martini/martini/router.go:373\ngithub.com/go-martini/martini/router.go:367\ngithub.com/inconshreveable/olive/logger.go:17\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\n<autogenerated>:30\ngithub.com/go-martini/martini/router.go:373\ngithub.com/go-martini/martini/router.go:250\ngithub.com/go-martini/martini/router.go:120\nngrok/src/ngrok/web.go:27\nruntime/asm_amd64.s:515\nreflect/value.go:434\nreflect/value.go:302\ngithub.com/codegangsta/inject/inject.go:102\ngithub.com/go-martini/martini/martini.go:173\ngithub.com/go-martini/martini/martini.go:69\n' }

My CentOS is:

# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:        6.5
Codename:       Final
#

On Win7 platform, I am also using ngrok 2.2.8, and it works very well

So I don’t what’s going on, any helps or suggestion?

@xjiang - when you ran ngrok standalone, was it from the binary on Ngrok’s website, or was it from your node_modules/ directory?

I’m guessing it was the standalone, based on your first post (where you’re segfaulting on the node_modules binary). And therefore, this is expected, because when your Node app is calling ngrok, it’s using the binary from the ./node_modules directory.

Just for grins, can you just put the working ngrok executable binary (the one that works) into ./node_modules/ngrok/bin/ (overwrite the one that is segfaulting) and see if you can run npm start without it bailing?