opf/openproject · error · ArgumentError
Invalid step: #{step}
Error message
Invalid step: #{step} What it means
Admin::Import::Jira::ImportRunsController#change_step dispatches wizard navigation: it only accepts step values present in the controller's VALID_STEPS whitelist and calls the matching instance method. Any other non-blank step param raises ArgumentError('Invalid step: #{step}'), which surfaces as a 500/handled error rather than a wizard transition.
Source
Thrown at app/controllers/admin/import/jira/import_runs_controller.rb:100
def remove
raise StandardError.new(I18n.t(:"admin.jira.run.remove_error")) if @jira_import.status_running?
@jira_import.destroy!
redirect_to admin_import_jira_path(@jira), status: :see_other
end
def history
@history = @jira_import.history
end
private
def change_step(step)
return if step.blank?
method_name = VALID_STEPS.detect { |i| i == step.to_sym }
raise ArgumentError, "Invalid step: #{step}" unless method_name
send(method_name)
end
def handle_error(error)
respond_to do |format|
format.turbo_stream do
render_error_flash_message_via_turbo_stream(message: error.message.to_s)
respond_with_turbo_streams
end
format.html do
flash[:error] = error.message
redirect_to(admin_import_jira_run_path(jira_id: @jira.id, id: @jira_import.id))
end
end
end
def fetch_instance_metaView on GitHub (pinned to d9742c43f3)
Solutions
- Reload the Jira import wizard page (fresh HTML/JS) and navigate with the shipped buttons only.
- Compare the step value in the failing request params against VALID_STEPS in this controller — if a legitimate step is missing, the form and controller are out of sync (version mismatch).
- If you customized the wizard, add your step symbol to VALID_STEPS alongside a handler method of the same name.
Example fix
# before change_step(params[:step]) # after (fail soft on unknown steps) step = params[:step] return if step.blank? || VALID_STEPS.exclude?(step.to_sym) change_step(step)
Defensive patterns
Strategy: validation
Validate before calling
step = params[:step].to_s
return if step.blank?
raise ArgumentError, "Invalid step: #{step}" unless Admin::Import::Jira::ImportRunsController::VALID_STEPS.include?(step.to_sym) Try / catch
begin change_step(params[:step]) rescue ArgumentError redirect_to admin_import_jira_path, alert: 'Unknown wizard step — reload the page' end
Prevention
- Emit step values from a single shared source (server-rendered hidden fields), never hand-built JS.
- After upgrades, hard-reload wizard pages so form payloads match the controller's VALID_STEPS.
- Consider rescuing ArgumentError to a friendly flash instead of a 500 for tampered params.
When it happens
Trigger: POSTing the import-run form with step=<anything not in VALID_STEPS> — e.g. a stale browser tab running an older wizard version whose form emits a renamed step, a hand-crafted request, or a JavaScript hook submitting an intermediate value.
Common situations: Upgrading OpenProject while the admin has the Jira import wizard open in a tab (old assets submit old step names); a plugin or customization altering the wizard form; bookmarked form URLs replayed after an upgrade.
Related errors
- Unsupported model for inplace edit
- A Jira import run cannot be removed while it is running
- Invalid API token. Please check your credentials in the conf
- Jira API returned a 401 error. Your authentication token may
- Jira API returned a 429 error. It means token owner has been
AI-assisted analysis of opf/openproject@d9742c43f3 (2026-08-21).
Data as JSON: /api/errors/d81f3901cb008c98.
Report an issue: GitHub.