hoardd icon indicating copy to clipboard operation
hoardd copied to clipboard

mysql script produces an error

Open styygeli opened this issue 10 years ago • 2 comments

This could be a problem of having too new mysql module but nevertheless.

For some reason hoard refuses to connect to the mysql server, but a simple test from the same box using the standard mysql client connects just fine.

├─┬ [email protected] │ └─┬ [email protected] │ ├── [email protected] │ └─┬ [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├── [email protected] └── [email protected]

ERROR: Error on STATUS query: Error: connect ECONNREFUSED

TypeError: Cannot read property 'length' of undefined at /opt/hoardd/scripts/mysql.coffee:125:38 at Query.query.on.on.fields.(anonymous function) (/opt/hoardd/node_modules/mysql/lib/client.js:95:9) at Query.EventEmitter.emit (events.js:95:17) at Client. (/opt/hoardd/node_modules/mysql/lib/client.js:349:16) at Socket.EventEmitter.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:415:13)

cat scripts/mysql.json

{ "host": "mybox.ce1wqenoyjn7.ap-northeast-1.rds.amazonaws.com", "user": "ouruser", "password": "ourpassword", "multiserver": 0 }

styygeli avatar Mar 20 '14 01:03 styygeli

A little bit additional info from strace:

reads the config just fine: [pid 4409] open("/opt/hoardd/scripts/mysql.json", O_RDONLY <unfinished ...>

but still tries to connect to localhost: [pid 4409] connect(11, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)

styygeli avatar Mar 20 '14 02:03 styygeli

bad bad debug values (needs to be conf.host).

      conn = Mysql.createClient({
      "host":      conf.localhost,
      "user":      conf.user,
      "password":  conf.password,
      "port": port
      })

Now to figure out how to do the multihost...

styygeli avatar Mar 20 '14 02:03 styygeli