fiftyone-troubleshoot

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

FiftyOne Troubleshoot

FiftyOne 故障排查

Overview

概述

Diagnose and fix common FiftyOne pain points. Match the user's symptom to the Issue Index, explain the root cause and proposed fix, get approval, then apply.
Shell commands in this skill are written for macOS/Linux. On Windows (non-WSL), adapt using PowerShell equivalents or use WSL.
Designed to grow: add new issues at the bottom as they are encountered.
诊断并修复常见的FiftyOne痛点问题。将用户的症状与【问题索引](#issue-index)】匹配,解释根本原因和建议的修复方案,获得用户批准后再执行。
本技能中的Shell命令适用于macOS/Linux系统。在Windows(非WSL)系统上,请使用PowerShell等效命令或使用WSL。
本指南可扩展:遇到新问题时,可在底部添加相关内容。

Prerequisites

前提条件

  • FiftyOne installed:
    pip install fiftyone
  • MCP server running (optional, for plugin-related fixes)
  • 已安装FiftyOne:
    pip install fiftyone
  • MCP服务器正在运行(可选,用于插件相关修复)

Key Directives

核心准则

1. Always explain, propose, and confirm before acting

1. 始终先解释、提议并确认再执行操作

NEVER run a fix without first:
  1. Explaining what is wrong and why
  2. Describing what the fix will do
  3. Asking the user to confirm: "Should I apply this fix?"
Wait for explicit user confirmation before executing anything that modifies files, config, or data.
绝对不要在未完成以下步骤的情况下运行修复:
  1. 解释问题所在及原因
  2. 描述修复操作会执行的内容
  3. 询问用户确认:“是否应用此修复?”
在执行任何修改文件、配置或数据的操作前,需等待用户明确确认。

2. Never touch user datasets — FiftyOne is the source of truth

2. 绝不触碰用户数据集——FiftyOne是唯一可信源

  • Except when given explicit and direct instructions by the user:
    • NEVER modify, edit, delete, or clone user datasets as part of troubleshooting
    • NEVER call
      fo.delete_dataset()
    • NEVER truncate, wipe, or alter dataset contents or sample fields to diagnose an issue
  • Use FiftyOne's read-only API to inspect state:
    fo.list_datasets()
    ,
    fo.load_dataset()
    ,
    len(dataset)
    ,
    dataset.get_field_schema()
    — these are safe
  • FiftyOne's state (datasets, fields, brain runs) is the ground truth; read it, never rewrite it to "fix" a problem
  • 除非获得用户明确且直接的指示:
    • 故障排查过程中,绝不修改、编辑、删除或克隆用户数据集
    • 绝不调用
      fo.delete_dataset()
    • 绝不为诊断问题而截断、清除或修改数据集内容或样本字段
  • 使用FiftyOne的只读API检查状态:
    fo.list_datasets()
    fo.load_dataset()
    len(dataset)
    dataset.get_field_schema()
    ——这些操作是安全的
  • FiftyOne的状态(数据集、字段、Brain运行记录)是可信依据;仅可读取,绝不能为“修复”问题而改写

3. Never directly manipulate MongoDB

3. 绝不直接操作MongoDB

  • NEVER use
    pymongo
    ,
    db.drop_collection()
    , or raw MongoDB shell commands
  • All data operations must go through the FiftyOne Python API
  • 绝不使用
    pymongo
    db.drop_collection()
    或原始MongoDB Shell命令
  • 所有数据操作必须通过FiftyOne Python API执行

4. Never modify config or files silently

4. 绝不静默修改配置或文件

  • NEVER change
    database_uri
    ,
    database_name
    , or any config file without showing what will change and getting approval
  • NEVER append to shell profiles (
    .zshrc
    ,
    .bash_profile
    , virtualenv
    activate
    ) without showing the exact line change and getting explicit user confirmation to apply
  • 绝不修改
    database_uri
    database_name
    或任何配置文件,除非先展示修改内容并获得用户批准
  • 绝不向Shell配置文件(
    .zshrc
    .bash_profile
    、虚拟环境
    activate
    )追加内容,除非先展示确切的修改行并获得用户明确确认

5. Restart processes after env / config changes

5. 环境/配置变更后重启进程

Any fix that sets an environment variable or modifies a config file only takes effect for new processes. Already-running App servers, service managers, and Python scripts will NOT pick up the change.
  • After setting
    FIFTYONE_DATABASE_NAME
    or similar env vars, identify and restart any running FiftyOne processes
  • Check with:
    ps aux | grep fiftyone
  • Stop stale processes:
    pkill -f "fiftyone"
    (confirm with user first)
任何设置环境变量或修改配置文件的修复,仅对新启动的进程生效。已运行的App服务器、服务管理器和Python脚本不会自动应用变更。
  • 设置
    FIFTYONE_DATABASE_NAME
    或类似环境变量后,需识别并重启所有运行中的FiftyOne进程
  • 检查进程:
    ps aux | grep fiftyone
  • 终止僵死进程:
    pkill -f "fiftyone"
    (需先获得用户确认)

6. Always verify after fixing

6. 修复后始终进行验证

Run the Health Check after every fix to confirm the environment is operational.

每次修复后运行【健康检查](#health-check),确认环境可正常运行。

Workflow

工作流程

  1. Diagnose — run the Diagnostic Quick-Check
  2. Explain — describe the root cause in plain language
  3. Propose — show the fix and what it will change
  4. Confirm — ask the user: "Should I apply this?"
  5. Execute — apply the fix only after approval
  6. Verify — run the Health Check

  1. 诊断——运行快速诊断检查
  2. 解释——用通俗语言描述根本原因
  3. 提议——展示修复方案及会产生的变更
  4. 确认——询问用户:“是否应用此修复?”
  5. 执行——仅在获得批准后应用修复
  6. 验证——运行健康检查

Diagnostic Quick-Check

快速诊断检查

Handles connection failures gracefully — always produce useful output:
python
import sys

print(f"Python:  {sys.executable}")
print(f"Version: {sys.version.split()[0]}")

try:
    import fiftyone as fo
    print(f"FiftyOne: {fo.__version__}")
    print(f"Database: {fo.config.database_name}")
    print(f"DB URI:   {fo.config.database_uri or '(internal MongoDB)'}")
except ImportError:
    print("ERROR: fiftyone not installed — check Python environment, if needed run: pip install fiftyone")
    sys.exit(1)

try:
    print(f"Datasets: {fo.list_datasets()}")
    print("Connection: OK")
except Exception as e:
    print(f"Connection ERROR: {e}")
    print("→ Match this error to the Issue Index below")

可优雅处理连接失败问题——始终输出有用信息:
python
import sys

print(f"Python:  {sys.executable}")
print(f"Version: {sys.version.split()[0]}")

try:
    import fiftyone as fo
    print(f"FiftyOne: {fo.__version__}")
    print(f"Database: {fo.config.database_name}")
    print(f"DB URI:   {fo.config.database_uri or '(internal MongoDB)'}")
except ImportError:
    print("ERROR: fiftyone not installed — check Python environment, if needed run: pip install fiftyone")
    sys.exit(1)

try:
    print(f"Datasets: {fo.list_datasets()}")
    print("Connection: OK")
except Exception as e:
    print(f"Connection ERROR: {e}")
    print("→ Match this error to the Issue Index below")

Health Check

健康检查

Run after any fix to confirm the environment is fully operational.
This script creates and destroys a temporary test dataset (
_fo_health_check
). It does not touch any user datasets. Do not manually create a dataset with the name "_fo_health_check".
python
import fiftyone as fo
import tempfile, os

TEST_NAME = "_fo_health_check"

try:
    # Clean up any debris from a previous failed check
    if TEST_NAME in fo.list_datasets():
        fo.delete_dataset(TEST_NAME)

    # Non-persistent: auto-removed if Python exits before cleanup
    dataset = fo.Dataset(TEST_NAME, persistent=False)
    dataset.add_sample(fo.Sample(
        filepath=os.path.join(tempfile.gettempdir(), "health_check.jpg")
    ))
    assert len(dataset) == 1, "Sample write failed"

    # Verify connection round-trip
    assert TEST_NAME in fo.list_datasets(), "Dataset not listed"

    print(f"OK — FiftyOne {fo.__version__} on database '{fo.config.database_name}'")

finally:
    # Always clean up, even on failure
    if TEST_NAME in fo.list_datasets():
        fo.delete_dataset(TEST_NAME)

每次修复后运行,确认环境完全可正常运行。
此脚本会创建并销毁一个临时测试数据集
_fo_health_check
)。不会触碰任何用户数据集。请勿手动创建名为"_fo_health_check"的数据集。
python
import fiftyone as fo
import tempfile, os

