Issue with cleanup extension
-
We have enabled cleanup to run every 15 minutes on reports older than 30 minutes. This works one or two times when initiated, then seems to work haphazardly. That is, checking the status of a report older than 30 minutes will return "report not found" but the document persists in storage. Is it possible we have conflicting settings in the config?
"reports": { "cleanInterval": "15m", "cleanThreshold": "30m" }
Timestamps are UTC, but you can see many old ones here, including the one that is "not found" in the screenshot above.

-
What jsreport version do you use? What template store do you use?
With the debug logs, you should see this
Cleaning up old reports Cleaned ${removedReports} old reportsand when something fails you should see
Failed to clean up old reportsCould you share these logs?
-
Thank you for the quick reply. We are using version 4.8.0. Template store is fs. There is nothing in the logs related to cleanup other than an acknowledgement of the settings. What does the last part of the statement refer to with 'undefined report(s) deletion per run'?
info: reports extension has enabled old reports cleanup with interval 900000ms, threshold 1800000ms and undefined report(s) deletion per runHere is the entire config:
{ "httpPort": 5488, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs" }, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "info", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "trustUserCode": true, "reportTimeout": 12000000, "workers": { "numberOfWorkers": 8 }, "extensions": { "authentication": { "cookieSession": { "secret": "xxxxxxxxxx" }, "admin": { "username": "xxxxxxxxxx", "password": "xxxxxxxxxxx" }, "enabled": true }, "sample-template": { "createSamples": true }, "reports": { "cleanInterval": "15m", "cleanThreshold": "30m" } } }
-
What does the last part of the statement refer to with 'undefined report(s) deletion per run'?
That seems to be just a logging issue fixed in the 4.9.0
There is nothing in the logs related to cleanup other than an acknowledgement of the settings.
That is strange, when I run with the short interval, I can immediately see the cleanup logs (at the end). Could you double-check the same and compare with your setup?
C:\work\jsreport\jsreport>docker run -p 5488:5488 -e extensions_reports_cleanInterval=5s -e extensions_reports_cleanThreshold=1m jsreport/jsreport:4.8.0 2026-04-28T19:05:09.581Z - info: Initializing jsreport (version: 4.8.0, configuration file: jsreport.config.json, nodejs: 18.20.5) 2026-04-28T19:05:09.582Z - info: Searching for available extensions in /app/ 2026-04-28T19:05:09.583Z - info: Extensions location cache not found, crawling directories 2026-04-28T19:05:09.694Z - info: Found 35 extension(s) 2026-04-28T19:05:09.702Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json 2026-04-28T19:05:09.702Z - debug: Discovered 35 extensions 2026-04-28T19:05:09.729Z - info: Using extension authentication@4.2.3 2026-04-28T19:05:09.781Z - debug: Extension authentication@4.2.3 was disabled 2026-04-28T19:05:09.781Z - info: Using extension base@4.0.0 2026-04-28T19:05:09.784Z - info: Using extension child-templates@4.1.0 2026-04-28T19:05:09.784Z - info: Using extension cli@4.1.0 2026-04-28T19:05:09.785Z - info: Using extension components@4.0.2 2026-04-28T19:05:09.786Z - info: Using extension data@4.1.0 2026-04-28T19:05:09.786Z - info: Using extension express@4.2.0 2026-04-28T19:05:09.898Z - info: Using extension freeze@4.0.0 2026-04-28T19:05:09.898Z - info: Using extension fs-store@4.1.0 2026-04-28T19:05:09.936Z - info: Using extension handlebars@4.0.1 2026-04-28T19:05:09.937Z - info: Using extension import-export@4.0.6 2026-04-28T19:05:09.940Z - info: Using extension jsrender@4.0.0 2026-04-28T19:05:09.941Z - info: Using extension licensing@4.0.4 2026-04-28T19:05:09.959Z - info: Using extension localization@4.0.1 2026-04-28T19:05:09.959Z - info: Using extension npm@4.0.0 2026-04-28T19:05:09.962Z - info: Using extension pdf-utils@4.3.0 2026-04-28T19:05:09.964Z - info: Using extension reports@4.1.3 2026-04-28T19:05:09.965Z - info: reports extension has enabled old reports cleanup with interval 5000ms, threshold 60000ms and undefined report(s) deletion per run 2026-04-28T19:05:09.966Z - info: Using extension tags@4.0.1 2026-04-28T19:05:09.966Z - info: Using extension text@4.0.2 2026-04-28T19:05:09.966Z - info: Using extension version-control@4.1.0 2026-04-28T19:05:09.969Z - info: Using extension assets@4.2.1 2026-04-28T19:05:09.973Z - info: Using extension authorization@4.1.0 2026-04-28T19:05:09.974Z - debug: Extension authorization@4.1.0 was disabled 2026-04-28T19:05:09.974Z - info: Using extension browser-client@4.1.0 2026-04-28T19:05:09.975Z - info: Using extension chrome-pdf@4.1.1 2026-04-28T19:05:09.976Z - debug: Chrome strategy is chrome-pool, numberOfWorkers: 1 2026-04-28T19:05:09.977Z - debug: Chrome custom launch options are args=--no-sandbox,--disable-dev-shm-usage, executablePath=/usr/lib/chromium/chrome, protocolTimeout=60000 2026-04-28T19:05:09.977Z - info: Using extension docx@4.7.0 2026-04-28T19:05:09.978Z - info: Using extension html-to-xlsx@4.2.0 2026-04-28T19:05:10.070Z - info: html-to-xlsx detected chrome as available html engine 2026-04-28T19:05:10.070Z - info: Using extension pptx@4.4.0 2026-04-28T19:05:10.071Z - info: Using extension scheduling@4.1.0 2026-04-28T19:05:10.082Z - info: Using extension scripts@4.2.0 2026-04-28T19:05:10.082Z - info: Using extension static-pdf@4.1.0 2026-04-28T19:05:10.082Z - info: Using extension studio@4.3.0 2026-04-28T19:05:10.112Z - info: Using extension xlsx@4.4.0 2026-04-28T19:05:10.113Z - info: Using extension public-templates@4.0.0 2026-04-28T19:05:10.113Z - debug: Extension public-templates@4.0.0 was disabled 2026-04-28T19:05:10.113Z - info: Using extension sample-template@4.0.1 2026-04-28T19:05:10.114Z - info: Using extension studio-theme-dark@4.0.0 2026-04-28T19:05:10.115Z - info: Using general timeout for rendering (reportTimeout: 60000) 2026-04-28T19:05:10.115Z - info: Using fs provider for template store. 2026-04-28T19:05:10.117Z - info: fs store is persisting using fs for /app/data 2026-04-28T19:05:10.121Z - info: fs store is loading data 2026-04-28T19:05:10.129Z - info: fs store is initialized successfully 2026-04-28T19:05:10.132Z - debug: studio default theme is: light 2026-04-28T19:05:10.134Z - info: Creating default express app. 2026-04-28T19:05:10.142Z - info: jsreport server successfully started on http port: 5488 2026-04-28T19:05:10.143Z - info: Verifying license key free 2026-04-28T19:05:10.143Z - info: Using free license 2026-04-28T19:05:10.152Z - info: Migrating templates chrome settings (waitForNetworkIddle -> waitForNetworkIdle) 2026-04-28T19:05:10.154Z - info: Migration successful 2026-04-28T19:05:10.155Z - debug: Creating samples is disabled 2026-04-28T19:05:10.155Z - info: Initializing worker threads 2026-04-28T19:05:10.155Z - debug: Extensions in workers: base, child-templates, components, data, express, handlebars, jsrender, localization, npm, pdf-utils, reports, text, version-control, assets, browser-client, chrome-pdf, docx, html-to-xlsx, pptx, scripts, static-pdf, studio, xlsx 2026-04-28T19:05:10.418Z - info: 2 worker threads initialized in 263ms 2026-04-28T19:05:10.418Z - info: Starting temp files cleanup with 180000ms threshold 2026-04-28T19:05:10.418Z - info: reporter initialized 2026-04-28T19:05:14.967Z - debug: Cleaning up old reports 2026-04-28T19:05:14.969Z - debug: Cleaned 0 old reports 2026-04-28T19:05:19.969Z - debug: Cleaning up old reports 2026-04-28T19:05:19.969Z - debug: Cleaned 0 old reports
-
Here are the logs after restarting the VM we have JSR running on.
2026-04-28T19:28:17.650Z - info: Initializing jsreport (version: 4.8.0, configuration file: jsreport.config.json, nodejs: 22.14.0) 2026-04-28T19:28:17.651Z - info: Searching for available extensions in C:\apps\jsreportapp\ 2026-04-28T19:28:19.551Z - info: Extensions location cache contains up to date information, skipping crawling in C:\apps\jsreportapp\ 2026-04-28T19:28:19.884Z - info: Found 36 extension(s) 2026-04-28T19:28:19.893Z - warn: Filtering out duplicated extension "handlebars" from C:\apps\jsreportapp\node_modules\@jsreport\jsreport-handlebars, using C:\apps\jsreportapp\node_modules\@jsreport\.jsreport-handlebars-l3SNQned 2026-04-28T19:28:19.931Z - info: Using extension handlebars@4.0.1 2026-04-28T19:28:19.932Z - info: Using extension authentication@4.2.3 2026-04-28T19:28:19.934Z - info: Using extension base@4.0.0 2026-04-28T19:28:19.934Z - info: Using extension child-templates@4.1.0 2026-04-28T19:28:19.935Z - info: Using extension cli@4.1.0 2026-04-28T19:28:19.935Z - info: Using extension components@4.0.2 2026-04-28T19:28:19.935Z - info: Using extension data@4.1.0 2026-04-28T19:28:19.936Z - info: Using extension express@4.2.0 2026-04-28T19:28:19.937Z - info: Using extension freeze@4.0.0 2026-04-28T19:28:19.937Z - info: Using extension fs-store@4.1.0 2026-04-28T19:28:19.940Z - info: Using extension import-export@4.0.6 2026-04-28T19:28:19.940Z - info: Using extension jsrender@4.0.0 2026-04-28T19:28:19.940Z - info: Using extension licensing@4.0.4 2026-04-28T19:28:19.941Z - info: Using extension localization@4.0.1 2026-04-28T19:28:19.941Z - info: Using extension npm@4.0.0 2026-04-28T19:28:19.943Z - info: Using extension pdf-utils@4.3.0 2026-04-28T19:28:19.943Z - info: Using extension reports@4.1.3 2026-04-28T19:28:19.944Z - info: reports extension has enabled old reports cleanup with interval 30000ms, threshold 60000ms and undefined report(s) deletion per run 2026-04-28T19:28:19.944Z - info: Using extension tags@4.0.1 2026-04-28T19:28:19.944Z - info: Using extension text@4.0.2 2026-04-28T19:28:19.944Z - info: Using extension version-control@4.1.0 2026-04-28T19:28:19.945Z - info: Using extension assets@4.2.1 2026-04-28T19:28:19.946Z - info: Using extension authorization@4.1.0 2026-04-28T19:28:19.946Z - info: Using extension browser-client@4.1.0 2026-04-28T19:28:19.946Z - info: Using extension chrome-pdf@4.1.1 2026-04-28T19:28:19.948Z - info: Using extension docx@4.7.0 2026-04-28T19:28:19.948Z - info: Using extension html-to-xlsx@4.2.0 2026-04-28T19:28:19.949Z - info: html-to-xlsx detected chrome as available html engine 2026-04-28T19:28:19.949Z - info: Using extension pptx@4.4.0 2026-04-28T19:28:19.949Z - info: Using extension scheduling@4.1.0 2026-04-28T19:28:19.950Z - info: Using extension scripts@4.2.0 2026-04-28T19:28:19.951Z - info: Using extension static-pdf@4.1.0 2026-04-28T19:28:19.951Z - info: Using extension studio@4.3.0 2026-04-28T19:28:19.963Z - info: Using extension xlsx@4.4.0 2026-04-28T19:28:19.963Z - info: Using extension public-templates@4.0.0 2026-04-28T19:28:19.964Z - info: Using extension sample-template@4.0.1 2026-04-28T19:28:19.964Z - info: Using extension studio-theme-dark@4.0.0 2026-04-28T19:28:19.965Z - info: Code sandboxing is disabled, users can potentially penetrate the local system if you allow code from external users to be part of your reports 2026-04-28T19:28:19.965Z - info: Using general timeout for rendering (reportTimeout: 12000000) 2026-04-28T19:28:19.965Z - info: Using fs provider for template store. 2026-04-28T19:28:19.966Z - info: fs store is persisting using fs for C:\apps\jsreportapp\data 2026-04-28T19:28:20.070Z - info: fs store is loading data 2026-04-28T19:28:20.315Z - info: fs store is initialized successfully 2026-04-28T19:28:20.325Z - info: Creating default express app. 2026-04-28T19:28:20.340Z - error: Error when starting http server on port 5488 Error: listen EADDRINUSE: address already in use :::5488 at Server.setupListenHandle [as _listen2] (node:net:1937:16) at listenInCluster (node:net:1994:12) at Server.listen (node:net:2099:7) at C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:22:12 at new Promise (<anonymous>) at startAsync (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:16:10) at C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:50:14 at Object.start (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:125:13) at Object.<anonymous> (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:333:30) at async ListenerCollection.fire (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-core\lib\shared\listenerCollection.js:157:21) 2026-04-28T19:28:20.340Z - error: Error occurred during reporter init: Error: listen EADDRINUSE: address already in use :::5488 at Server.setupListenHandle [as _listen2] (node:net:1937:16) at listenInCluster (node:net:1994:12) at Server.listen (node:net:2099:7) at C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:22:12 at new Promise (<anonymous>) at startAsync (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:16:10) at C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:50:14 at Object.start (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:125:13) at Object.<anonymous> (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-express\lib\main.js:333:30) at async ListenerCollection.fire (C:\apps\jsreportapp\node_modules\@jsreport\jsreport-core\lib\shared\listenerCollection.js:157:21) 2026-04-28T19:28:20.776Z - info: docx generation was finished rootId=pbp9huzgxenxetv, id=pbp9huzgxenxetv 2026-04-28T19:28:21.115Z - info: Rendering request 3 finished in 46396 ms rootId=pbp9huzgxenxetv, id=pbp9huzgxenxetvI generated 2 reports at 7:28 UTC.


They are both still in storage (7:37 UTC)
