RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.05k stars 10.33k forks source link

Custom fields not enabled Error After Entering 10 Characters or more in certain rooms #32924

Open whitetiger264 opened 1 month ago

whitetiger264 commented 1 month ago

Description:

Entering ten or more characters, such as 1234567891 in certain rooms, results in an error Custom fields not enabled.

Steps to reproduce:

I don't know how you would re-produce it, but for us, in certain rooms as soon as we type words that are 10 and more characters it results in this error. Attached screenshots.

Server Setup Information:

Client Setup Information

Desktop-screenshot

reetp commented 1 month ago

License Type: Standard

There is no "Standard" :-)

CE, Starter, Pro or EE

I guess Starter?

Ant relationship between room name and entered number?

What do your logs say?

whitetiger264 commented 1 month ago

License Type: Standard

There is no "Standard" :-)

CE, Starter, Pro or EE

I guess Starter?

Ant relationship between room name and entered number?

What do your logs say?

I meant starter, yes :). There's zero relation, it seems to be just with numbers. For example, typing 1234567891 would trigger this error, but typing abcdefghijk wouldn't. But typing DNBb1xnDate0240729725ateway triggers it, so it's something weird with numbers.

But this only seems to happen with some rooms, not all of them. I also checked the room users, so I am not seeing anything specifically that can cause this and their settings are the same. Messaging directly between users, we don't have this issue at all. This only happened after upgrading to 6.10.X though never before.

As for logs, when I trigger the error this is what I get:

username@rc:/var/log$ tail -fn0 syslog
Jul 29 10:22:26 rc rocketchat[1254664]: {"level":50,"time":"2024-07-29T10:22:26.475Z","pid":1254664,"hostname":"hostname","name":"System","msg":"Error sending message:","err":{"type":"Error","message":"Custom fields not enabled","stack":"Error: Custom fields not enabled\n    at validateCustomMessageFields (app/lib/server/lib/validateCustomMessageFields.ts:37:9)\n    at app/lib/server/functions/sendMessage.ts:178:3\n    at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n    at Function.Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)\n    at app/lib/server/functions/sendMessage.ts:254:4\n    at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n    at Function.Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)\n    at app/lib/server/methods/sendMessage.ts:96:3\n    at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40"}}
Jul 29 10:22:26 rc rocketchat[1254664]: {"level":35,"time":"2024-07-29T10:22:26.481Z","pid":1254664,"hostname":"hostname","name":"API","method":"POST","url":"/api/v1/method.call/sendMessage","userId":"r32WSyCwiuvhGtqaG","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/4.0.1 Chrome/124.0.6367.243 Electron/30.1.2 Safari/537.36","length":"196","host":"localhost:3000","referer":"https://hostname/group/payment-notifications","remoteIP":"myIP","status":200,"responseTime":98}
Jul 29 10:22:27 rc rocketchat[1254664]: {"level":35,"time":"2024-07-29T10:22:27.340Z","pid":1254664,"hostname":"hostname","name":"API","method":"POST","url":"/api/v1/subscriptions.read","userId":"r32WSyCwiuvhGtqaG","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Rocket.Chat/4.0.1 Chrome/124.0.6367.243 Electron/30.1.2 Safari/537.36","length":"27","host":"localhost:3000","referer":"https://hostname/group/payment-notifications","remoteIP":"myIP","status":200,"responseTime":28}
Jul 29 10:22:28 rc rocketchat[1254664]: {"level":20,"time":"2024-07-29T10:22:28.157Z","pid":1254664,"hostname":"hostname","name":"OmnichannelQueue","msg":"No more registered queues. Refreshing"}
Jul 29 10:22:28 rc rocketchat[1254664]: {"level":20,"time":"2024-07-29T10:22:28.159Z","pid":1254664,"hostname":"hostname","name":"OmnichannelQueue","msg":"Executing queue Public with timeout of 5000"}
Jul 29 10:22:28 rc rocketchat[1254664]: {"level":20,"time":"2024-07-29T10:22:28.159Z","pid":1254664,"hostname":"hostname","name":"OmnichannelQueue","msg":"Processing items for queue Public"}
Jul 29 10:22:28 rc rocketchat[1254664]: {"level":20,"time":"2024-07-29T10:22:28.161Z","pid":1254664,"hostname":"hostname","name":"OmnichannelQueue","msg":"No more items for queue Public"}
^Z
[3]+  Stopped                 tail -fn0 syslog

EDIT:

Adding spaces between the numbers does not trigger the issue. So 1234567891 will trigger the issue, but not 1 2 3 4 5 6 7 8 9 1. So I honestly have no idea what this is. There's also zero ModSecurity or any sort of WAF running on this machine.

reetp commented 1 month ago

I've asked if a dev will take a look. Please be patient.

whitetiger264 commented 1 month ago

@reetp

I believe I found the reason why only certain rooms were affected and not the rest. We have some rooms enabled with encryption and some not, the ones that had encryption enabled, managed to accept 12345678910 without issue, those that aren't encrypted, failed with the error.

After enabling E2E encryption for the rooms in question, it now worked.

Desktop-screenshot

We don't want to have E2E enabled for these rooms, because we need to use the search function frequently in this rooms and E2E prevents us from doing so.

reetp commented 1 month ago

Don't need to @ people thanks.

Odd. Not sure why it would throw an error in an unencrypted room.

Tested on my own 6.10.1 without issues.

Do you have any apps installed?

Any custom code?

Any other modifications?

I've asked the team to look. It may take a while. Please be patient.

whitetiger264 commented 1 month ago

Don't need to @ people thanks.

Noted.

Do you have any apps installed?

Any custom code?

Any other modifications?

We only have Data Loss Prevention installed, which was also recently installed after migrating to 6.10.x. I removed it now. After removing it, I disabled E2E in the rooms in question and now 12345678910 is accepted. So it seems it was the Data Loss Prevention app that was responsible for this.

Not sure why I didn't think of this sooner.

reetp commented 1 month ago

After removing it, I disabled E2E in the rooms in question and now 12345678910 is accepted.

Ok. So look like an app bug then. Good to narrow it down.

Someone will look at it.

Not sure why I didn't think of this sooner.

That's my job ;-)

denis-kalinichenko commented 1 month ago
Screenshot

Same issue. Room is a channel, private and e2e encrypted. Cannot send a link. Latest self-hosted version.

reetp commented 1 month ago

Latest self-hosted version.

It is always better to describe your own situation completely rather then just #metoo