Import upload from the admin page always fails with 400 #45

Closed
opened 2026-10-18 18:15:22 +00:00 by jfro · 0 comments
Owner

Found in the v0.6.0 prod-image smoke run on df180a7.

What happens: Admin → Import/Export → Import Data, choose a JSON or CSV file, click Upload & Preview. The request comes back 400 Bad Request and nothing is imported. Log: POST /admin/import-export/import → Sent 400 in 1ms.

Why: ImportExportController.create_import/2 pattern-matches %{"job" => job_params}, but the upload form only has a file input, so browsers never send job params. Phoenix raises Phoenix.ActionClauseError (400). The controller tests posted "job" => %{} by hand, which hid it. Also present in v0.5.1.

Impact: importing from the UI doesn't work at all. Release blocker for v0.6.0 (import/export is a listed feature and #30 was meant to make it work).

Fix: accept the params without job (default %{}), plus tests that post the form the way a browser does (file only, and no file).

Found in the v0.6.0 prod-image smoke run on df180a7. **What happens:** Admin → Import/Export → Import Data, choose a JSON or CSV file, click *Upload & Preview*. The request comes back `400 Bad Request` and nothing is imported. Log: `POST /admin/import-export/import` → `Sent 400 in 1ms`. **Why:** `ImportExportController.create_import/2` pattern-matches `%{"job" => job_params}`, but the upload form only has a `file` input, so browsers never send `job` params. Phoenix raises `Phoenix.ActionClauseError` (400). The controller tests posted `"job" => %{}` by hand, which hid it. Also present in v0.5.1. **Impact:** importing from the UI doesn't work at all. Release blocker for v0.6.0 (import/export is a listed feature and #30 was meant to make it work). **Fix:** accept the params without `job` (default `%{}`), plus tests that post the form the way a browser does (file only, and no file).
jfro closed this issue 2026-10-18 18:21:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/fuzzy_catalog#45
No description provided.