voxel51 / fiftyone

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

[BUG] Failed to launch FiftyOne app with GraphQL API Error #5203

Open leemengtw opened 2 days ago

leemengtw commented 2 days ago

Describe the problem

Failed to launch FiftyOne app with version 1.0.1.

Code to reproduce issue

The issue can be reproduced by following the official FiftyOne example:

Minimal code to reproduce (adapted from above notebook):

pip uninstall fiftyone fiftyone-brain fiftyone-db # remove existing fiftyone
pip install fiftyone==1.0.1
!pip install kaggle
!kaggle datasets download -d risangbaskoro/wlasl-processed
!mkdir wlasl-processed
!unzip wlasl-processed.zip -d wlasl-processed

main_path = './wlasl-processed/'
mp4_dir = main_path + "videos"

import fiftyone as fo

dataset = fo.Dataset.from_dir(dataset_dir=mp4_dir,dataset_type=fo.types.VideoDirectory)
session = fo.launch_app(dataset)
image
GraphQL API Error
localhost:38725: [Errno 111] Connection refused (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 674ddd61f39e616c7b09ed31, topology_type: Unknown, servers: [<ServerDescription ('localhost', 38725) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:38725: [Errno 111] Connection refused (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/graphql/execution/execute.py", line 1038, in await_result
2    return build_response(await result, errors)  # type: ignore
3  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/graphql/execution/execute.py", line 453, in get_results
4    await gather(*(results[field] for field in awaitable_fields)),
5  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/graphql/execution/execute.py", line 537, in await_result
6    self.handle_field_error(error, return_type)
7  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/graphql/execution/execute.py", line 571, in handle_field_error
8    raise error
9  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/graphql/execution/execute.py", line 530, in await_result
10    return_type, field_nodes, info, path, await result
11  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/strawberry/schema/schema_converter.py", line 750, in _async_resolver
12    return await await_maybe(
13  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/strawberry/utils/await_maybe.py", line 12, in await_maybe
14    return await value
15  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/fiftyone/server/query.py", line 435, in estimated_dataset_count
16    return await info.context.db.datasets.estimated_document_count()
17  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/concurrent/futures/thread.py", line 58, in run
18    result = self.fn(*self.args, **self.kwargs)
19  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/collection.py", line 1810, in estimated_document_count
20    return self._retryable_non_cursor_read(_cmd, None, operation=_Op.COUNT)
21  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/collection.py", line 1910, in _retryable_non_cursor_read
22    return client._retryable_read(func, self._read_preference_for(s), s, operation)
23  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1540, in _retryable_read
24    return self._retry_internal(
25  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/_csot.py", line 108, in csot_wrapper
26    return func(self, *args, **kwargs)
27  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1507, in _retry_internal
28    ).run()
29  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 2353, in run
30    return self._read() if self._is_read else self._write()
31  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 2483, in _read
32    self._server = self._get_server()
33  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 2439, in _get_server
34    return self._client._select_server(
35  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1322, in _select_server
36    server = topology.select_server(
37  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/topology.py", line 368, in select_server
38    server = self._select_server(
39  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/topology.py", line 346, in _select_server
40    servers = self.select_servers(
41  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/topology.py", line 253, in select_servers
42    server_descriptions = self._select_servers_loop(
43  File "/weka/home-meng/miniconda3/envs/py310/lib/python3.10/site-packages/pymongo/topology.py", line 303, in _select_servers_loop
44    raise ServerSelectionTimeoutError(
Trace
1AppError@http://localhost:5151/assets/index-o2FK2t37.js:593:54430
2GraphQLError@http://localhost:5151/assets/index-o2FK2t37.js:593:54578
3@http://localhost:5151/assets/index-o2FK2t37.js:625:15981

System information

Other info/logs

I can open the FiftyOne app with 1.0.2 version but encountered video related issue

and was recommended to use 1.0.1 by @benjaminpkane .

I followed the uninstall guide here to remove 1.0.2 version and reinstall 1.0.1 version. Please kindly let me know how we can solve this, thanks!

pip uninstall fiftyone fiftyone-brain fiftyone-db
pip install fiftyone==1.0.1

Willingness to contribute

benjaminpkane commented 1 day ago

Ubuntu 20.04 is quite old, it may be a fiftyone-db issue. Using your own MongoDB connection may be more reliable