Open EdwardWu7 opened 5 years ago
When start, some errors also occured
Feb 17 02:00:00 ubuntu RocketChat[19688]: at packages/meteor.js:620:25
Feb 17 02:00:00 ubuntu RocketChat[19688]: at runWithEnvironment (packages/meteor.js:1356:24)
Feb 17 02:01:14 ubuntu RocketChat[19688]: (node:19688) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getRedirectURL' of undefined
Feb 17 02:01:14 ubuntu RocketChat[19688]: at FileUploadClass.get (packages/rocketchat:file-upload/server/config/AmazonS3.js:10:29)
Feb 17 02:01:14 ubuntu RocketChat[19688]: at Object.get (packages/rocketchat:file-upload/server/lib/FileUpload.js:268:17)
Feb 17 02:01:14 ubuntu RocketChat[19688]: at packages/rocketchat:file-upload/server/lib/requests.js:20:22
Feb 17 02:01:14 ubuntu RocketChat[19688]: 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 ubuntu RocketChat[19688]: (node:19688) 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: 1)
Feb 17 02:01:14 ubuntu RocketChat[19688]: (node:19688) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Feb 17 02:02:01 ubuntu systemd[1]: Started Session 7365 of user rhlog.
^C
root@ubuntu:/home/rhlog# tail /var/log/syslog -n 50
Feb 17 01:55:28 ubuntu RocketChat[19688]: at Array.forEach (
Found another strange problem, it doesn't work for pictures only(JPG、PNG、etc.)
I have the exact same problem...
.gif files can be uploaded! (?) .png an .jpeg both give internal server error. all other file type I tried work (for instance .pdf)
looks like it has something to do with Sharp...
error: Exception while invoking method 'ufsComplete' TypeError: sharp is not a function
sharp The typical use case for this high speed Node.js module is to convert large images in common formats to smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
Resizing an image is typically 4x-5x faster than using the quickest ImageMagick and GraphicsMagick settings.
I found this error message (TypeError: sharp is not a function
) in another library. The solution was just to use const sharp = require('sharp');
instead of import * as sharp from 'sharp';
I was using the same version in another package without issue, so I am not sure what caused this - possibly something related to the Typescript config.
Description:
Can not use copy and paste for screenshots
Steps to reproduce:
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
Server Setup Information:
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)