Here is error message that I got!
2014-03-13T08:30:21.010764+00:00 heroku[web.1]: Starting process with command `node dbserver.js`
2014-03-13T08:30:22.485293+00:00 app[web.1]: listening on 14218
2014-03-13T08:30:22.486771+00:00 app[web.1]: lo 127.0.0.1
2014-03-13T08:30:22.551389+00:00 app[web.1]:
2014-03-13T08:30:22.554354+00:00 app[web.1]: at Protocol.end (/app/node_modules/mysql/lib/protocol/Protocol.js:78:13)
2014-03-13T08:30:22.554354+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:78:28)
2014-03-13T08:30:22.554354+00:00 app[web.1]: Error: Connection lost: The server closed the connection.
2014-03-13T08:30:22.554354+00:00 app[web.1]: at Socket.EventEmitter.emit (events.js:117:20)
2014-03-13T08:30:22.554354+00:00 app[web.1]: at _stream_readable.js:920:16
2014-03-13T08:30:22.554354+00:00 app[web.1]: at process._tickCallback (node.js:415:13)
2014-03-13T08:30:24.327286+00:00 heroku[web.1]: Process exited with status 8
When I test this locally (with foreman or without), and it works! I have added my IP address in Authorized Networks for Google Cloud SQL, and as well as my applications's IP address.
I have used http://www.hcidata.info/host2ip.cgi to find out my web app's IP address.
Can anyone had same experience?
Your problem may be similar to the one in this question:
Your problem may be that Cloud SQL is not allowing your Dyno's IP address. Because the Heroku dyno grid is dynamic in nature, the IP address that a given dyno will be assigned over time will be both dynamic and unpredictable.
As mentioned in the other question, you can use a proxy Heroku add-on that would give you a static IP.
A workaround can be to whitelist 0.0.0.0/0 (all possible IP addresses) within your Cloud SQL instance. If you do so, I highly recommend requiring SSL for your database connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With