Rocket.chat: Images imported from slack are not showing the preview.

Created on 30 Mar 2018  Â·  14Comments  Â·  Source: RocketChat/Rocket.Chat

Description:

When trying to import Slack messages, I got the following error:

rocketchat_1  | Exception in callback of async function: Error: File exceeds allowed size of -1 B. [error-file-too-large]
rocketchat_1  |     at Filter.validateFileUpload [as onCheck] (/app/bundle/programs/server/packages/rocketchat_file-upload.js:122:13)
rocketchat_1  |     at Filter.check (/app/bundle/programs/server/packages/jalik_ufs.js:595:53)
rocketchat_1  |     at FileUploadClass.insert (/app/bundle/programs/server/packages/rocketchat_file-upload.js:590:14)
rocketchat_1  |     at res.on.Meteor.bindEnvironment (/app/bundle/programs/server/packages/rocketchat_importer.js:391:19)
rocketchat_1  |     at runWithEnvironment (packages/meteor.js:1240:24)

It's similar to a previous issue, but with -1 instead for 0 in file size.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.62.2
  • Operating System: Ubuntu 16.04
  • Deployment Method(snap/docker/tar/etc): Docker with MongoDB outside the container
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • mongoDB Version: 3.6

Steps to Reproduce:

  1. Install MongoDB 3.6
  2. Run Rocket.Chat using Docker Compose, but without MongoDB
  3. Try to import a Slack backup.
file sharing import bug regression

All 14 comments

Having the same problems.
Slack import 7MB size. With premium features - direct messages and private channels.
Import goes fine to 1500/80000, then exits with success status. Resulting in only public channels and users being imported.