TEST_NAME = "_fo_health_check"

try:
    # 清理之前检查失败留下的残留数据
    if TEST_NAME in fo.list_datasets():
        fo.delete_dataset(TEST_NAME)

    # 非持久化:Python退出前会自动删除
    dataset = fo.Dataset(TEST_NAME, persistent=False)
    dataset.add_sample(fo.Sample(
        filepath=os.path.join(tempfile.gettempdir(), "health_check.jpg")
    ))
    assert len(dataset) == 1, "Sample write failed"

    # 验证连接往返
    assert TEST_NAME in fo.list_datasets(), "Dataset not listed"

    print(f"OK — FiftyOne {fo.__version__} on database '{fo.config.database_name}'")

finally:
    # 无论是否失败,始终清理数据
    if TEST_NAME in fo.list_datasets():
        fo.delete_dataset(TEST_NAME)

Issue Index

问题索引

SymptomSection
Dataset disappeared after restartDataset Persistence
App won't open / not connectedApp Connection
Changes not savedUnsaved Changes
Video not playing / codec errorVideo Codec
Too many open files (macOS)Open Files Limit
App not loading in notebook / remoteNotebook / Remote
Plots not showing in notebookNotebook Plots
MongoDB connection failureMongoDB
Operator not found / plugin missingMissing Plugin
"No executor available"Delegated Operators
Dataset is read-onlyRead-Only Dataset
Slow performance on large datasetsPerformance
App showing stale / wrong dataStale Data
Downgrading FiftyOneDowngrading
Database version mismatchDB Version Mismatch
Teams / OSS client type mismatchTeams vs OSS

症状章节
重启后数据集消失数据集持久化
App无法打开/无法连接App连接
更改未保存未保存的更改
视频无法播放/编解码器错误视频编解码器
打开文件过多(macOS)打开文件限制
Notebook/远程环境中App无法加载Notebook/远程环境
Notebook中图表无法显示Notebook图表
MongoDB连接失败MongoDB
运算符未找到/插件缺失缺失插件
"No executor available"委托运算符
数据集为只读只读数据集
大型数据集性能缓慢性能优化
App显示过期/错误数据过期数据
降级FiftyOne版本版本降级
数据库版本不匹配数据库版本不匹配
Teams/OSS客户端类型不匹配Teams与OSS

Issue: Dataset Disappeared

问题:数据集消失

Cause: Datasets are non-persistent by default and are deleted when Python exits.
Fix:
python
import fiftyone as fo
原因: 默认情况下数据集是非持久化的,Python退出时会被删除。
修复方案:
python
import fiftyone as fo

Make an existing dataset persistent

将现有数据集设置为持久化

dataset = fo.load_dataset("my-dataset") dataset.persistent = True
dataset = fo.load_dataset("my-dataset") dataset.persistent = True

Prevention: always create persistent datasets

预防措施:始终创建持久化数据集

dataset = fo.Dataset("my-dataset", persistent=True)

> If the dataset is already gone from `fo.list_datasets()`, it cannot be recovered through FiftyOne — re-import from source files.

---
dataset = fo.Dataset("my-dataset", persistent=True)

> 如果数据集已从`fo.list_datasets()`中消失,则无法通过FiftyOne恢复——需从源文件重新导入。

---

Issue: App Won't Open

问题:App无法打开

Cause A — Script exits before the App loads. Fix: add
session.wait()
.
python
session = fo.launch_app(dataset)
session.wait()  # keeps the process alive
Cause B — Windows multiprocessing. Fix: add the
__main__
guard.
python
if __name__ == "__main__":
    session = fo.launch_app(dataset)
    session.wait()
Cause C — Port already in use.
python
session = fo.launch_app(dataset, port=<alternative-port>)  # e.g. 5152, 5153
Cause D — Stale process.
bash
pkill -f "fiftyone"

原因A——脚本在App加载前退出。修复:添加
session.wait()
python
session = fo.launch_app(dataset)
session.wait()  # 保持进程运行
原因B——Windows多进程问题。修复:添加
__main__
守卫。
python
if __name__ == "__main__":
    session = fo.launch_app(dataset)
    session.wait()
