{"record":{"id":"d81f3901cb008c98","repo":"opf/openproject","slug":"invalid-step-step","errorCode":null,"errorMessage":"Invalid step: #{step}","messagePattern":"Invalid step: #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"app/controllers/admin/import/jira/import_runs_controller.rb","lineNumber":100,"sourceCode":"\n    def remove\n      raise StandardError.new(I18n.t(:\"admin.jira.run.remove_error\")) if @jira_import.status_running?\n\n      @jira_import.destroy!\n      redirect_to admin_import_jira_path(@jira), status: :see_other\n    end\n\n    def history\n      @history = @jira_import.history\n    end\n\n    private\n\n    def change_step(step)\n      return if step.blank?\n\n      method_name = VALID_STEPS.detect { |i| i == step.to_sym }\n      raise ArgumentError, \"Invalid step: #{step}\" unless method_name\n\n      send(method_name)\n    end\n\n    def handle_error(error)\n      respond_to do |format|\n        format.turbo_stream do\n          render_error_flash_message_via_turbo_stream(message: error.message.to_s)\n          respond_with_turbo_streams\n        end\n        format.html do\n          flash[:error] = error.message\n          redirect_to(admin_import_jira_run_path(jira_id: @jira.id, id: @jira_import.id))\n        end\n      end\n    end\n\n    def fetch_instance_meta","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/opf/openproject/blob/d9742c43f3424c34b63550f8c03f201fe5c3040c/app/controllers/admin/import/jira/import_runs_controller.rb#L82-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nchange_step(params[:step])\n\n# after (fail soft on unknown steps)\nstep = params[:step]\nreturn if step.blank? || VALID_STEPS.exclude?(step.to_sym)\nchange_step(step)","handlingStrategy":"validation","validationCode":"step = params[:step].to_s\nreturn if step.blank?\nraise ArgumentError, \"Invalid step: #{step}\" unless Admin::Import::Jira::ImportRunsController::VALID_STEPS.include?(step.to_sym)","typeGuard":null,"tryCatchPattern":"begin\n  change_step(params[:step])\nrescue ArgumentError\n  redirect_to admin_import_jira_path, alert: 'Unknown wizard step — reload the page'\nend","preventionTips":["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."],"tags":["jira-import","wizard","parameter-validation","controller"],"backgroundTag":"invalid-parameter-value","analyzedSha":"d9742c43f3424c34b63550f8c03f201fe5c3040c","analyzedAt":"2026-08-21T14:40:06.829Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}