Can't connect to database
jimenagl
PROOP

a year ago

My MySQL database has been up and running for 3months but now it wont connect, it gets stuck on database connection

Solved

19 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


chandrika
EMPLOYEE

a year ago

Hi there, I'm able to view the database connection resolving for me.

You should still be able to access all your data through your application — just want to make sure you aren't having any issues on that front and the data tab not loading maybe purely a cosmetic / UI delay


Status changed to Awaiting User Response Railway 11 months ago


jimenagl
PROOP

a year ago

I thought I resolved it with restarting the container but this has been happening in the database logs the whole weekend and I hadn’t have a problem like this the whole 3 months the database has been active. And when this happens the frontend or backend can’t connect to the database


Status changed to Awaiting Railway Response Railway 11 months ago


jimenagl
PROOP

a year ago

0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

FILE I/O

----------------------------

--------

I/O thread 0 state: waiting for i/o request (insert buffer thread)

END OF INNODB MONITOR OUTPUT

I/O thread 1 state: waiting for i/o request (read thread)

============================

Pages made young 0, not young 0

I/O thread 2 state: waiting for i/o request (read thread)

0.00 youngs/s, 0.00 non-youngs/s

I/O thread 3 state: waiting for i/o request (read thread)

LOG

---

I/O thread 4 state: waiting for i/o request (read thread)

Log sequence number 579412840

discarded operations:

I/O thread 5 state: waiting for i/o request (read thread)

I/O thread 6 state: waiting for i/o request (read thread)

I/O thread 7 state: waiting for i/o request (read thread)

Log buffer assigned up to 579412840

Log buffer completed up to 579412840

I/O thread 8 state: waiting for i/o request (read thread)

insert 0, delete mark 0, delete 0

Log written up to 579412840

I/O thread 9 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

Log flushed up to 579411234

I/O thread 10 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

Added dirty pages up to 579412840

I/O thread 11 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

Pages flushed up to 579390338

I/O thread 12 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

I/O thread 13 state: waiting for i/o request (read thread)

Last checkpoint at 579390338

Log minimum file id is 174

I/O thread 14 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

I/O thread 15 state: waiting for i/o request (read thread)

Log maximum file id is 176

Hash table size 34679, node heap has 0 buffer(s)

I/O thread 16 state: waiting for i/o request (read thread)

Hash table size 34679, node heap has 0 buffer(s)

I/O thread 17 state: complete io for buf page (write thread) ev set

Hash table size 34679, node heap has 0 buffer(s)

0.00 hash searches/s, 0.27 non-hash searches/s

I/O thread 18 state: waiting for i/o request (write thread)

---

I/O thread 19 state: waiting for i/o request (write thread)

I/O thread 20 state: waiting for i/o request (write thread)

Pending normal aio reads: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,

ibuf aio reads:

Pending flushes (fsync) log: 1; buffer pool: 1

5316 OS file reads, 50910 OS file writes, 27828 OS fsyncs

0.00 reads/s, 0 avg bytes/read, 0.27 writes/s, 0.20 fsyncs/s

-------------------------------------

INSERT BUFFER AND ADAPTIVE HASH INDEX

-------------------------------------

Ibuf: size 1, free list len 0, seg size 2, 0 merges

merged operations:

insert 0, delete mark 0, delete 0

InnoDB: ###### Diagnostic info printed to the standard error stream

2025-08-04T05:04:24.952558Z 0 [Warning] [MY-012985] [InnoDB] A long semaphore wait:

--Thread 140051887412800 has waited at trx0sys.ic line 78 for 302 seconds the semaphore:

X-lock on RW-latch at 0x7f60dfd22ba8 created in file buf0buf.cc line 853

a writer (thread id 140052759828032) has reserved it in mode SX

number of readers 0, waiters flag 1, lock_word: 10000000

Last time read locked in file log0recv.cc line 3924

Last time write locked in file /var/lib/pb2/sb_1-19079096-1743415082.2766056/rpm/BUILD/mysql-9.3.0/mysql-9.3.0/storage/innobase/buf/buf0flu.cc line 1115

InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:

InnoDB: Pending preads 0, pwrites 0

=====================================


Railway
BOT

a year ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


chandrika
EMPLOYEE

a year ago

Hi there,

Do you have a timeline of when this issue started happening? This may be related to some read / write latency we’re seeing on certain hosts. I’m attaching the root investigation ticket here so you may receive updates as it is resolved


Status changed to Awaiting User Response Railway 11 months ago


jimenagl
PROOP

a year ago

It started on July 31


Status changed to Awaiting Railway Response Railway 11 months ago


jimenagl
PROOP

a year ago

2025-07-31T01:46:28.182721Z 0 [Warning] [MY-012985] [InnoDB] A long semaphore wait:

--Thread 140594529683008 has waited at trx0rseg.ic line 52 for 240 seconds the semaphore:

X-lock on RW-latch at 0x7fdf23d3d808 created in file buf0buf.cc line 853

a writer (thread id 140595007841856) has reserved it in mode SX

number of readers 0, waiters flag 1, lock_word: 10000000

Last time read locked in file not yet reserved line 0

Last time write locked in file /var/lib/pb2/sb_1-19079096-1743415082.2766056/rpm/BUILD/mysql-9.3.0/mysql-9.3.0/storage/innobase/buf/buf0flu.cc line 1115

InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:

InnoDB: Pending preads 0, pwrites 1

=====================================

---TRANSACTION 422071689347072, not started flushing log

2025-07-31 01:46:29 140594731013696 INNODB MONITOR OUTPUT

0 lock struct(s), heap size 1128, 0 row lock(s)

=====================================

Per second averages calculated from the last 15 seconds

---TRANSACTION 422071689345456, not started

-----------------

BACKGROUND THREAD

0 lock struct(s), heap size 1128, 0 row lock(s)

-----------------

---TRANSACTION 422071689344648, not started

srv_master_thread loops: 146137 srv_active, 0 srv_shutdown, 2860081 srv_idle

0 lock struct(s), heap size 1128, 0 row lock(s)

srv_master_thread log flush and writes: 0

These are the first logs I got when it started failing on Thursday


a year ago

Hi. We'll be rolling out a change for this tomorrow. Please stay posted.


Status changed to Awaiting User Response Railway 11 months ago


jimenagl
PROOP

a year ago

Im still getting errors on my database and is making my worker service restart and even crash


Status changed to Awaiting Railway Response Railway 11 months ago


10 months ago

I am able to connect over the UI. You will need to check your application for an issue


Status changed to Awaiting User Response Railway 11 months ago


Status changed to Solved jake 11 months ago


jimenagl
PROOP

10 months ago

Im stuck on database connection and even through a third party database viewer I cant connect to the database. And even trying to enter the website I cant.


Status changed to Awaiting Railway Response Railway 11 months ago


parmstar
EMPLOYEE

10 months ago

It's resolving for me - can you try again?


Status changed to Awaiting User Response Railway 11 months ago


Railway
BOT

10 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 10 months ago


Railway
BOT

8 months ago

✅ The ticket Performance issue with disk operations on metal has been marked as completed.


Railway
BOT

8 months ago

🛠️ The ticket Performance issue with disk operations on metal has been marked as in progress.


Railway
BOT

8 months ago

✅ The ticket Performance issue with disk operations on metal has been marked as completed.


Railway
BOT

8 months ago

🛠️ The ticket Performance issue with disk operations on metal has been marked as in progress.


Railway
BOT

8 months ago

🛠️ The ticket Performance issue with disk operations on metal has been marked as in progress.


Railway
BOT

8 months ago

✅ The ticket Performance issue with disk operations on metal has been marked as completed.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...