Server error 500: Cannot read properties of undefined (reading 'mimetype')

Question/Issue:
I’m trying to use the ingestion feature of edge-impulse-runner-rs, but every time I upload the sample I get a 500 Internal Server Error with the message Cannot read properties of undefined (reading 'mimetype').

Project ID:
1105093

Context/Use case:
Uploading sensor data with edge-impulse-runner-rs ingestion.

Steps to Reproduce:

  1. Get an ingestion API key for your project
  2. Create an ingestion struct with the API key
  3. Call upload_sample.

Expected Results:
I expect response 200 (success).

Actual Results:
I got response 500 (internal server error).

Reproducibility:
Always

Environment:

  • Platform: NA
  • Build Environment Details: NA
  • OS Version: Linux (NixOS)
  • Edge Impulse Version (Firmware): NA
  • Edge Impulse CLI Version: NA
  • Project Version: NA
  • Custom Blocks / Impulse Configuration: NA
  • edge-impulse-runner-rs version: 2.0.0 (commit rev c4851b312deb2a2776743c8a6f73f12f38f8a34b)
    Logs/Attachments:
=== Request Details ===
URL: https://ingestion.edgeimpulse.com/api/training/data
Device ID: None
Device Type: nRF52832
Sensors: [Sensor { name: "accelX", units: "m/s2" }, Sensor { name: "accelY", units: "m/s2" }, Sensor { name: "accelZ", units: "m/s2" }, Sensor { name: "gyroX", units: "rad" }, Sensor { name: "gyroY", units: "rad" }, Sensor { name: "gyroZ", units: "rad" }]
Data size: 6 sensors, 500 samples
=== Request Headers ===
{
    "x-api-key": "(hidden)",
    "x-file-name": "None.json",
    "x-label": "Motionless",
}
=== Response ===
Status: 500 Internal Server Error
Headers: {
    "date": "Fri, 04 Sep 2026 23:42:45 GMT",
    "content-type": "text/plain",
    "transfer-encoding": "chunked",
    "connection": "keep-alive",
    "access-control-allow-origin": "*",
    "content-security-policy": "default-src 'none'; frame-ancestors 'none'; form-action 'none';",
    "x-content-type-options": "nosniff",
    "x-frame-options": "DENY",
    "x-xss-protection": "1; mode=block",
    "referrer-policy": "strict-origin",
    "cache-control": "s-maxage=0,public,no-cache,no-store,must-revalidate",
    "strict-transport-security": "max-age=63072000",
}
Body: Cannot read properties of undefined (reading 'mimetype')

Hello @Anthony24851,

Could you share an example of the payload you’re trying to send please?

Best,

Louis

Hi,
As the log shows, I’m sending 500 samples of 6 doubles each.
The payload is strongly typed and can be found in the crate’s docs.
As for what it looks like when it’s serialized, I’m not really sure. The complete HTTP request is handled by the reqwest crate.
However, I did run a debugger to inspect the upload_sample function. The first part of the json string can be found below:

"{\"protected\":{\"ver\":\"v1\",\"alg\":\"HS256\",\"iat\":1788814257},\"signature\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"payload\":{\"device_name\":\"None\",\"device_type\":\"nRF52832\",\"interval_ms\":20.0,\"sensors\":[{\"name\":\"accelX\",\"units\":\"m/s2\"},{\"name\":\"accelY\",\"units\":\"m/s2\"},{\"name\":\"accelZ\",\"units\":\"m/s2\"},{\"name\":\"gyroX\",\"units\":\"rad\"},{\"name\":\"gyroY\",\"units\":\"rad\"},{\"name\":\"gyroZ\",\"units\":\"rad\"}],\"values\":[[-0.2621730826746422,0.08020820337534715,9.956591454817346,0.0,0.005326484731572403,0.0042611877852579225],[-0.25977880794701985,0.08739102755821405,9.956591454817346,-0.003195890838943442,0.0042611877852579225,0.0042611877852579225],[-0.2621730826746422,0.08978530228583635,9.968562828455457,-0.0021305938926289613,0.0042611877852579225,0.0042611877852579225],[-0.2633702200384533,0.0837996154667806,9.9518029053621,-0.0021305938926289613,0.005326484731572403,0.0042611877852579225],[-0.2669616321298868,0.0885881649220252,9.961380004272591,-0.0021305938926289613,0.003195890838943442,0.0042611877"

Hello @Anthony24851,

Thanks for your message, it was a bug on our side.

It got fixed in Fix upload_sample 500 error by sending data as JSON file part by ferjm · Pull Request #34 · edgeimpulse/edge-impulse-runner-rs · GitHub. Thanks @ferjm_ei!

We are working on publishing v2.0, but it has some dependencies we need to work on.
In the meantime, you can directly pull from the public Github repo.

Best,

Louis

upload_sample succeeds now. Thank you!