Requesting Help with txg_sync Error I Can't Diagnose
First, before this rather large infodump, I want to thank anyone that takes the time to read through this to offer any information or advice on trying to resolve this issue.
Here’s the issue I’ve been struggling with.
I keep getting this error on my server:
INFO: task txg_sync:1615 blocked for more than 241 seconds.
Tainted: P O 5.15.0-112-generic #122-Ubuntu
Background:
I’ve got a homeserver running Ubuntu server 22.04 (no DE) with an Intel Core i7-6700K CPU @ 4.00GHz, 32GB RAM, and two ZFS pools. The OS is installed on its own 128GB SSD, and the two ZFS pools consist of a 128GB SSD in its own pool for the server’s cache, and a 4x8TB HDD RAIDZ1 pool that is my main data/server storage (much more detailed system info below).
I have a bunch of services running in Docker containers, and overall everything is great, except for when that error rears up.
The error seems random, but occurs most reliably, but not consistently, when I’m trying to write larger media files to the RAIDZ1 pool. I am aware that this an IOPS issue, but so far I have not been able to diagnose it.
Back in February, I was carrying some boxes down to the basement where the server rack is, and I accidentally kicked a stool into the server which knocked the shit out of it (it’s a tower pc that I built back in 2016 or 2017 and repurposed in 2020ish to server use). When I turned on the monitor it was in total panic mode. The screen was gibberish colors and flickering madness.
I had to force shutdown with the power button. I waited a good couple of minutes, and on reboot, everything seemed fine. Until I noticed the new txg_sync error a week or so later when I went down to add some media to the server.
After a lot of searching and reading that didn’t turn up pertinent info, I ran across a comment that said this error is almost always hardware related. Like a loose connection or a failing disk or something. With me having knocked the shit out of the server, I realized I should have opened the case up and checked it all out. I shut it down, opened it up, and found a loose connector on the motherboard. I reseated it, checked everything else (though not thoroughly enough, which we’ll get to), and rebooted hoping I had found the problem.
It seemed fine for a bit, but no luck. The error returned.
More searching with no luck, and then about a month ago, a friend he suggested I check all the SATA connectors by disconnecting each one and reconnecting to insure a good, solid connection. I had previously checked if they were seated when I opened the case, but didn’t disconnect and reconnect. While doing this, I found a SATA cable with a busted clip and thought again I had found the problem. I replaced the cable, and went about a week before the error resurfaced.
It continues to occur, as I mentioned inconsistently. Most reliably, but not always, when writing data to the RAIDZ1 pool.
I have run a thorough memtest, and there were no errors or issue with the RAM, and as far as I can tell, there are no errors/failures with the HDDs.
Below is a lot of system info, and an example of what I find in dmesg for the error.
System Info
OS & Kernel
Ubuntu 22.04.4 LTS
Linux [redacted user] 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
CPU
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
CPU family: 6
Model: 94
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Stepping: 3
CPU max MHz: 4200.0000
CPU min MHz: 800.0000
BogoMIPS: 7999.96
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dno wprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 128 KiB (4 instances)
L2: 1 MiB (4 instances)
L3: 8 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-7
Vulnerabilities:
Gather data sampling: Vulnerable: No microcode
Itlb multihit: KVM: Mitigation: VMX unsupported
L1tf: Mitigation; PTE Inversion
Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Meltdown: Mitigation; PTI
Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Retbleed: Mitigation; IBRS
Spec rstack overflow: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not
affected; BHI Not affected
Srbds: Mitigation; Microcode
Tsx async abort: Mitigation; TSX disabled
RAM
Memory Device
Array Handle: 0x004A
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 8 GB
Form Factor: DIMM
Set: None
Locator: DIMM_A2
Bank Locator: BANK 1
Type: DDR4
Type Detail: Synchronous
Speed: 2133 MT/s
Manufacturer: Corsair
Serial Number: 00000000
Asset Tag: 9876543210
Part Number: CMK16GX4M2A2400C16
Rank: 2
Configured Memory Speed: 2133 MT/s
Minimum Voltage: Unknown
Maximum Voltage: Unknown
Configured Voltage: 1.2 V
Handle 0x004D, DMI type 17, 40 bytes
Memory Device
Array Handle: 0x004A
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 8 GB
Form Factor: DIMM
Set: None
Locator: DIMM_B1
Bank Locator: BANK 2
Type: DDR4
Type Detail: Synchronous
Speed: 2133 MT/s
Manufacturer: Corsair
Serial Number: 00000000
Asset Tag: 9876543210
Part Number: CMK16GX4M2A2400C16
Rank: 1
Configured Memory Speed: 2133 MT/s
Minimum Voltage: Unknown
Maximum Voltage: Unknown
Configured Voltage: 1.2 V
Handle 0x004E, DMI type 17, 40 bytes
Memory Device
Array Handle: 0x004A
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 8 GB
Form Factor: DIMM
Set: None
Locator: DIMM_B2
Bank Locator: BANK 3
Type: DDR4
Type Detail: Synchronous
Speed: 2133 MT/s
Manufacturer: Corsair
Serial Number: 00000000
Asset
Disks
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.9M 1 loop /snap/core20/2264
loop1 7:1 0 63.9M 1 loop /snap/core20/2318
loop2 7:2 0 87M 1 loop /snap/lxd/27948
loop3 7:3 0 87M 1 loop /snap/lxd/28373
loop4 7:4 0 38.7M 1 loop /snap/snapd/21465
loop5 7:5 0 38.8M 1 loop /snap/snapd/21759
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 2G 0 part /boot
└─sda3 8:3 0 221.6G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 100G 0 lvm /
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 223.6G 0 part
└─sdb9 8:25 0 8M 0 part
sdc 8:32 0 7.3T 0 disk
├─sdc1 8:33 0 7.3T 0 part
└─sdc9 8:41 0 8M 0 part
sdd 8:48 0 7.3T 0 disk
├─sdd1 8:49 0 7.3T 0 part
└─sdd9 8:57 0 8M 0 part
sde 8:64 0 7.3T 0 disk
├─sde1 8:65 0 7.3T 0 part
└─sde9 8:73 0 8M 0 part
sdf 8:80 0 7.3T 0 disk
├─sdf1 8:81 0 7.3T 0 part
└─sdf9 8:89 0 8M 0 part
pool: srvrcache
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0B in 00:00:35 with 0 errors on Sun Jun 9 00:24:36 2024
config:
NAME STATE READ WRITE CKSUM
srvrcache ONLINE 0 0 0
sdb ONLINE 0 0 0
errors: No known data errors
pool: srvrpool
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0B in 11:41:27 with 0 errors on Sun Jun 9 12:05:31 2024
config:
NAME STATE READ WRITE CKSUM
srvrpool ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sdd ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
sdc ONLINE 0 0 0
errors: No known data errors
I mean general advice with potential hardware issues is remove as much hardware as possible, and see if the problem still exists. If it does, swap components one-by-one until you find the faulty component.
Since this seems to a sporadic problem, it would probably help to try find a way to trigger the problem more reliably. Maybe write a script that writes random files constantly, or something like that.