Unable to import the data using mmctl or mattermost into the database

I have created a sample file to test with one user
data.jsonl :
{“type”: “version”, “version”: 1}
{“type”: “user”, “email”: “—.—@------.com”, “username”: “------”, “password”: “------”, “first_name”: “Sample”, “last_name”: “sample”, “position”: “Engineer-Business Analyst”, “use_markdown_preview”: “True”, “use_formatting”: “True”, “show_unread_section”: “True”, “email_interval”: “immediate”}

commands to be used mentioned in the official docs: Bulk loading data — Mattermost documentation
Inside docker container i am executing below commands:
mmctl import upload data.jsonl --local
mmctl import list available --local
mmctl import process data.jsonl --local

3c0135d2f0df:/myfiles$ mmctl import upload ./data.jsonl --local
Upload session successfully created, ID: 1orcxnxamtbkpkzycgifoun6aw
Import file successfully uploaded, name: u6f96inkjtbxjenojrqa4qnp4r
3c0135d2f0df:/myfiles$ mmctl import list available --local
1orcxnxamtbkpkzycgifoun6aw_data.jsonl
3c0135d2f0df:/myfiles$ mmctl import process 1orcxnxamtbkpkzycgifoun6aw_data.jsonl --local
Import process job successfully created, ID: me5nbrunqinjmq67z1xa5p54ue
3c0135d2f0df:/myfiles$ mmctl import job show me5nbrunqinjmq67z1xa5p54ue --json --local
[
{
“id”: “me5nbrunqinjmq67z1xa5p54ue”,
“type”: “import_process”,
“priority”: 0,
“create_at”: 1678785592922,
“start_at”: 1678785599785,
“last_activity_at”: 1678785599788,
“status”: “error”,
“progress”: -1,
“data”: {
“error”: “Error during job execution. — ImportProcessWorker: Unable to process import: failed to open file., zip: not a valid zip file”,
“import_file”: “1orcxnxamtbkpkzycgifoun6aw_data.jsonl”
}
}
]

Again i have tried with zipping and uploading but facing another error:

3c0135d2f0df:/myfiles$ mmctl import upload ./data.zip --local
3c0135d2f0df:/myfiles$ mmctl import list available --local
8goakyp1b7br7q95usjo3y3ehw_data.zip
3c0135d2f0df:/myfiles$ mmctl import process 8goakyp1b7br7q95usjo3y3ehw_data.zip --local
Import process job successfully created, ID: 3rd33uau3b8bbrrw38u4hbck7c
3c0135d2f0df:/myfiles$ mmctl import job show 3rd33uau3b8bbrrw38u4hbck7c --json --local
[
{
“id”: “3rd33uau3b8bbrrw38u4hbck7c”,
“type”: “import_process”,
“priority”: 0,
“create_at”: 1678786663027,
“start_at”: 1678786664985,
“last_activity_at”: 1678786665024,
“status”: “error”,
“progress”: -1,
“data”: {
“error”: “Unable to update the job.”,
“import_file”: “8goakyp1b7br7q95usjo3y3ehw_data.zip”
}
}
]

Hi @Tejeswar and welcome to the Mattermost forums!

We’re already in contact in the Peer2Peer Channel, so I just want to summarize what we have worked on so far:

You want to bulk import users into Mattermost and created the JSON file in order to use the bulk import functionality for that.
This doesn’t work for an unknown reason, so I suggested to use a script to bulk create the users out of the CSV file you have which was the source for the JSON file.

Example CSV file:

Employee Name;Employee ID;Email ID;Designation
John Bon Jovi;A29838;jbj@gmail.com;Singer and Songwriter
Katey Perry;E39838;kk@perry.com;Noone knows exactly

I’ve now prepared two scripts, one that does the bulk import and one that does the bulk create:

Bulk Import:

Bulk Create: