Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Slack import fails with Failed to start import operation

Open DarinDev1000 opened this issue 1 year ago • 3 comments

Description:

Slack import fails to start. The file uploads and shows all the correct users and channels. Messages is grayed out. But when "Start Importing" is clicked, it fails.

Steps to reproduce:

  1. Export Slack Data
  2. Upload the slack export
  3. Click "Start Importing"

Expected behavior:

Slack import to work

Actual behavior:

An alert pops up that says "Failed to start import operation" Also, no new logs related to slack import show up in /admin/view-logs

Server Setup Information:

  • Version of Rocket.Chat Server: 5.0.1
  • Operating System: Ubuntu 22.04
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.19.3 - x64
  • MongoDB Version: 4.4.15

Client Setup Information

  • Desktop App or Browser Version: Browser Firefix and Chrome
  • Operating System: Windows 10 and Ubuntu 20.04

Additional context

I have an nginx reverse proxy with certbot ssl pointing to http://localhost:3102

start.sh is ran on startup by an ubuntu service

rocketchat-docker.service

[Unit]
Description=RocketChat Docker
After=network.target

[Service]
#Type=forking
User=user1
Group=user1

WorkingDirectory=/home/user1/production/rocketchat-docker
ExecStart=/usr/bin/bash /home/user1/production/rocketchat-docker/start.sh

[Install]
WantedBy=multi-user.target

start.sh

docker compose up

.env

### Rocket.Chat configuration

# Rocket.Chat version
# see:- https://github.com/RocketChat/Rocket.Chat/releases
RELEASE=5.0.1
# MongoDB endpoint (include ?replicaSet= parameter)
#MONGO_URL=
# MongoDB endpoint to the local database
#MONGO_OPLOG_URL=
# IP to bind the process to
#BIND_IP=
# URL used to access your Rocket.Chat instance
ROOT_URL=http://localhost:3102
# Port Rocket.Chat runs on (in-container)
PORT=3102
# Port on the host to bind to
HOST_PORT=3102

### MongoDB configuration
# MongoDB version/image tag
#MONGODB_RELEASE=
# See:- https://hub.docker.com/r/bitnami/mongodb

### Traefik config (if enabled)
# Traefik version/image tag
#TRAEFIK_RELEASE=
# Domain for https (change ROOT_URL & BIND_IP accordingly)
#DOMAIN=
# Email for certificate notifications
#LETSENCRYPT_EMAIL=

Docker compose.yml

version: "3.7"

volumes:
  mongodb_data: { driver: local }

services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-5.0.0}
    restart: on-failure
    labels:
      traefik.enable: 'true'
      traefik.http.routers.rocketchat.rule: Host(`${DOMAIN}`)
      traefik.http.routers.rocketchat.tls: 'true'
      traefik.http.routers.rocketchat.entrypoints: https
      traefik.http.routers.rocketchat.tls.certresolver: le
    environment:
      MONGO_URL: "${MONGO_URL:-\
        mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
          ${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\
        -mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
          local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3102}}
      PORT: ${PORT:-3102}
    depends_on:
      - mongodb   
    expose:
      - ${PORT:-3102}
    ports:
      - host_ip: ${BIND_IP:-0.0.0.0}
        target: ${PORT:-3102}
        published: ${HOST_PORT:-3102}
        protocol: tcp
        mode: host

  mongodb:
    image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-4.4}
    restart: on-failure
    volumes:
      - mongodb_data:/bitnami/mongodb
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0}
      MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017}
      MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb}
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}
      MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb}
      MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true}
      ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes}

Relevant logs:

Server

