maddox / harmony-api

🗼 A simple server allowing you to query/control multiple local Harmony Home Hubs over HTTP or MQTT
MIT License
394 stars 115 forks source link

docker run fails #18

Closed finish06 closed 8 years ago

finish06 commented 8 years ago

After building docker image from Dockerfile, it fails to run. Receive the following output...

npm info it worked if it ends with ok
npm info using npm@2.15.9
npm info using node@v4.5.0
npm info prestart harmony-api@1.1.0
npm info start harmony-api@1.1.0

> harmony-api@1.1.0 start /usr/src/app
> node app.js

/usr/src/app/node_modules/mqtt/lib/connect/index.js:62
    opts.protocol = opts.protocol.replace(/\:$/, '');
                                 ^

TypeError: Cannot read property 'replace' of null
    at Object.connect (/usr/src/app/node_modules/mqtt/lib/connect/index.js:62:34)
    at Object.<anonymous> (/usr/src/app/app.js:27:10)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

npm info harmony-api@1.1.0 Failed to exec start script
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! harmony-api@1.1.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the harmony-api@1.1.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the harmony-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs harmony-api
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls harmony-api
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log

Unsure how to progress forward. Recently built this about 30 days ago without any issues.

maddox commented 8 years ago

Can you post your config? It looks like your MQTT broker url might be at issue here.

finish06 commented 8 years ago
{
  "mqtt_host": "127.0.0.1",
  "hub_ip": "192.168.1.219",
  "topic_namespace": "harmony.living_room"
}
maddox commented 8 years ago

huh, it looks like maybe you need to specify mqtt:// in the host. try that and see what happens.

finish06 commented 8 years ago

"http://" did the trick! Thank you maddox for the assistance.

maddox commented 8 years ago

Great. I need to either change the default config, or just append mqtt:// in the code.