[34mI20180612-08:29:27.660(2) Exception in callback of async function: Error: File exceeds allowed size of -1 B. [error-file-too-large]     
            at Filter.validateFileUpload [as onCheck] (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_file-upload.js:122:13)     
            at Filter.check (/snap/rocketchat-server/1273/programs/server/packages/jalik_ufs.js:595:53)     
            at FileUploadClass.insert (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_file-upload.js:640:14)     
            at res.on.Meteor.bindEnvironment (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer.js:391:19)     
            at runWithEnvironment (packages/meteor.js:1238:24)  
[34mI20180612-08:29:28.358(2) rocketchat_logger rocketchat_logger.js:278 e[31mSlack Importer âž” error TypeError: Cannot read property '_id' of undefined     
            at Object.createWithTypeRoomIdMessageAndUser (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_lib.js:8010:19)     
            at msgs.messages.forEach.message (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer-slack.js:558:52)     
            at Array.forEach (<anonymous>:null:null)     
            at Object.keys.forEach.date (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer-slack.js:458:29)     
            at Array.forEach (<anonymous>:null:null)     
            at DDPCommon.MethodInvocation.Meteor.runAsUser (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer-slack.js:456:38)     
            at packages/dispatch_run-as-user.js:211:14     
            at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:12)     
            at Object.Meteor.runAsUser (packages/dispatch_run-as-user.js:210:33)     
            at Object.keys.forEach.channel (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer-slack.js:442:18)
            at Array.forEach (<anonymous>:null:null)     at Meteor.defer (/snap/rocketchat-server/1273/programs/server/packages/rocketchat_importer-slack.js:440:36)     
            at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:12)
            at packages/meteor.js:502:25     at runWithEnvironment (packages/meteor.js:1238:24)

Server Setup Information:

  • Version of Rocket.Chat Server: 0.65.1
  • Operating System: Ubuntu 16.04
  • Deployment Method(snap/docker/tar/etc): snap
  • Number of Running Instances: 1

Steps to Reproduce:

  1. Install RocketChat through snap
  2. Try to import Slack data

We're having the same issues. We want to switch from Slack to Rocket.Chat. But we need to keep our history. Messages get imported fine. However pictures are just not getting imported. Message with Picture is just missing.

Log shows this:

[34mI20180621-16:15:14.007(2) Exception in callback of async function: Error: File exceeds allowed size of -1 B. [error-file-too-large]     
at Filter.validateFileUpload [as onCheck] (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:122:13)     
at Filter.check (/snap/rocketchat-server/1276/programs/server/packages/jalik_ufs.js:595:53)     
at FileUploadClass.insert (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:640:14)     
at res.on.Meteor.bindEnvironment (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_importer.js:391:19)     
at runWithEnvironment (packages/meteor.js:1238:24)

[34mI20180621-16:15:15.723(2) Exception in callback of async function: Error: File exceeds allowed size of -1 B. [error-file-too-large]     
at Filter.validateFileUpload [as onCheck] (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:122:13)     
at Filter.check (/snap/rocketchat-server/1276/programs/server/packages/jalik_ufs.js:595:53)     
at FileUploadClass.insert (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:640:14)     
at res.on.Meteor.bindEnvironment (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_importer.js:391:19)     
at runWithEnvironment (packages/meteor.js:1238:24)

I20180621-16:15:18.331(2) Exception in callback of async function: Error: File exceeds allowed size of 2 MB. [error-file-too-large]     
at Filter.validateFileUpload [as onCheck] (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:122:13)     
at Filter.check (/snap/rocketchat-server/1276/programs/server/packages/jalik_ufs.js:595:53)     
at FileUploadClass.insert (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_file-upload.js:640:14)     
at res.on.Meteor.bindEnvironment (/snap/rocketchat-server/1276/programs/server/packages/rocketchat_importer.js:391:19)     
at runWithEnvironment (packages/meteor.js:1238:24)

I20180621-16:15:18.475(2) Setting default file store to GridFS 

Server Setup Information:

  • Version of Rocket.Chat Server: 0.65.2
  • Operating System: Ubuntu 16.04
  • Deployment Method(snap/docker/tar/etc): snap
  • Number of Running Instances: 1

Steps to Reproduce:

  1. Install RocketChat through snap
  2. Try to import Slack data

Are there any plans to fix this soon? We want to switch to Rocket.Chat, but can't as long as we can't import old chats including pictures.

with 0.68.0 the error message is gone. However images are still not uploaded/shown in chat

Slack doesn't export images, but you should be able to see a link to the original image on slack server.

No, unfortunately the only thing I see is an empty message, where in Slack you see the picture.
Also I only got the error message which I stated above when I tried to import slack channels with pictures. In this channel only 3 pictures were posted, but I got the error exactly 3 times and nothing was in the room after import. After your change the error is gone and now at the point you see a message from the original sender. However it is empty...

Is there any workaround to get pictures imported from Slack?

@L3nny5 this issue prevailed because slack actually deprecated the event called file_share, which is used in the importer, The json format changed as a result and instead of a node called file now the images or other media files are stored as an array of json objects renamed as files .

Now the importer supports both data formats (that was available earlier as well as the new one)

Thank you @madguy02

Is this already merged into the release or only in dev for the moment?

@L3nny5 just submitted a PR awaiting a review :)

Any updates on when it will be in the release?

@madguy02 i have the same problem as @L3nny5.
Are there any updates?

Looks like it will be fixed in the next release V0.71.0. It is a milestone for this release at least...
see #11875

Well it kinda got solved in V0.71.0 but there are still some issues:

  • First import works fine. If you reimport the same archive or a newer one it somehow removes all pictures
  • Import of Attachments is not possible - won't be displayed

With these "issues" its still not possible for us to migrate to Rocket.Chat :-(

16279 added a new button to download images from the slack server after the import process is completed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antn89 picture antn89  Â·  3Comments

Kiran-Rao picture Kiran-Rao  Â·  3Comments

neha1deshmukh picture neha1deshmukh  Â·  3Comments

karlprieb picture karlprieb  Â·  3Comments

lunitic picture lunitic  Â·  3Comments