{"record":{"id":"a65205c05af1e138","repo":"paperclipai/paperclip","slug":"a-different-import-is-already-running-for-this-acc","errorCode":null,"errorMessage":"A different import is already running for this account. Wait for it to finish before starting another.","messagePattern":"A different import is already running for this account\\. Wait for it to finish before starting another\\.","errorType":"http","errorClass":null,"httpStatus":409,"severity":"error","filePath":"server/src/routes/companies.ts","lineNumber":640,"sourceCode":"        const importBody = companyPortabilityImportSchema.parse(rawImportBody);\n        assertImportTargetAccess(req, importBody.target);\n        const activity = importedCompanyActivityContext(actor, importBody.include ?? null);\n        const result = await portability.importBundle(importBody, boardUserId, {\n          pauseAutomations: importBody.pauseAutomations === true,\n        });\n        // The import is committed. Settlement (hooks) runs before the\n        // best-effort audit entry so a logging failure cannot make a\n        // committed import read as failed — or, on the transfer path, release\n        // the apply claim and invite a duplicate re-import.\n        await hooks?.onSuccess?.(result);\n        try {\n          await logImportedCompanyActivity(db, activity, result);\n        } catch (activityError) {\n          logger.warn(\n            { err: activityError, companyId: result.company.id },\n            \"failed to write the company.imported activity entry for a committed import\",\n          );\n        }\n        return result;\n      } catch (error) {\n        await hooks?.onFailure?.(errorMessage(error));\n        throw error;\n      }\n    };\n    if (wantsAsyncImport(req)) {\n      // Async job path. Two kinds of callers opt in:\n      //  - trusted Cloud tenants (original behavior, kept byte-identical),\n      //    keyed by their tenant identity headers;\n      //  - any other board session, keyed by its user id, so long imports\n      //    survive proxies cutting the connection while the server finishes.\n      // Jobs are held in memory only and are lost on restart — existing\n      // semantics; the status route above 404s unknown ids, so a client\n      // that can no longer see its job treats it as gone and resubmits.\n      cleanupTerminalImportJobs(importJobs, importJobTerminalRetentionMs);\n      const isCloudTenant = req.actor.source === \"cloud_tenant\";\n      const actorKey = importJobActorKey(req);","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/companies.ts#L622-L658","documentation":"Import concurrency guard (conflict case): a running import exists for this board actor but with a different request signature (another tab or another target), so there is no job to adopt; the 409 without a job tells the client to wait rather than switch to the wrong result.","triggerScenarios":"Thrown at server/src/routes/companies.ts:607 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the conflicting state to clear (running job, hold, pause, or stale fingerprint), refresh the current state, then retry the operation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}