1

last week I created a Node server with MySQL. Everything went fine. I was using the configvars to connect and made the whole mobile app with the endpoints.

Suddenly, today, Heroku decided to close the connection to MySQL database (ClearDB) and throw status 503 and Connection lost.

const mysql = require('mysql');

const db = mysql.createPool({
    connectionLimit : 120, 
    host     : 'hostFromHeroku.cleardb.net',
    user     : 'user',
    password : 'password',
    database : 'databaseName',
    debug    :  false
});

db.getConnection((err,connection)=> {
    if(err)
    throw err;  //THIS LINE THORS THE ERROR
    console.log('Database connected successfully');
    connection.release();
  });

module.exports = db;

This is the HEroku console

enter image description here

I tried to connect dozens of times again and again... Dont know whats wrong.

I checked the clearDB portal and noticed that on the portal the connection dissapeared. Tried also to connect with MySQL workbench but the connection still cannot be established...

enter image description here

In the figure above there are still no connections... Checked the credentials few dozens of times.... Any ideeas? If anyone wants more pieces of code please let me know

Thanks, Daniel

daniel sas
  • 257
  • 2
  • 9

2 Answers2

1

I am currently having the same issue with ClearDB + heroku using Python/Django and it started today as well.

I do believe this is an issue with ClearDB or perhaps Heroku and not on your/our application side. See if you can connect to the database using some client like MySQlWorkbench for example. It probably won't work either.

I opened a ticket with both heroku and clearDB. I suggest you do the same. They must have messed up something

Rafael Santos
  • 293
  • 3
  • 18
  • Yes. I tried to connect with MySQL Workbench. same. is not working – daniel sas May 17 '22 at 14:04
  • our entire services have been down for almost 6 hours now. There's literally nothing we can do until they check the ticket. The downside of using heroku I guess – Rafael Santos May 17 '22 at 14:07
  • Im thinking I done something wrong. I think I should have close the connection pool or destroy it... This is my first server deployment... :( – daniel sas May 17 '22 at 14:27
  • but it was working before right? It would be a huge coincidence that we both did the same mistake (Im also using connection pooling) that affected us exactly in the same day. My system has been live and working fine for over an year now. I'll keep you posted if/when they reply my ticket – Rafael Santos May 17 '22 at 14:38
  • Yes. was working just fine.. Cannot make any update in production right now :( Yes. please keep me update. Thank you verry much :) – daniel sas May 17 '22 at 16:02
0

ClearDB is currently experiencing some issues.

Having the same issue over here that I'm unable to connect to my database using TablePlus/Sequel with the following error message:

Lost connection to MySQL server at 'reading initial communication packet', system error: 0

And the Status/Dashboard indicates that the database is up and running.

Created an support ticket and got the following response:

Team is still working on the issue. We will update you once we have next update.

Support response from 5/17/2022 08:36PM

Our support team continues to work on the issue on priority. they have identified some issues with the shared MYSQL DB and AWS volumes. The team is trying to fix the db node and resync the data which may take some time. We will keep you updated with the service restoration progress.

After 30h of downtime my database is back online again

Lutz Grätz
  • 121
  • 2
  • 6