I20220804-19:37:57.325(0) LocalStore: store created at  
I20220804-19:37:57.325(0) LocalStore: store created at  
I20220804-19:37:57.325(0) LocalStore: store created at  {"level":40,"time":"2022-08-04T19:37:59.922Z","pid":1,"hostname":"b70f7b457932","name":"VoIPService","msg":"Voip is not enabled. Cant start the service"} {"level":40,"time":"2022-08-04T19:38:03.910Z","pid":1,"hostname":"b70f7b457932","name":"VoIPService","msg":"VoIP service already stopped"} {"level":51,"time":"2022-08-04T19:38:04.217Z","pid":1,"hostname":"b70f7b457932","name":"Migrations","msg":"Not migrating, already at version 279"} 
I20220804-19:38:04.377(0) [DatabaseWatcher] Using change streams 
I20220804-19:38:04.392(0) ufs: temp directory created at "/tmp/ufs" 
I20220804-19:38:04.886(0) Loaded the Apps Framework and loaded a total of 1 Apps! 
I20220804-19:38:05.137(0) +-------------------------------------------------------+ 
I20220804-19:38:05.137(0) |                     SERVER RUNNING                    | 
I20220804-19:38:05.137(0) +-------------------------------------------------------+ 
I20220804-19:38:05.138(0) |                                                       | 
I20220804-19:38:05.138(0) |  Rocket.Chat Version: 5.0.1                           | 
I20220804-19:38:05.138(0) |       NodeJS Version: 14.19.3 - x64                   | 
I20220804-19:38:05.138(0) |      MongoDB Version: 4.4.15                          | 
I20220804-19:38:05.138(0) |       MongoDB Engine: wiredTiger                      | 
I20220804-19:38:05.138(0) |             Platform: linux                           | 
I20220804-19:38:05.139(0) |         Process Port: 3102                            | 
I20220804-19:38:05.139(0) |             Site URL: https://rocketchat.ddctech.net  | 
I20220804-19:38:05.139(0) |     ReplicaSet OpLog: Enabled                         | 
I20220804-19:38:05.139(0) |          Commit Hash: 935c2403bd                      | 
I20220804-19:38:05.139(0) |        Commit Branch: HEAD                            | 
I20220804-19:38:05.139(0) |                                                       | 
I20220804-19:38:05.140(0) +-------------------------------------------------------+ 

Browser

