[BUG] ServiceListenTimeout when using FiftyOne in Visual Studio Code

See original GitHub issue

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04.7 LTS):
  • Linux Ubuntu 16.04
    
  • FiftyOne installed from (pip or source):
  • pip
  • FiftyOne version (run fiftyone --version):
  • 0.7.2
  • Python version:
  • 3.7.0

Commands to reproduce

As thoroughly as possible, please provide the Python and/or shell commands used to encounter the issue.

# commands here
python
import fiftyone

Describe the problem

Hello. Thank you for your product and your hard work. I have tried to install fiftyone on a remote server with Ubuntu 16.04 Below are the things I tried.

1.I tried running the following command before installing fiftyone, but I still have the below stacktrace: pip install --upgrade pip setuptools wheel

2.I also tried: pip install --index https://pypi.voxel51.com fiftyone-db-ubuntu1604 after installling fiftyone

3.Finally, I also installed mongoDB separately, but with no luck.

I have to mention that I also tried to install on a local Ubuntu 18.04.5 LTS system and this was ok. I was able to import the library in a python script.

If anything is unclear or you need more details, please let me know. Thank you

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

{“t”:{“$date”:“2021-02-04T16:19:47.231Z”},“s”:“I”, “c”:“CONTROL”, “id”:20697, “ctx”:“main”,“msg”:“Renamed existing log file”,“attr”:{“oldLogPath”:“/home/mars/.fiftyone/var/lib/mongo/log/mongo.log”,“newLogPath”:“/home/mars/.fiftyone/var/lib/mongo/log/mongo.log.2021-02-04T16-19-47”}} Subprocess [‘/usr/bin/mongod’, ‘–dbpath’, ‘/home/mars/.fiftyone/var/lib/mongo’, ‘–logpath’, ‘/home/mars/.fiftyone/var/lib/mongo/log/mongo.log’, ‘–port’, ‘0’, ‘–nounixsocket’] exited with error 100: Uncaught exception Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/init.py”, line 28, in <module> from fiftyone.public import * File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/public.py”, line 11, in <module> _database_service = fos.DatabaseService() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 199, in init super().init() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 80, in init self.start() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 287, in start food.set_default_port(self.port) File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 277, in port return self._wait_for_child_port() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 178, in _wait_for_child_port return find_port() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/retrying.py”, line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/retrying.py”, line 212, in call raise attempt.get() File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/retrying.py”, line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/six.py”, line 703, in reraise raise value File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/retrying.py”, line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File “/home/mars/anaconda3/envs/fifty/lib/python3.7/site-packages/fiftyone/core/service.py”, line 176, in find_port raise ServiceListenTimeout(etau.get_class_name(self), port) fiftyone.core.service.ServiceListenTimeout: fiftyone.core.service.DatabaseService failed to bind to port

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
collinmccarthycommented, Jul 16, 2021

@benjaminpkane Awesome, thank you!

In the meantime, I found a workaround for VSCode for others, as long as they’re not using mongodb for other things (I think). Worth a try at least.

Define a task to kill any mongodb processes before running debug:

In tasks.json:

{
    "tasks": [
        {
            "label": "Kill_Mongod",
            "type": "shell",
            "command": "pkill mongod"
        }
]}

And in launch.json:

{
    "configurations": [
        {
            "name": "Fiftyone_Download",
            "type": "python",
            "request": "launch",
            "preLaunchTask": "Kill_Mongod",
            "program": "~/fiftyone_download.py",
            "args": [
                "dataset_name=open-images-v6",
                "dataset_dir=/nvme/deep-learning/open-images-v6"
            ],
            "console": "integratedTerminal",
        }
]}

The key is the preLaunchTask above. Note if switching between debugging and the command line, you’ll need to manually run pkill mongod.

2reactions
benjaminpkanecommented, Feb 11, 2021

I was able to reproduce. Will resolve ASAP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Troubleshooting — FiftyOne 0.18.0 documentation
This error occurs when attempting to install FiftyOne with an unsupported Python version (either too old or too new). See the installation guide...
Read more >
Fixing Bugs in VS Code - YouTube
Learn how easy it is to fix bugs with VS Code with this live demo.
Read more >
Loading Open Images V6 and custom datasets with FiftyOne
Image-level labels*; Object bounding boxes*; Visual relationships*; Instance segmentation masks*; Localized narratives. *Loaded in this post.
Read more >
[BUG] fiftyone.core.service.DatabaseService failed to bind to port
pip install --upgrade pip setuptools wheel pip install fiftyone import fiftyone ... seeing this issue very frequenly happen in windows WSL2 + Vscode....
Read more >
Not able to get real time error in Visual code during python ...
There's a few things that need to be in place before VS Code can give you the live feedback you're after. You'll need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found