Telegraf causing boot to hang on various versions: Invoking import script 'impor

Started by kitty123, May 10, 2026, 01:21:43 PM

Previous topic - Next topic
ISSUE:
- Across numerous version of OPNsense, reboots began hanging 30-60 minutes

TROUBLESHOOTING:
- Console showed firewall hanging at: "Invoking import script 'importer'"
- Found similar issue: https://forum.opnsense.org/index.php?topic=51232.0
- Performed Ctrl+t during hanging boot:

Console Output:
>>> Invoking import script 'importer'
ctrl+t

load: 1.07  cmd: find 64678 [running] 0.00r 0.00u 0.00s 24% 187516k
Scanning: /tmp/gosnowflake-cgo2367248933/gosnowflake-cgo2367248933
Scanned: 64581

load: 1.01  cmd: rm 26358 [running] 0.00r 0.00u 0.00s 26% 2268k
/tmp/gosnowflake-cgo2399318380
Scanning: /tmp/gosnowflake-cgo1006708623/gosnowflake-cgo1006708623
Scanned: 126229

Ctrl+C to continue boot

# cd /tmp/
# find . -maxdepth 1 -name "gosnowflake*" | wc -l
  840131
 
- gosnowflake* seems to be associated with the telegraf plugin: https://forum.opnsense.org/index.php?topic=24062.0
/tmp # cd gosnowflake-cgo2932511425
/tmp/gosnowflake-cgo2932511425 # ls -la
total 327585
drwx------       2 telegraf wheel      2 May  5 16:37 .
drwxrwxrwt  840595 root     wheel 840630 May 10 07:11 ..

- telegraf appears to be creating tons of directories causing the boot hang

RESOLUTION:
- Deleted all the directories 'gosnowflake-cgo*' in /tmp/
- Removed 'Telegraf' plugin
- Reboot is once again quick (Less than 1 minute)

Thanks for the report.  The problem here is that we're already using the most efficient way to delete files, but can't do much if the directories are created at the /tmp level:

https://github.com/opnsense/core/blob/59fc27d40e604d2e75ca340f75f0fa1a5e533418/src/etc/rc.subr.d/tmp#L50

What solves this for sure is System: Settings: Miscellaneous: Use memory file system for /tmp so the system doesn't have to clean up.

But it would also be saner for "gosnowflake" to clean up or make a proper subdirectory structure. It could also use /var/tmp and forever trash the disk but I doubt that's a future-proof way of doing it.


Cheers,
Franco
"AI has absolutely reduced the cost of creating technical debt." -- ChatGPT