原因C——端口已被占用
python
session = fo.launch_app(dataset, port=<alternative-port>)  # 例如:5152、5153
原因D——僵死进程
bash
pkill -f "fiftyone"

Issue: Changes Not Saved

问题:更改未保存

Fix — sample edits:
python
sample["my_field"] = "new_value"
sample.save()  # required
Fix — dataset-level properties:
python
dataset.info["description"] = "Updated"
dataset.save()  # required
Fix — bulk updates (no
.save()
needed):
python
dataset.set_values("my_field", [v1, v2, ...])

修复——样本编辑:
python
sample["my_field"] = "new_value"
sample.save()  # 必须执行此操作
修复——数据集级属性:
python
dataset.info["description"] = "Updated"
dataset.save()  # 必须执行此操作
修复——批量更新(无需
.save()
):
python
dataset.set_values("my_field", [v1, v2, ...])

Issue: Video Codec

问题:视频编解码器

Cause: Video codec not supported by the browser's HTML5 player (requires MP4/H.264, WebM, or Ogg).
⚠️ Re-encoding overwrites files on disk. Show the user the exact paths that will be modified and get explicit confirmation before running.
python
import fiftyone.utils.video as fouv
原因: 浏览器HTML5播放器不支持该视频编解码器(仅支持MP4/H.264、WebM或Ogg格式)。
⚠️ 重新编码会覆盖磁盘上的文件。需向用户展示将被修改的确切路径,并获得明确确认后再运行。
python
import fiftyone.utils.video as fouv

Re-encode all videos in a dataset

重新编码数据集中的所有视频

fouv.reencode_videos(fo.load_dataset("my-dataset"))
fouv.reencode_videos(fo.load_dataset("my-dataset"))

Or a single file

或单个文件

fouv.reencode_video("/path/to/input.avi", "/path/to/output.mp4")

---
fouv.reencode_video("/path/to/input.avi", "/path/to/output.mp4")

---

Issue: Too Many Open Files (macOS)

问题:打开文件过多(macOS)

bash
undefined
bash
undefined

Temporary (current session only)

临时生效(仅当前会话)

ulimit -n 65536
ulimit -n 65536

Permanent — add to your shell profile and reload it

永久生效——添加到Shell配置文件并重新加载

bash: ~/.bash_profile or ~/.bashrc

bash: ~/.bash_profile 或 ~/.bashrc

zsh: ~/.zshrc

zsh: ~/.zshrc

echo "ulimit -n 65536" >> <your-shell-profile> && source <your-shell-profile>

---
echo "ulimit -n 65536" >> <your-shell-profile> && source <your-shell-profile>

---

Issue: App Not Loading in Notebook or Remote

问题:Notebook/远程环境中App无法加载

Cause A — Remote Jupyter: localhost URL not reachable from browser.
python
fo.app_config.proxy_url = "http://your-server:<app-port>/proxy/<app-port>"
session = fo.launch_app(dataset)
Cause B — Google Colab / Databricks: works out of the box, no proxy needed.
Cause C — SSH remote: forward the port locally.
bash
undefined
原因A——远程Jupyter: 本地URL无法从浏览器访问。
python
fo.app_config.proxy_url = "http://your-server:<app-port>/proxy/<app-port>"
session = fo.launch_app(dataset)
原因B——Google Colab / Databricks: 无需代理,开箱即用。
原因C——SSH远程: 本地端口转发。
bash
undefined

Use the same port FiftyOne is listening on (default: 5151)

使用FiftyOne正在监听的端口(默认:5151)

ssh -L <app-port>:localhost:<app-port> user@remote-server

---
ssh -L <app-port>:localhost:<app-port> user@remote-server

---

Issue: Plots Not Appearing in Notebook

问题:Notebook中图表无法显示

bash
pip install plotly
jupyter labextension install jupyterlab-plotly
python
import plotly.offline as pyo
pyo.init_notebook_mode(connected=True)

bash
pip install plotly
jupyter labextension install jupyterlab-plotly
python
import plotly.offline as pyo
pyo.init_notebook_mode(connected=True)

Issue: MongoDB Connection Error

问题:MongoDB连接错误