[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMWindowUtils.addSheet]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 69"  data: no] [ExtensionCommon.jsm:69:12](resource://gre/modules/ExtensionCommon.jsm)
Promise rejected after context unloaded: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved
21 [kwift.CHROME.js:3](moz-extension://12c475fb-658c-4afc-bd8f-3558dfa3f31b/content/contentScripts/kwift.CHROME.js)
[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMWindowUtils.addSheet]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 69"  data: no] [ExtensionCommon.jsm:69:12](resource://gre/modules/ExtensionCommon.jsm)
[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIContentSniffer.getMIMETypeFromContent]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 309"  data: no] [FaviconLoader.jsm:309:24](resource:///modules/FaviconLoader.jsm)
Could not establish connection. Receiving end does not exist. [background.js:2](moz-extension://12c475fb-658c-4afc-bd8f-3558dfa3f31b/content/scripts/background.js)
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope 110 [kwift.CHROME.js:3](moz-extension://12c475fb-658c-4afc-bd8f-3558dfa3f31b/content/contentScripts/kwift.CHROME.js)
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope 5 [kwift.CHROME.js:3](moz-extension://12c475fb-658c-4afc-bd8f-3558dfa3f31b/content/contentScripts/kwift.CHROME.js)
Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified

DarinDev1000 avatar Aug 04 '22 19:08 DarinDev1000

Exactly the same problem here. Thanks in advance for checking on this guys!!

dotty37 avatar Aug 05 '22 01:08 dotty37

Just wanted to add, I just tested it on 5.0.2 , the problem remains, I cannot import a ZIP from Slack.

dotty37 avatar Aug 08 '22 15:08 dotty37

I encountered the same issue today, hoping this can be solved quickly.

atmovantage avatar Aug 08 '22 20:08 atmovantage

Just tested it on 5.0.3, unfortunately, same issue.

dotty37 avatar Aug 12 '22 14:08 dotty37

Hi! It should be fixed in 5.1.0.

dudanogueira avatar Aug 15 '22 14:08 dudanogueira

Awesome! I'm looking forward to it. I'm looking to migrate to Rocket Chat

Do you know if there's any sort of work around for the time being? I tried doing a csv zip import with my users but that didn't work either.

Also, I wasn't able to find anything in the commit history or PR history that I could look at that might help me understand more about the nature of the problem or the fix... I probably just don't know my way around here well enough yet.

shaymdev avatar Aug 18 '22 23:08 shaymdev

Also, I wasn't able to find anything in the commit history or PR history that I could look at that might help me understand more about the nature of the problem or the fix... I probably just don't know my way around here well enough yet.

I'm just taking a stab, but It could be related to this PR that's being actively worked on: https://github.com/RocketChat/Rocket.Chat/pull/26629

shaymdev avatar Aug 19 '22 23:08 shaymdev

Fixed by #26284

pierre-lehnen-rc avatar Aug 24 '22 15:08 pierre-lehnen-rc

This problem still exists. I got error when I tried to import a slack zip file after choosing accounts and channels. I saw error massage from the develop tool of browser.

POST https://mydomain.com/api/v1/startimport Response success false error "must have required property 'email' [invalid-params]" errorType "invalid-params"

=======EDIT========= I found that because bot account in slack doesn't have the param "email" and the import program intends to check param "email" for every imported slack account. Even if you are not going to import a bot user, the program still sends every existed account with param "do_import": false(if imported, true.) This is the reason causing failure and obviously need to be fixed.

KIRIN178 avatar Aug 29 '22 18:08 KIRIN178

I just pulled down the 5.1.0 image to test importing from slack and still am unable to import.

As @KIRIN178 mentioned, I'm seeing the same error in the browser dev tools. I created my own CSV zip for my users and was finally able to import the users. But when I retried the slack import and deselected all users it still shows the same error about "must have required property 'email' [invalid-params]".

Do we need to re-open this issue or open a new issue?

shaymdev avatar Sep 06 '22 16:09 shaymdev

Hi! It should be fixed in 5.1.0.

As far as I can tell, this still doesn't work for me in 5.1.0 Can we reopen this issue?

DarinDev1000 avatar Sep 06 '22 17:09 DarinDev1000

@pierre-lehnen-rc Since this issue still seems to be present, can we reopen this issue?

shaymdev avatar Sep 08 '22 19:09 shaymdev

I've confirmed there's still another issue with the import - it works for some files but not others, depending on the data. Working on a fix.

pierre-lehnen-rc avatar Sep 08 '22 20:09 pierre-lehnen-rc

I temporarily fixed the issue by adding an email field to all the slack bots that didn't have an email in the users json file. Maybe the code should recognize slack bots and use the bot id instead of requiring an email

DarinDev1000 avatar Sep 12 '22 19:09 DarinDev1000

@DarinDev1000 I tried your workaround and things said they successfully imported. But in both the windows app and the web app all but two conversations/channels fail to load.

image The error in the console isn't terribly helpful with the minified code either: TypeError: Cannot read properties of undefined (reading 'indexOf') at O (MessageContent.tsx:1:2814) at Dc (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:59696) at bi (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:69176) at di (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:68510) at li (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:68168) at Rs (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:114835) at nu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98840) at tu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98768) at eu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98631) at Gs (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:95485)

It seems to work on the Android app though.

Do you have the same issue? (Also, I know this is technically outside of the "failed to start import" conversation so I'd be happy to chat elsewhere if appropriate).

shaymdev avatar Sep 13 '22 17:09 shaymdev

@DarinDev1000 I tried your workaround and things said they successfully imported. But in both the windows app and the web app all but two conversations/channels fail to load.

image The error in the console isn't terribly helpful with the minified code either: TypeError: Cannot read properties of undefined (reading 'indexOf') at O (MessageContent.tsx:1:2814) at Dc (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:59696) at bi (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:69176) at di (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:68510) at li (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:68168) at Rs (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:114835) at nu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98840) at tu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98768) at eu (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:98631) at Gs (34f8ce2cebe3e6a27f46f615a3104ac125736cde.js?meteor_js_resource=true:1118:95485)

It seems to work on the Android app though.

Do you have the same issue? (Also, I know this is technically outside of the "failed to start import" conversation so I'd be happy to chat elsewhere if appropriate).

I don't think I have that issue.

DarinDev1000 avatar Sep 13 '22 20:09 DarinDev1000