Skip to content

Error when importing users from csv file: only first user imported with incomplete information, not working with TOTP #23997

@jahohu

Description

@jahohu

When using the import function in the admin panel -> CSV file -> Users in a csv file (in a zip file), only the first user / line gets imported and displays "error" after the import. The user is created, but not automatically joined to default channels, the display name is not imported although it was present in the CSV. Users can then be edited manually in order to set all fields correctly. An error is also displayed when the CSV only contains one line.

Additionally, when using TOTP with the admin account that uploads the file, a message like TOTP not available (sorry, no screenshot taken) shows up and results in the same situation with only the first line imported. The same message appears when trying to edit a user with a TOTP-enabled admin user.

Versions in user
Operating system/version: Managed virtual server, Debian 10
Rocket.Chat server version: approx. 4.0, beginning of November, still persistent with 4.2.1
Rocket.Chat client version: same results in Rocket Chat Electron desktop 3.5.7, 3.6.0 on Linux Mint 19 / Ubuntu 18 LTS as well as Windows 10 Pro 64-bit (virtual machine), and in the browser client the last versions of Firefox on same OS.
Is there any setting relevant changed? No, only the somehow related fix #23734 has been applied and is working

Steps to reproduce:

  • Create a csv file users.csv and zip it as described in the guide, containing one or more lines with user information
  • From any client (browser / desktop), with an admin user, navigate to the admin panel: Import -> Import New File -> Import Type: CSV -> Select the file -> Click Import. This lists the correct and complete content of the csv file. When clicking upload, the described error message shows up and only one user, the first line, is imported.

Expected behavior
All users/lines from the csv file should be imported with all information arriving in the user accounts (currently, display name is missing) without error messages, and also while using a TOTP-enabled admin user. All this worked before, in server versions prior to 4.0, with any client for the admin panel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions