Skip to content

Weave import causes PERMISSION_ERROR when enable_weave=False with wandb 0.23.0+ / weave 0.52.17+ #4266

@strickvl

Description

@strickvl

Description

With wandb 0.23.0 and weave 0.52.17+, ZenML pipeline runs fail with PERMISSION_ERROR even when Weave is explicitly disabled (enable_weave=False). This affects users who:

  • Are not logged into Weights & Biases
  • Don't have project creation permissions
  • Have explicitly set enable_weave=False expecting no Weave interaction

Root Cause

The WandbExperimentTracker._initialize_wandb() method imports weave in both branches:

if settings.enable_weave:
    import weave
    weave.init(project_name=...)
else:
    import weave  # ← Problem: still imports weave
    weave.init(..., settings={"disabled": True})

With weave >= 0.52.17:

  1. import weave alone loads ~548 modules including weave.trace.autopatch
  2. This triggers wandb_init_hook which attempts remote project creation
  3. The authentication/permission check fails before settings={"disabled": True} takes effect

Steps to Reproduce

  1. Install wandb 0.23.0 and weave 0.52.17+
  2. Do NOT log into W&B (wandb login)
  3. Create a ZenML stack with wandb experiment tracker (enable_weave=False is the default)
  4. Run a pipeline
  5. Observe PERMISSION_ERROR from weave/wandb

Expected Behavior

When enable_weave=False, ZenML should not import or interact with weave at all. The run should succeed without requiring W&B authentication for Weave-related operations.

Environment

  • wandb: 0.23.0+
  • weave: 0.52.17+
  • ZenML: latest

Fix

PR #4265 removes the unnecessary else branch. When enable_weave=False, we now skip all weave-related code entirely, preventing any import side-effects.

Metadata

Metadata

Assignees

Labels

backendIssues that require changes on the backendbugSomething isn't workinginternalTo filter out internal PRs and issuessnackx-squadIssues that are being handled by the x-squad

Type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions