Uploads bson files are empty after mongodump

Description

I have RocketChat server with FileSystem storage setting for uploaded files. Uploading/downloading uploaded files works fine. But when I export rocketchat data by mongodump -o command I got rocketchat_uploads.chunks.bson and rocketchat_uploads.files.bson are empty as a result. I guess these files must not be empty. Isn’t it due to some collections corruption? What should I do to fix it?
Mongodump -o execution performs without any errors or warnings.

Server Setup Information

  • Version of Rocket.Chat Server: 6.4.2
  • Operating System: CentOS 7
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 14.21.3
  • MongoDB Version: 5.0.18
  • Proxy:
  • Firewalls involved: no

Any additional Information

Dump files list after mongodump -o /tmp_storage/dump execution:

root@561a45b89ceb:/# ls /tmp_storage/dump/rocketchat/ -la
total 1931700
drwxr-xr-x. 2 root root 12288 Sep 30 14:21 .
drwxr-xr-x. 5 root root 51 Sep 30 14:21 …
-rw-r–r–. 1 root root 0 Sep 30 14:21 _queue.bson
-rw-r–r–. 1 root root 575 Sep 30 14:21 _queue.metadata.json
-rw-r–r–. 1 root root 35196 Sep 30 14:21 _raix_push_app_tokens.bson
-rw-r–r–. 1 root root 426 Sep 30 14:21 _raix_push_app_tokens.metadata.json
-rw-r–r–. 1 root root 35283 Sep 30 14:21 assets.chunks.bson
-rw-r–r–. 1 root root 304 Sep 30 14:21 assets.chunks.metadata.json
-rw-r–r–. 1 root root 321 Sep 30 14:21 assets.files.bson
-rw-r–r–. 1 root root 262 Sep 30 14:21 assets.files.metadata.json
-rw-r–r–. 1 root root 428 Sep 30 14:21 instances.bson
-rw-r–r–. 1 root root 304 Sep 30 14:21 instances.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 meteor_accounts_loginServiceConfiguration.bson
-rw-r–r–. 1 root root 390 Sep 30 14:21 meteor_accounts_loginServiceConfiguration.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 meteor_oauth_pendingCredentials.bson
-rw-r–r–. 1 root root 469 Sep 30 14:21 meteor_oauth_pendingCredentials.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 meteor_oauth_pendingRequestTokens.bson
-rw-r–r–. 1 root root 372 Sep 30 14:21 meteor_oauth_pendingRequestTokens.metadata.json
-rw-r–r–. 1 root root 193 Sep 30 14:21 migrations.bson
-rw-r–r–. 1 root root 177 Sep 30 14:21 migrations.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 omnichannel_auto_close_on_hold_scheduler.bson
-rw-r–r–. 1 root root 421 Sep 30 14:21 omnichannel_auto_close_on_hold_scheduler.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 omnichannel_queue_inactivity_monitor.bson
-rw-r–r–. 1 root root 526 Sep 30 14:21 omnichannel_queue_inactivity_monitor.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 omnichannel_scheduler.bson
-rw-r–r–. 1 root root 402 Sep 30 14:21 omnichannel_scheduler.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 pbx_events.bson
-rw-r–r–. 1 root root 274 Sep 30 14:21 pbx_events.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat__trash.bson
-rw-r–r–. 1 root root 583 Sep 30 14:21 rocketchat__trash.metadata.json
-rw-r–r–. 1 root root 952585 Sep 30 14:21 rocketchat_analytics.bson
-rw-r–r–. 1 root root 479 Sep 30 14:21 rocketchat_analytics.metadata.json
-rw-r–r–. 1 root root 29413 Sep 30 14:21 rocketchat_apps.bson
-rw-r–r–. 1 root root 269 Sep 30 14:21 rocketchat_apps.metadata.json
-rw-r–r–. 1 root root 13764 Sep 30 14:21 rocketchat_apps_logs.bson
-rw-r–r–. 1 root root 397 Sep 30 14:21 rocketchat_apps_logs.metadata.json
-rw-r–r–. 1 root root 96097 Sep 30 14:21 rocketchat_apps_packages.chunks.bson
-rw-r–r–. 1 root root 198 Sep 30 14:21 rocketchat_apps_packages.chunks.metadata.json
-rw-r–r–. 1 root root 103 Sep 30 14:21 rocketchat_apps_packages.files.bson
-rw-r–r–. 1 root root 197 Sep 30 14:21 rocketchat_apps_packages.files.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_apps_persistence.bson
-rw-r–r–. 1 root root 407 Sep 30 14:21 rocketchat_apps_persistence.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_apps_scheduler.bson
-rw-r–r–. 1 root root 406 Sep 30 14:21 rocketchat_apps_scheduler.metadata.json
-rw-r–r–. 1 root root 1006530 Sep 30 14:21 rocketchat_avatars.bson
-rw-r–r–. 1 root root 32121 Sep 30 14:21 rocketchat_avatars.chunks.bson
-rw-r–r–. 1 root root 335 Sep 30 14:21 rocketchat_avatars.chunks.metadata.json
-rw-r–r–. 1 root root 904 Sep 30 14:21 rocketchat_avatars.files.bson
-rw-r–r–. 1 root root 338 Sep 30 14:21 rocketchat_avatars.files.metadata.json
-rw-r–r–. 1 root root 448 Sep 30 14:21 rocketchat_avatars.metadata.json
-rw-r–r–. 1 root root 7478 Sep 30 14:21 rocketchat_banner.bson
-rw-r–r–. 1 root root 547 Sep 30 14:21 rocketchat_banner.metadata.json
-rw-r–r–. 1 root root 922 Sep 30 14:21 rocketchat_banner_dismiss.bson
-rw-r–r–. 1 root root 312 Sep 30 14:21 rocketchat_banner_dismiss.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_calendar_event.bson
-rw-r–r–. 1 root root 505 Sep 30 14:21 rocketchat_calendar_event.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_canned_response.bson
-rw-r–r–. 1 root root 377 Sep 30 14:21 rocketchat_canned_response.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_credential_tokens.bson
-rw-r–r–. 1 root root 419 Sep 30 14:21 rocketchat_credential_tokens.metadata.json
-rw-r–r–. 1 root root 3212 Sep 30 14:21 rocketchat_cron.bson
-rw-r–r–. 1 root root 396 Sep 30 14:21 rocketchat_cron.metadata.json
-rw-r–r–. 1 root root 10517 Sep 30 14:21 rocketchat_cron_history.bson
-rw-r–r–. 1 root root 454 Sep 30 14:21 rocketchat_cron_history.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_custom_emoji.bson
-rw-r–r–. 1 root root 518 Sep 30 14:21 rocketchat_custom_emoji.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_custom_sounds.bson
-rw-r–r–. 1 root root 353 Sep 30 14:21 rocketchat_custom_sounds.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_custom_user_status.bson
-rw-r–r–. 1 root root 358 Sep 30 14:21 rocketchat_custom_user_status.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_email_inbox.bson
-rw-r–r–. 1 root root 367 Sep 30 14:21 rocketchat_email_inbox.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_email_message_history.bson
-rw-r–r–. 1 root root 415 Sep 30 14:21 rocketchat_email_message_history.metadata.json
-rw-r–r–. 1 root root 973754 Sep 30 14:21 rocketchat_export_operations.bson
-rw-r–r–. 1 root root 440 Sep 30 14:21 rocketchat_export_operations.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_federation_dns_cache.bson
-rw-r–r–. 1 root root 285 Sep 30 14:21 rocketchat_federation_dns_cache.metadata.json
-rw-r–r–. 1 root root 2392 Sep 30 14:21 rocketchat_federation_keys.bson
-rw-r–r–. 1 root root 280 Sep 30 14:21 rocketchat_federation_keys.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_federation_peers.bson
-rw-r–r–. 1 root root 281 Sep 30 14:21 rocketchat_federation_peers.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_federation_room_events.bson
-rw-r–r–. 1 root root 570 Sep 30 14:21 rocketchat_federation_room_events.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_federation_servers.bson
-rw-r–r–. 1 root root 362 Sep 30 14:21 rocketchat_federation_servers.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_import.bson
-rw-r–r–. 1 root root 421 Sep 30 14:21 rocketchat_import.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_import_data.bson
-rw-r–r–. 1 root root 359 Sep 30 14:21 rocketchat_import_data.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_integration_history.bson
-rw-r–r–. 1 root root 504 Sep 30 14:21 rocketchat_integration_history.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_integrations.bson
-rw-r–r–. 1 root root 352 Sep 30 14:21 rocketchat_integrations.metadata.json
-rw-r–r–. 1 root root 7232 Sep 30 14:21 rocketchat_invites.bson
-rw-r–r–. 1 root root 272 Sep 30 14:21 rocketchat_invites.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_agent_activity.bson
-rw-r–r–. 1 root root 572 Sep 30 14:21 rocketchat_livechat_agent_activity.metadata.json
-rw-r–r–. 1 root root 2260 Sep 30 14:21 rocketchat_livechat_business_hours.bson
-rw-r–r–. 1 root root 377 Sep 30 14:21 rocketchat_livechat_business_hours.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_custom_field.bson
-rw-r–r–. 1 root root 363 Sep 30 14:21 rocketchat_livechat_custom_field.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_department.bson
-rw-r–r–. 1 root root 974 Sep 30 14:21 rocketchat_livechat_department.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_department_agents.bson
-rw-r–r–. 1 root root 647 Sep 30 14:21 rocketchat_livechat_department_agents.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_external_message.bson
-rw-r–r–. 1 root root 363 Sep 30 14:21 rocketchat_livechat_external_message.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_inquiry.bson
-rw-r–r–. 1 root root 1841 Sep 30 14:21 rocketchat_livechat_inquiry.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_page_visited.bson
-rw-r–r–. 1 root root 571 Sep 30 14:21 rocketchat_livechat_page_visited.metadata.json
-rw-r–r–. 1 root root 386 Sep 30 14:21 rocketchat_livechat_priority.bson
-rw-r–r–. 1 root root 367 Sep 30 14:21 rocketchat_livechat_priority.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_tag.bson
-rw-r–r–. 1 root root 366 Sep 30 14:21 rocketchat_livechat_tag.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_trigger.bson
-rw-r–r–. 1 root root 362 Sep 30 14:21 rocketchat_livechat_trigger.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_livechat_unit_monitors.bson
-rw-r–r–. 1 root root 451 Sep 30 14:21 rocketchat_livechat_unit_monitors.metadata.json
-rw-r–r–. 1 root root 10889 Sep 30 14:21 rocketchat_livechat_visitor.bson
-rw-r–r–. 1 root root 996 Sep 30 14:21 rocketchat_livechat_visitor.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_matrix_bridged_rooms.bson
-rw-r–r–. 1 root root 588 Sep 30 14:21 rocketchat_matrix_bridged_rooms.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_matrix_bridged_users.bson
-rw-r–r–. 1 root root 588 Sep 30 14:21 rocketchat_matrix_bridged_users.metadata.json
-rw-r–r–. 1 root root 1286361377 Sep 30 14:21 rocketchat_message.bson
-rw-r–r–. 1 root root 3009 Sep 30 14:21 rocketchat_message.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_message_read_receipt.bson
-rw-r–r–. 1 root root 543 Sep 30 14:21 rocketchat_message_read_receipt.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_message_reads.bson
-rw-r–r–. 1 root root 388 Sep 30 14:21 rocketchat_message_reads.metadata.json
-rw-r–r–. 1 root root 3295 Sep 30 14:21 rocketchat_moderation_reports.bson
-rw-r–r–. 1 root root 906 Sep 30 14:21 rocketchat_moderation_reports.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_notification_queue.bson
-rw-r–r–. 1 root root 753 Sep 30 14:21 rocketchat_notification_queue.metadata.json
-rw-r–r–. 1 root root 211 Sep 30 14:21 rocketchat_nps.bson
-rw-r–r–. 1 root root 301 Sep 30 14:21 rocketchat_nps.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_nps_vote.bson
-rw-r–r–. 1 root root 473 Sep 30 14:21 rocketchat_nps_vote.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_oauth_access_tokens.bson
-rw-r–r–. 1 root root 659 Sep 30 14:21 rocketchat_oauth_access_tokens.metadata.json
-rw-r–r–. 1 root root 306 Sep 30 14:21 rocketchat_oauth_apps.bson
-rw-r–r–. 1 root root 484 Sep 30 14:21 rocketchat_oauth_apps.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_oauth_auth_codes.bson
-rw-r–r–. 1 root root 400 Sep 30 14:21 rocketchat_oauth_auth_codes.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_oauth_refresh_tokens.bson
-rw-r–r–. 1 root root 416 Sep 30 14:21 rocketchat_oauth_refresh_tokens.metadata.json
-rw-r–r–. 1 root root 211839684 Sep 30 14:21 rocketchat_oembed_cache.bson
-rw-r–r–. 1 root root 362 Sep 30 14:21 rocketchat_oembed_cache.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_omnichannel_service_level_agreements.bson
-rw-r–r–. 1 root root 416 Sep 30 14:21 rocketchat_omnichannel_service_level_agreements.metadata.json
-rw-r–r–. 1 root root 269649 Sep 30 14:21 rocketchat_permissions.bson
-rw-r–r–. 1 root root 396 Sep 30 14:21 rocketchat_permissions.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_raw_imports.bson
-rw-r–r–. 1 root root 276 Sep 30 14:21 rocketchat_raw_imports.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_read_receipts.bson
-rw-r–r–. 1 root root 528 Sep 30 14:21 rocketchat_read_receipts.metadata.json
-rw-r–r–. 1 root root 6012 Sep 30 14:21 rocketchat_reports.bson
-rw-r–r–. 1 root root 272 Sep 30 14:21 rocketchat_reports.metadata.json
-rw-r–r–. 1 root root 1908 Sep 30 14:21 rocketchat_roles.bson
-rw-r–r–. 1 root root 422 Sep 30 14:21 rocketchat_roles.metadata.json
-rw-r–r–. 1 root root 2300939 Sep 30 14:21 rocketchat_room.bson
-rw-r–r–. 1 root root 5121 Sep 30 14:21 rocketchat_room.metadata.json
-rw-r–r–. 1 root root 83199590 Sep 30 14:21 rocketchat_server_events.bson
-rw-r–r–. 1 root root 552 Sep 30 14:21 rocketchat_server_events.metadata.json
-rw-r–r–. 1 root root 7852899 Sep 30 14:21 rocketchat_sessions.bson
-rw-r–r–. 1 root root 2377 Sep 30 14:21 rocketchat_sessions.metadata.json
-rw-r–r–. 1 root root 542648 Sep 30 14:21 rocketchat_settings.bson
-rw-r–r–. 1 root root 461 Sep 30 14:21 rocketchat_settings.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_smarsh_history.bson
-rw-r–r–. 1 root root 279 Sep 30 14:21 rocketchat_smarsh_history.metadata.json
-rw-r–r–. 1 root root 288768227 Sep 30 14:21 rocketchat_statistics.bson
-rw-r–r–. 1 root root 362 Sep 30 14:21 rocketchat_statistics.metadata.json
-rw-r–r–. 1 root root 4423082 Sep 30 14:21 rocketchat_subscription.bson
-rw-r–r–. 1 root root 2662 Sep 30 14:21 rocketchat_subscription.metadata.json
-rw-r–r–. 1 root root 8619 Sep 30 14:21 rocketchat_team.bson
-rw-r–r–. 1 root root 271 Sep 30 14:21 rocketchat_team.metadata.json
-rw-r–r–. 1 root root 90703 Sep 30 14:21 rocketchat_team_member.bson
-rw-r–r–. 1 root root 398 Sep 30 14:21 rocketchat_team_member.metadata.json
-rw-r–r–. 1 root root 87004575 Sep 30 14:21 rocketchat_uploads.bson
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_uploads.chunks.bson
-rw-r–r–. 1 root root 335 Sep 30 14:21 rocketchat_uploads.chunks.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_uploads.files.bson
-rw-r–r–. 1 root root 338 Sep 30 14:21 rocketchat_uploads.files.metadata.json
-rw-r–r–. 1 root root 605 Sep 30 14:21 rocketchat_uploads.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_userDataFiles.chunks.bson
-rw-r–r–. 1 root root 332 Sep 30 14:21 rocketchat_userDataFiles.chunks.metadata.json
-rw-r–r–. 1 root root 24933 Sep 30 14:21 rocketchat_user_data_files.bson
-rw-r–r–. 1 root root 535 Sep 30 14:21 rocketchat_user_data_files.metadata.json
-rw-r–r–. 1 root root 21146 Sep 30 14:21 rocketchat_video_conference.bson
-rw-r–r–. 1 root root 422 Sep 30 14:21 rocketchat_video_conference.metadata.json
-rw-r–r–. 1 root root 0 Sep 30 14:21 rocketchat_webdav_accounts.bson
-rw-r–r–. 1 root root 440 Sep 30 14:21 rocketchat_webdav_accounts.metadata.json
-rw-r–r–. 1 root root 67465 Sep 30 14:21 ufsTokens.bson
-rw-r–r–. 1 root root 176 Sep 30 14:21 ufsTokens.metadata.json
-rw-r–r–. 1 root root 1507231 Sep 30 14:21 users.bson
-rw-r–r–. 1 root root 6898 Sep 30 14:21 users.metadata.json
-rw-r–r–. 1 root root 9200 Sep 30 14:21 usersSessions.bson
-rw-r–r–. 1 root root 497 Sep 30 14:21 usersSessions.metadata.json

Upgrade.

Your version is no longer supported.

At the very least do yourself a security favour and use the last 6.4.x

https://docs.rocket.chat/docs/version-durability

Use something like Studio 3T to view/browse the collections.

I think those two are related to files stored within GridFS so they should be empty if you are using file storage. Usually they have a bit in there as users test with GridFS and then switch and don’t bother clearing it out.

I think you will find file storage uses rocketchat_uploads to store links.

Nothing to fix as far as I can see. Apart from upgrading ASAP…

Ok, so which dump files store data about uploaded files if Filesystem storage type is used?

^^^^^^^^^^^^^^^^^

All there for you. You can also just use say jq & grep.