wekan/wekan · error · Meteor.Error
swimlane-not-found
swimlane-not-found
Error message
Swimlane not found on this board.
What it means
importIcsCards (server/methods/icsImport.js:24) throws Meteor.Error('swimlane-not-found', 'Swimlane not found on this board.') when swimlaneId does not resolve to a swimlane, or the swimlane's boardId differs from the target boardId. Like the list check, this prevents cross-board writes during ICS import and mirrors the list validation immediately above it.
Source
Thrown at server/methods/icsImport.js:24
import Swimlanes from '/models/swimlanes';
import { ReactiveCache } from '/imports/reactiveCache';
import { icsToCards } from '/server/lib/icsImport';
import { Authentication } from '/server/authentication';
import { sendJsonResult } from '/server/apiMiddleware';
import { allowIsBoardMemberWithWriteAccess } from '/server/lib/utils';
import { tripCanary } from '/server/lib/canary';
// Shared import logic used by both the Meteor method and the REST endpoint.
// Validates that the target list/swimlane belong to the board (no cross-board
// writes), parses the .ics text into card shapes and inserts them.
async function importIcsCards(userId, boardId, listId, swimlaneId, icsText) {
const list = await Lists.findOneAsync(listId);
if (!list || list.boardId !== boardId) {
throw new Meteor.Error('list-not-found', 'List not found on this board.');
}
const swimlane = await Swimlanes.findOneAsync(swimlaneId);
if (!swimlane || swimlane.boardId !== boardId) {
throw new Meteor.Error('swimlane-not-found', 'Swimlane not found on this board.');
}
const cardShapes = icsToCards(icsText, { boardId, listId, swimlaneId });
const cardIds = [];
for (const shape of cardShapes) {
const doc = {
title: shape.title,
description: shape.description,
boardId,
listId,
swimlaneId,
userId,
sort: cardIds.length,
};
if (shape.startAt) doc.startAt = shape.startAt;
if (shape.dueAt) doc.dueAt = shape.dueAt;
// eslint-disable-next-line no-await-in-loop
const cardId = await Cards.insertAsync(doc);
cardIds.push(cardId);View on GitHub (pinned to eb1433158b)
Solutions
- Verify Swimlanes.findOneAsync(swimlaneId)?.boardId === boardId before the call, resolving the id from the target board's swimlanes.
- If the board uses a single swimlane, fetch its swimlane via Swimlanes.findOneAsync({boardId}) instead of a hardcoded id.
- Confirm the id is not actually a list id or board id (payload field mix-ups are common).
- Recreate the missing swimlane on the target board or re-export config with current ids, then retry.
Example fix
// before
await call('importIcsToBoard', boardId, listId, hardcodedSwimlaneId, icsText);
// after
let swimlane = await Swimlanes.findOneAsync(hardcodedSwimlaneId);
if (!swimlane || swimlane.boardId !== boardId) {
swimlane = await Swimlanes.findOneAsync({ boardId });
}
await call('importIcsToBoard', boardId, listId, swimlane._id, icsText); Defensive patterns
Strategy: validation
Validate before calling
const swimlane = await Swimlanes.findOneAsync(swimlaneId);
if (!swimlane || swimlane.boardId !== boardId) {
throw new Error(`swimlaneId ${swimlaneId} does not belong to board ${boardId}`);
} Type guard
function swimlaneBelongsToBoard(swimlane, boardId) {
return !!swimlane && swimlane.boardId === boardId;
} Try / catch
try {
await call('importIcsToBoard', boardId, listId, swimlaneId, icsText);
} catch (e) {
if (e instanceof Meteor.Error && e.error === 'swimlane-not-found') {
// resolve default swimlane of target board and retry
} else throw e;
} Prevention
- Resolve swimlaneId from Swimlanes.find({boardId}), never hardcode ids
- Check swimlane.boardId === boardId before calling
- Watch for payload field mix-ups between listId and swimlaneId
- Refresh swimlane ids after board reorganization
When it happens
Trigger: Calling importIcsToBoard / the ICS REST endpoint with a swimlaneId from another board, a deleted swimlane, a default swimlane id from a template board, or a truncated/mistyped id.
Common situations: Integrations hardcoding a default swimlane id from a different WeKan instance; swimlanes removed during board reorganization while clients still cache the id; confusion between list order id and swimlane id in API payloads.
Related errors
AI-assisted analysis of wekan/wekan@eb1433158b (2026-09-01).
Data as JSON: /api/errors/34b148e1f9b2b66e.
Report an issue: GitHub.