Symptoms:
ConnectionFailure
,
ServerSelectionTimeoutError
, hangs on import, port 27017 errors.
Diagnose:
bash
ps aux | grep mongod     # is MongoDB running?
df -h                    # is disk full?
Fix A — Restart FiftyOne's MongoDB:
bash
pkill -f "fiftyone.*mongod"   # kill stale process, then re-import fiftyone
Fix B — Free disk space. MongoDB will not start on a full disk.
Fix C — Use an external MongoDB instance (requires user confirmation):
json
// ~/.fiftyone/config.json
{ "database_uri": "mongodb://localhost:27017" }
Fix D — Reset internal MongoDB (last resort, destroys all datasets):
⚠️ Requires explicit user confirmation.
bash
ls -la ~/.fiftyone/          # show what will be deleted
rm -rf ~/.fiftyone/var/      # only after user confirms

症状:
ConnectionFailure
ServerSelectionTimeoutError
、导入时挂起、端口27017错误。
诊断:
bash
ps aux | grep mongod     # MongoDB是否在运行?
df -h                    # 磁盘是否已满?
修复A——重启FiftyOne的MongoDB:
bash
pkill -f "fiftyone.*mongod"   # 终止僵死进程,然后重新导入fiftyone
修复B——释放磁盘空间: MongoDB无法在磁盘满的情况下启动。
修复C——使用外部MongoDB实例(需用户确认):
json
// ~/.fiftyone/config.json
{ "database_uri": "mongodb://localhost:27017" }
修复D——重置内部MongoDB(最后手段,会销毁所有数据集):
⚠️ 需获得用户明确确认。
bash
ls -la ~/.fiftyone/          # 展示将被删除的内容
rm -rf ~/.fiftyone/var/      # 仅在用户确认后执行

Issue: Operator Not Found

问题:运算符未找到

Diagnose:
python
fo.list_plugins()
诊断:
python
fo.list_plugins()

Via MCP:

通过MCP:

list_plugins(enabled=True) list_operators(builtin_only=False)

**Fix:**
```python
fo.download_plugin("voxel51/fiftyone-plugins", plugin_names=["@voxel51/brain"])
fo.enable_plugin("@voxel51/brain")
list_plugins(enabled=True) list_operators(builtin_only=False)

**修复方案:**
```python
fo.download_plugin("voxel51/fiftyone-plugins", plugin_names=["@voxel51/brain"])
fo.enable_plugin("@voxel51/brain")

Via MCP:

通过MCP:

download_plugin(url_or_repo="voxel51/fiftyone-plugins", plugin_names=["@voxel51/brain"]) enable_plugin(plugin_name="@voxel51/brain")

| Operator prefix | Plugin |
|----------------|--------|
| `@voxel51/brain/*` | `@voxel51/brain` |
| `@voxel51/io/*` | `@voxel51/io` |
| `@voxel51/utils/*` | `@voxel51/utils` |
| `@voxel51/evaluation/*` | `@voxel51/evaluation` |
| `@voxel51/zoo/*` | `@voxel51/zoo` |

---
download_plugin(url_or_repo="voxel51/fiftyone-plugins", plugin_names=["@voxel51/brain"]) enable_plugin(plugin_name="@voxel51/brain")

| 运算符前缀 | 插件 |
|----------------|--------|
| `@voxel51/brain/*` | `@voxel51/brain` |
| `@voxel51/io/*` | `@voxel51/io` |
| `@voxel51/utils/*` | `@voxel51/utils` |
| `@voxel51/evaluation/*` | `@voxel51/evaluation` |
| `@voxel51/zoo/*` | `@voxel51/zoo` |

---

Issue: No Executor Available

问题:No executor available

Cause: Brain, evaluation, and annotation operators require the FiftyOne App running as executor.
python
launch_app()              # 1. launch app first
原因: Brain、评估和标注运算符需要FiftyOne App作为执行器运行。
python
launch_app()              # 1. 先启动App

wait 5-10 seconds

等待5-10秒

execute_operator(...) # 2. then run the operator

---
execute_operator(...) # 2. 再运行运算符

---

Issue: Dataset is Read-Only

问题:数据集为只读

python
writable = fo.load_dataset("read-only-dataset").clone("my-writable-dataset")
writable.persistent = True

python
writable = fo.load_dataset("read-only-dataset").clone("my-writable-dataset")
writable.persistent = True

Issue: Slow Performance

问题:性能缓慢

python
undefined
python
undefined

Use views, not full dataset iteration

使用视图,而非遍历完整数据集

view = dataset.match({"label": "cat"}).take(1000)
view = dataset.match({"label": "cat"}).take(1000)

Bulk updates over per-sample saves

批量更新优于逐样本保存

dataset.set_values("my_score", values_list) # fast
dataset.set_values("my_score", values_list) # 快速

vs: sample["my_score"] = v; sample.save() # slow

对比:sample["my_score"] = v; sample.save() # 缓慢

Add indexes for frequently filtered fields

为频繁过滤的字段添加索引

dataset.create_index("ground_truth.detections.label")

---
dataset.create_index("ground_truth.detections.label")

---

Issue: Stale App Data

问题:App显示过期数据

python
dataset.reload()
python
dataset.reload()

or

session.dataset = fo.load_dataset("my-dataset") session.refresh()

Browser: `Cmd+Shift+R` (macOS) / `Ctrl+Shift+R` (Windows/Linux).

---
session.dataset = fo.load_dataset("my-dataset") session.refresh()

浏览器刷新:`Cmd+Shift+R`(macOS)/ `Ctrl+Shift+R`(Windows/Linux)。

---

Issue: Downgrading FiftyOne

问题:降级FiftyOne

bash
pip install fiftyone==X.Y.Z
python -c "import fiftyone as fo; fo.migrate_database_if_necessary()"
⚠️ Export important datasets before downgrading.

bash
pip install fiftyone==X.Y.Z
python -c "import fiftyone as fo; fo.migrate_database_if_necessary()"
⚠️ 降级前请导出重要数据集。

Issue: Database Version Mismatch

问题:数据库版本不匹配

Symptom:
OSError: You must have fiftyone>=X.Y.Z to migrate from vX.Y.Z to vA.B.C
Cause: All FiftyOne installs on a machine share the same MongoDB database (
fiftyone
by default). A newer version writes a forward-only version marker that older installs cannot read. Common when a dev virtualenv runs an older version than the system pip install.
Diagnose:
bash
undefined
症状:
OSError: You must have fiftyone>=X.Y.Z to migrate from vX.Y.Z to vA.B.C
原因: 同一机器上的所有FiftyOne安装共享同一个MongoDB数据库(默认名为
fiftyone
)。新版本会写入一个向前兼容的版本标记,旧版本无法读取。常见于开发虚拟环境使用的版本低于系统pip安装的版本。
诊断:
bash
undefined

Current env

当前环境

python -c "import fiftyone as fo; print(fo.version, fo.config.database_name)"
python -c "import fiftyone as fo; print(fo.version, fo.config.database_name)"

Check if the database is accessible at all

检查数据库是否可访问

python -c " import fiftyone as fo try: print('datasets:', fo.list_datasets()) except Exception as e: print('inaccessible:', e) "
python -c " import fiftyone as fo try: print('datasets:', fo.list_datasets()) except Exception as e: print('inaccessible:', e) "

All Python installs on this machine

机器上的所有Python安装

which -a python python3 | xargs -I{} sh -c '{} -c "import fiftyone as fo; print("{}: ", fo.version)" 2>/dev/null'

**Fix A — Isolate the environment (recommended, no data loss):**

Give the affected env its own database so it never conflicts with other installs.

```bash
which -a python python3 | xargs -I{} sh -c '{} -c "import fiftyone as fo; print("{}: ", fo.version)" 2>/dev/null'

**修复A——隔离环境(推荐,无数据丢失):**

为受影响的环境分配独立数据库,避免与其他安装冲突。

```bash

Find the virtualenv activate script

找到虚拟环境激活脚本

ACTIVATE=$(python -c "import sys; print(sys.prefix)")/bin/activate echo $ACTIVATE # confirm before editing
ACTIVATE=$(python -c "import sys; print(sys.prefix)")/bin/activate echo $ACTIVATE # 确认后再编辑

Append isolation — pick a name that reflects your project

添加隔离配置——选择能反映项目的名称

echo '
echo '

Isolate FiftyOne database from other installations

Isolate FiftyOne database from other installations

export FIFTYONE_DATABASE_NAME=fiftyone-<your-project>' >> $ACTIVATE
source $ACTIVATE python -c "import fiftyone as fo; print(fo.config.database_name)"

Then run the Health Check.

> ⚠️ After applying this fix, **restart any running FiftyOne App or Python processes** — env var changes only affect new processes. Check for stale processes: `ps aux | grep fiftyone`. Confirm with user before killing them.

**Fix B — Per-session (no file changes):**
```bash
FIFTYONE_DATABASE_NAME=fiftyone-<your-project> python your_script.py
Fix C — Upgrade to match the database version:
bash
pip install "fiftyone>=X.Y.Z"
Fix D — Global config (affects all installs, confirm with user):
json
// ~/.fiftyone/config.json
{ "database_name": "fiftyone-<your-project>" }

export FIFTYONE_DATABASE_NAME=fiftyone-<your-project>' >> $ACTIVATE
source $ACTIVATE python -c "import fiftyone as fo; print(fo.config.database_name)"

然后运行健康检查。

> ⚠️ 应用此修复后,**需重启所有运行中的FiftyOne App或Python进程**——环境变量变更仅对新进程生效。检查僵死进程:`ps aux | grep fiftyone`。终止进程前需获得用户确认。

**修复B——会话级生效(无需修改文件):**
```bash
FIFTYONE_DATABASE_NAME=fiftyone-<your-project> python your_script.py
修复C——升级版本以匹配数据库:
bash
pip install "fiftyone>=X.Y.Z"
修复D——全局配置(影响所有安装,需用户确认):
json
// ~/.fiftyone/config.json
{ "database_name": "fiftyone-<your-project>" }

Issue: FiftyOne Teams vs OSS Type Mismatch

问题:FiftyOne Teams与OSS类型不匹配

Symptom:
ConnectionError: Cannot connect to database type 'fiftyone' with client type 'fiftyone-teams'
(or the inverse)
Cause: Teams and OSS clients use incompatible database types and cannot share a database.
Diagnose:
python
import fiftyone as fo
print(fo.__version__)
print(fo.config.database_name)
print(fo.config.database_uri or "(internal MongoDB)")
try:
    fo.list_datasets()
except Exception as e:
    print(e)
Fix — Isolate the OSS environment:
bash
ACTIVATE=$(python -c "import sys; print(sys.prefix)")/bin/activate
echo $ACTIVATE   # confirm before editing
echo '
症状:
ConnectionError: Cannot connect to database type 'fiftyone' with client type 'fiftyone-teams'
(或相反情况)
原因: Teams和OSS客户端使用不兼容的数据库类型,无法共享同一数据库。
诊断:
python
import fiftyone as fo
print(fo.__version__)
print(fo.config.database_name)
print(fo.config.database_uri or "(internal MongoDB)")
try:
    fo.list_datasets()
except Exception as e:
    print(e)
修复——隔离OSS环境:
bash
ACTIVATE=$(python -c "import sys; print(sys.prefix)")/bin/activate
echo $ACTIVATE   # 确认后再编辑
echo '

Isolate FiftyOne database from Teams installation

Isolate FiftyOne database from Teams installation

export FIFTYONE_DATABASE_NAME=fiftyone-<your-project>' >> $ACTIVATE source $ACTIVATE

**Fix — Inspect Teams config if the error is unexpected:**
```bash
cat ~/.fiftyone/config.json 2>/dev/null || echo "(no config)"
python -c "import fiftyone as fo; import json; print(json.dumps(fo.config.serialize(), indent=2))"

export FIFTYONE_DATABASE_NAME=fiftyone-<your-project>' >> $ACTIVATE source $ACTIVATE

**修复——若错误异常,检查Teams配置:**
```bash
cat ~/.fiftyone/config.json 2>/dev/null || echo "(no config)"
python -c "import fiftyone as fo; import json; print(json.dumps(fo.config.serialize(), indent=2))"

Adding a New Issue

添加新问题

  1. Add a row to the Issue Index
  2. Add a
    ## Issue: <Name>
    section with: SymptomCauseFix
  3. Keep it self-contained — each section should be readable in isolation

  1. 在问题索引中添加一行
  2. 添加
    ## Issue: <名称>
    章节,包含:症状原因修复方案
  3. 保持内容独立——每个章节应可单独阅读

Resources

资源