RocketChat / RocketChat/Rocket.Chat

Backend storage problem(Drag to RocketChat Conversation or Copy&Paste Upload doesn't work)

Open
#13,501 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Can not use copy and paste for screenshots

Steps to reproduce:
  1. Go to a session
  2. Just copy a pic or do a screenshot
  3. The paste it, and went internal server error

Or just drag a file to the conversion and click upload, it does not work, internal server error

Expected behavior:

work as normal

Actual behavior:

Can not paste it

image

Server Setup Information:
  • Version of Rocket.Chat Server:
  • Operating System: Ubuntu
  • Deployment Method: TAR
  • Number of Running Instances: 2
  • DB Replicaset Oplog: Yes
  • NodeJS Version: v8.11.3
  • MongoDB Version: 3.6.9
Additional context

We are using WebDAV as the backend, but from the log below, seems it tried to use GridFS.

Relevant logs:

Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: Error: FileNotFound: no file with id a5izkWYcBsmzmsHwd found
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/gridfs-stream/index.js:188:25
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at result (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:414:17)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at executeCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:406:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at deleteCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/operations/collection_ops.js:329:17)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at removeDocuments (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/operations/collection_ops.js:344:54)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at handleCallback (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:128:55)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at coll.s.topology.remove (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/operations/collection_ops.js:1168:5)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at handler (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/replset.js:1195:22)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:532:18
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at _combinedTickCallback (internal/process/next_tick.js:131:7)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: Exception while invoking method 'ufsComplete' TypeError: sharp is not a function
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at WebdavStore.uploadsOnValidate [as onValidate] (packages/rocketchat:file-upload/server/lib/FileUpload.js:160:13)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at WebdavStore.validate (packages/jalik:ufs/ufs-store.js:597:18)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at MethodInvocation.ufsComplete (packages/jalik:ufs/ufs-methods.js:79:23)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at Promise (packages/ddp-server/livedata_server.js:715:46)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at new Promise ()
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at Session.method (packages/ddp-server/livedata_server.js:689:23)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at packages/ddp-server/livedata_server.js:559:43
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at createError (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/createError.js:16:15)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at settle (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/settle.js:18:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.handleStreamEnd (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/adapters/http.js:201:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at emitNone (events.js:111:20)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.emit (events.js:208:7)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at endReadableNT (_stream_readable.js:1064:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at _combinedTickCallback (internal/process/next_tick.js:138:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 40)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at createError (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/createError.js:16:15)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at settle (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/settle.js:18:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.handleStreamEnd (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/adapters/http.js:201:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at emitNone (events.js:111:20)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.emit (events.js:208:7)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at endReadableNT (_stream_readable.js:1064:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at _combinedTickCallback (internal/process/next_tick.js:138:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 42)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at createError (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/createError.js:16:15)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at settle (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/settle.js:18:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.handleStreamEnd (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/adapters/http.js:201:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at emitNone (events.js:111:20)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.emit (events.js:208:7)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at endReadableNT (_stream_readable.js:1064:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at _combinedTickCallback (internal/process/next_tick.js:138:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 44)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at createError (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/createError.js:16:15)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at settle (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/core/settle.js:18:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.handleStreamEnd (/opt/Rocket.Chat/programs/server/npm/node_modules/axios/lib/adapters/http.js:201:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at emitNone (events.js:111:20)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at IncomingMessage.emit (events.js:208:7)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at endReadableNT (_stream_readable.js:1064:12)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at _combinedTickCallback (internal/process/next_tick.js:138:11)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Feb 17 01:59:28 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 46)
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getRedirectURL' of undefined
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: at FileUploadClass.get (packages/rocketchat:file-upload/server/config/AmazonS3.js:10:29)
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: at Object.get (packages/rocketchat:file-upload/server/lib/FileUpload.js:268:17)
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: at packages/rocketchat:file-upload/server/lib/requests.js:20:22
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
Feb 17 02:01:14 cnsz02vl00735 RocketChat[2297]: (node:2297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 47)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the upload flow through packages/rocketchat:file-upload/server/lib/FileUpload.js, packages/jalik:ufs/ufs-store.js, and the ufsComplete method named in the logs. Reproduce paste and drag-and-drop uploads with WebDAV, then verify they complete without the reported validation, GridFS, 404, or configuration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, node.js
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.