Cron OEmbed Cache Cleanup causes crash


Rocket.Chat development instance crashing every day at 2:24 AM due to OEmbed Cache Cleanup error. Log below.

Server Setup Information

  • Version of Rocket.Chat Server: 6.2.5
  • Operating System: Ubuntu 22.04
  • Deployment Method: source, running via “yarn dsv”
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 14.21.3
  • MongoDB Version: 6.0
  • Proxy: nginx
  • Firewalls involved: none

Any additional Information

[2023-06-16T02:23:57.214Z] DEBUG (LivechatEnterprise/584860 on ip-10-0-0-84): Executing queue Public with timeout of 5000
section: “Queue”
OEmbedCacheCleanup no-connection
Starting OEmbed Cache Cleanup with userID: null
=== UnHandledPromiseRejection ===
errorClass [Error]: Not allowed [error-not-allowed]
at server/methods/OEmbedCacheCleanup.ts:20:10
at /home/paul/.meteor/packages/promise/.0.12.2.r6r1k6.cjm7c++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/home/paul/.meteor/packages/promise/.0.12.2.r6r1k6.cjm7c++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12)
at server/cron/oembed.js:10:4
at /home/paul/.meteor/packages/promise/.0.12.2.r6r1k6.cjm7c++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40 {
isClientSafe: true,
error: ‘error-not-allowed’,
reason: ‘Not allowed’,
details: { method: ‘OEmbedCacheCleanup’ },
errorType: ‘Meteor.Error’

Errors like this can cause oplog processing errors.
Setting EXIT_UNHANDLEDPROMISEREJECTION will cause the process to exit allowing your service to automatically restart the process
Future node.js versions will automatically exit the process

[2023-06-16T02:24:00.002Z] INFO (SyncedCron/584860 on ip-10-0-0-84): Starting “Cleanup OEmbed cache”.
[2023-06-16T02:24:00.002Z] USERLVL (Meteor/584860 on ip-10-0-0-84):
method: “OEmbedCacheCleanup”
userId: null
instanceId: “a0d18b3a-7ca8-4951-825a-7afc1a07b1a8”
[2023-06-16T02:24:00.002Z] INFO (SyncedCron/584860 on ip-10-0-0-84): Finished “Cleanup OEmbed cache”.
Exited with code: 1

I’m also seeing this at 2:24am on a regular basis.
Version 6.2.9
MongoDB 6.0
Because this is an UnhandledPromiseRejection and we have EXIT_UNHANDLEDPROMISEREJECTION set, the pod restarts (running on OpenShift).
In addition, MongoDB shows the following:
{"t":{"$date":"2023-07-31T02:24:00.365+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn2186","msg":"Interrupted operation as its client disconnected","attr":{"opId":201294612}}

Any suggestions?