voxel51 / fiftyone

Refine high-quality datasets and visual AI models
https://fiftyone.ai
Apache License 2.0
8.88k stars 563 forks source link

Could not connect to session even tho the local app is launched [BUG] #4291

Open Enzawdo opened 7 months ago

Enzawdo commented 7 months ago

Instructions

Thank you for submitting an issue. Please refer to our issue policy for information on what types of issues we address.

  1. Please fill in this template to ensure a timely and thorough response
  2. Remove the section instructions but leave the section header
  3. Place an "x" between the brackets next to an option if it applies. For example:
    • [x] Selected option
  4. Please delete everything above this line before submitting the issue

Describe the problem

Describe the problem clearly here. Include descriptions of the expected behavior and the actual behavior.

Code to reproduce issue

I have installed mongodb on my namespace in kubernetes. To connect to it i use:

export FIFTYONE_DATABASE_URI=mongodb://root:root@mongodb_url

#dataset1 = fo.Dataset("my_first_dataset")
    # A name for the dataset
    # The directory containing the source images
    data_path = "img/images"

    # The path to the COCO labels JSON file
    labels_path = "img/annotations/instances_default.json"

    # Import the dataset
    dataset = fo.Dataset.from_dir(
        dataset_type=fo.types.COCODetectionDataset,
        data_path=data_path,
        labels_path=labels_path,
    )
    session = fo.launch_app(dataset= dataset,port=5151)
    session.wait(-1)

This is the output App launched. Point your web browser to http://localhost:5151

Could not connect session, trying again in 10 seconds

And i get this in the webbrowser

System information

Other info/logs

When i look at the localhost page i see that i get a 403 error. I can see that it's hosting fiftyone app but the data is missing.

I see this:

Welcome to FiftyOne!
It looks like you are not connected to a session
Local sessions
Remote sessions
Local sessions
Here's how to connect to a local session from Python:

import fiftyone as fo

# Load your FiftyOne dataset
dataset = fo.load_dataset(...)

# Launch the app
session = fo.launch_app(dataset, port=NaN)

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?

benjaminpkane commented 7 months ago

Hi @Enzawdo. Based in the information you've provided, it sounds like you are trying to connect to your session through a proxy. We have documentation for that here.

There may also be an issue with the dataset you are trying to launch. Does launching the session without dataset resolve the issue?

session = fo.launch_app() #no dataset
rikirolly commented 4 months ago

I am facing the same issue:

0.24.0
Could not connect session, trying again in 10 seconds
App launched. Point your web browser to http://localhost:5151

The page respond with this content:

<html>
<body>
<!--StartFragment-->
<!DOCTYPE html>
--
  | <html lang="en">
  | <head>
  | <link rel="icon" href="./favicon.ico" />
  | <link rel="preload" href="https://fonts.googleapis.com/css2?family=Palanquin&display=swap" as="font" type="font/woff" crossorigin>
  | 
  | <meta name="description" content="Explore, Analyze, Curate" />
  | <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  | <meta name="referrer" content="no-referrer" />
  | <title>FiftyOne</title>
  | <script type="module" crossorigin src="./assets/index.c73973d5.js"></script>
  | <link rel="stylesheet" href="./assets/index.8b6bb0a6.css">
  | </head>
  | <body>
  | <div id="root"></div>
  | <div id="teams"></div>
  | <div id="modal"></div>
  | <div id="colorModal"></div>
  |  
  | </body>
  | </html>

<!--EndFragment-->
</body>
</html><!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="icon" href="[./favicon.ico](http://localhost:5151/favicon.ico)" />
    <link rel="preload" href="https://fonts.googleapis.com/css2?family=Palanquin&display=swap" as="font" type="font/woff" crossorigin>
    <meta charset="UTF-8" />
    <meta name="description" content="Explore, Analyze, Curate" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="referrer" content="no-referrer" />
    <title>FiftyOne</title>
    <script type="module" crossorigin src="[./assets/index.c73973d5.js](http://localhost:5151/assets/index.c73973d5.js)"></script>
    <link rel="stylesheet" href="[./assets/index.8b6bb0a6.css](http://localhost:5151/assets/index.8b6bb0a6.css)">
  </head>
  <body>
    <div id="root"></div>
    <div id="teams"></div>
    <div id="modal"></div>
    <div id="colorModal"></div>

  </body>
</html>

Is it a way to debug the problem? Some kind o logging?

Edward-YS commented 3 months ago

嗨 .根据您提供的信息,听起来您正在尝试通过代理连接到您的会话。我们这里有这方面的文档。

您尝试启动的数据集也可能存在问题。在没有数据集的情况下启动会话是否能解决问题?

session = fo.launch_app() #no dataset

I tried but it didn't work.

Edward-YS commented 3 months ago

指示

感谢您提交问题。请参阅我们的问题政策,了解我们解决哪些类型的问题。

  1. 请填写此模板,以确保及时、彻底的回复
  2. 删除章节说明,但保留章节标题
  3. 在选项旁边的括号之间放置一个“x”(如果适用)。例如:
    • [x] 已选择的选项
  4. 在提交问题之前,请删除此行上方的所有内容

描述问题

在此处清楚地描述问题。包括对预期行为和实际行为的描述。

重现问题的代码

我已经在kubernetes的命名空间上安装了mongodb。要连接到它,我使用:

导出 FIFTYONE_DATABASE_URI=mongodb://root:root@mongodb_url

#dataset1 = fo.Dataset("my_first_dataset")
    # A name for the dataset
    # The directory containing the source images
    data_path = "img/images"

    # The path to the COCO labels JSON file
    labels_path = "img/annotations/instances_default.json"

    # Import the dataset
    dataset = fo.Dataset.from_dir(
        dataset_type=fo.types.COCODetectionDataset,
        data_path=data_path,
        labels_path=labels_path,
    )
    session = fo.launch_app(dataset= dataset,port=5151)
    session.wait(-1)

这是应用程序启动的输出。将 Web 浏览器指向 http://localhost:5151

无法连接会话,请在 10 秒后重试

我在网络浏览器中得到这个

系统信息

  • Openshift(开放式移位)
  • 操作系统平台和分发Linux Ubuntu 22.04:
  • Python 版本 3.11.8
  • FiftyOne 版本 0.23.5:
  • 从 pip 安装的 FiftyOne
  • Mongodb 版本 7.0.8 bitnami helmchart

其他信息/日志

当我查看localhost页面时,我看到我收到403错误。我可以看到它正在托管 fiftyone 应用程序,但数据丢失了。

我看到这个:

Welcome to FiftyOne!
It looks like you are not connected to a session
Local sessions
Remote sessions
Local sessions
Here's how to connect to a local session from Python:

import fiftyone as fo

# Load your FiftyOne dataset
dataset = fo.load_dataset(...)

# Launch the app
session = fo.launch_app(dataset, port=NaN)

愿意做出贡献

FiftyOne 社区鼓励 bug 修复贡献。您或您组织的其他成员是否愿意为 FiftyOne 代码库贡献此错误的修复程序?

  • [ ] 是的。我可以独立为此错误提供修复程序
  • [ ] 是的。我愿意在 FiftyOne 社区的指导下为这个错误提供修复
  • [X ] 号。我目前无法贡献错误修复

Have you solved the problems? I have this problem,too.