{"record":{"id":"b8d31fdb2252d5c4","repo":"beekeeper-studio/beekeeper-studio","slug":"please-enter-a-default-warehouse","errorCode":null,"errorMessage":"Please enter a default warehouse","messagePattern":"Please enter a default warehouse","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/studio/src-commercial/backend/lib/db/clients/snowflake.ts","lineNumber":118,"sourceCode":"  }\n\n  async disconnect(): Promise<void> {\n    await super.disconnect();\n    await this.pool.clear();\n  }\n\n  async defaultSchema(): Promise<string | null> {\n    return this._defaultSchema;\n  }\n\n  private async configDatabase(server: IDbConnectionServer, database: IDbConnectionDatabase): Promise<ConnectionOptions> {\n\n    if (!database.database) {\n      throw new Error('Please enter a default database');\n    }\n\n    if (!server.config.snowflakeOptions.defaultWarehouse) {\n      throw new Error('Please enter a default warehouse');\n    }\n\n    const config: ConnectionOptions = {\n      authenticator: 'SNOWFLAKE',\n      account: server.config.snowflakeOptions.accountId,\n      database: database.database,\n      warehouse: server.config.snowflakeOptions.defaultWarehouse,\n    };\n\n    if ([SnowflakeAuthType.MFACode, SnowflakeAuthType.MFANotif, SnowflakeAuthType.Default].includes(server.config.snowflakeOptions?.authType)) {\n      config.username = server.config.user;\n      config.password = server.config.password;\n    }\n\n    if ([SnowflakeAuthType.MFACode, SnowflakeAuthType.MFANotif].includes(server.config.snowflakeOptions?.authType)) {\n      config.authenticator = 'USERNAME_PASSWORD_MFA';\n      config.clientRequestMFAToken = true;\n    }","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/beekeeper-studio/beekeeper-studio/blob/4e3e03e3223b2b71a1af8926d455f533b80af837/apps/studio/src-commercial/backend/lib/db/clients/snowflake.ts#L100-L136","documentation":"configDatabase additionally requires `server.config.snowflakeOptions.defaultWarehouse`. Snowflake sessions execute queries inside a warehouse; without one the SDK session fails, so the client rejects the connection up front with 'Please enter a default warehouse'.","triggerScenarios":"Calling config/connect where `server.config.snowflakeOptions.defaultWarehouse` is falsy — the Snowflake options form was submitted without choosing a warehouse, or a hand-built server config lacks snowflakeOptions.defaultWarehouse.","commonSituations":"User fills in account/database/user but misses the warehouse field in the connection form; older saved connections predate the warehouse requirement; scripts copying a server config template omit the warehouse.","solutions":["Enter a default warehouse in the Snowflake connection settings and reconnect","Confirm the warehouse name is valid (SHOW WAREHOUSES) and the user's role has USAGE on it","If constructing config in code, set `server.config.snowflakeOptions.defaultWarehouse` before connecting"],"exampleFix":"// before\nserver.config.snowflakeOptions = { accountId: 'acme' };\n// after\nserver.config.snowflakeOptions = { accountId: 'acme', defaultWarehouse: 'COMPUTE_WH' };","handlingStrategy":"validation","validationCode":"function hasWarehouse(server) {\n  return Boolean(server?.config?.snowflakeOptions?.defaultWarehouse);\n}\nif (!hasWarehouse(server)) throw new Error('Configure a default warehouse for this Snowflake connection');","typeGuard":"function hasSnowflakeWarehouse(server): server is IDbConnectionServer & { config: { snowflakeOptions: { defaultWarehouse: string } } } {\n  return typeof server?.config?.snowflakeOptions?.defaultWarehouse === 'string'\n    && server.config.snowflakeOptions.defaultWarehouse !== '';\n}","tryCatchPattern":"try {\n  await client.config(server, db);\n} catch (e) {\n  if (e.message === 'Please enter a default warehouse') {\n    ui.openConnectionForm({ focus: 'defaultWarehouse' });\n    return;\n  }\n  throw e;\n}","preventionTips":["Mark warehouse as a required field in the Snowflake connection form","Audit saved Snowflake connections (migrations/templates) for missing defaultWarehouse","Standardize on a known warehouse name in automation configs"],"tags":["snowflake","configuration","warehouse"],"backgroundTag":"missing-required-connection-option","analyzedSha":"4e3e03e3223b2b71a1af8926d455f533b80af837","analyzedAt":"2026-08-31T23:21:23.379Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}