Skip to content

createWorkspace Meteor method fails with "Expected string, got undefined" #6150

@TheBoysenBuilds

Description

@TheBoysenBuilds

Version: ghcr.io/wekan/wekan:latest (v24.04, released 2026-02-15)
Environment: Docker Compose with MongoDB 7

Bug Description

The createWorkspace Meteor method consistently fails when called from the browser console or UI with parameter validation errors.

Steps to Reproduce

  1. Open WeKan in browser (logged in as admin)
  2. Open browser console
  3. Try to create a workspace:
    Meteor.call('createWorkspace', { parentId: null, name: 'Test Workspace' }, console.log)

Expected Behavior

Workspace should be created and added to Users.profile.boardWorkspacesTree

Actual Behavior

Method fails with errors:

Error: Match error: Expected string, got undefined
    at check (packages/check/match.js:53:13)
    at MethodInvocation.createWorkspace (models/users.js:1953:5)

Or:

TypeError: Cannot read property 'parentId' of undefined
    at MethodInvocation.createWorkspace (models/users.js:1951:21)

Server Logs

Exception while invoking method 'createWorkspace' Error: Match error: Expected string, got undefined
    at format (packages/check/match.js:11:15)
    at check (packages/check/match.js:53:13)
    at MethodInvocation.createWorkspace (models/users.js:1953:5)

Source Code Reference

models/users.js:1953

Method signature:

createWorkspace({ parentId = null, name }) {
  check(parentId, Match.OneOf(String, null));
  check(name, String);
  // ...
}

Workaround

Workspaces can be created directly via MongoDB:

db.users.updateOne(
  { username: "admin" },
  { 
    $set: { 
      "profile.boardWorkspacesTree": [
        { id: "ws_id_here", name: "Workspace Name", children: [] }
      ]
    }
  }
)

Possible Cause

The UI may be calling the method with incorrect parameters or the Meteor method parameter destructuring is not working as expected. The error "Did not check() all arguments" suggests additional parameters may be passed that aren't validated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions