Error 404 on model upload using cURL

Trying to upload my model to Rasa X using

curl -k -F "model=@20200320-140736.tar.gz" \

But always get this error:

{"version":"0.26.1","status":"failure","message":"Could not save model.\nNo `model` file found.","reason":"ModelSaveError","details":{},"help":null,"code":404}

From this GitHub report, I’ve already tried fixing the permissions.

sudo chgrp -R root /etc/rasa/models && sudo chmod -R 770 /etc/rasa/models

But I still get the same error.

@visvamba are you inside the models folder when you are executing the command? if you’re in the base of the project directory, it should be

-F "model=@models/20200320-140736.tar.gz"
1 Like

I am in fact inside the models folder when executing.

Hey, how did you fix that?

How did you fix that?

@lmb caan you give as much information as possible about how you’re trying to send the request? E.g. what tool you’re using to make the request, with which headers, the directory structure of where your model lives, etc.

This has worked for me.

curl --location --request POST “${RASA_X_BASE_URL}/api/projects/default/models”
–header ‘Authorization: Bearer ${ACCESS_TOKEN}’
–form ‘model=@"<absolute_model_path>"’

Please don’t give content-type as application/json. Documentation needs to b corrected. That was causing the issue

I’m glad you got it working. I’m a bit confused about your note on the documentation though, maybe it’s been corrected in the meantime? It says REQUEST BODY SCHEMA: multipart/form-data