Skip to content

Getting OSError: [Errno 101] Network is unreachable when trying to initialize for the first time #47

Description

@poppingtonic

This is a repeated issue I have encountered when trying to initialize.
Here are the required environment variables added to the .env file:

RAVENVERSE_URL=http://server.ravenverse.ai
RAVENVERSE_FTP_HOST=server.ravenverse.ai
RAVENVERSE_FTP_URL=server.ravenverse.ai

The script:

import os
from dotenv import load_dotenv
import ravop as R

load_dotenv()

TOKEN = os.getenv('RAVENVERSE_TOKEN')
R.initialize(TOKEN)

Returns:

2024-03-06 20:02:48,742 [MainThread  ] [DEBUG]  Checking version of Ravop...
2024-03-06 20:02:49,280 [MainThread  ] [DEBUG]  Initializing...
2024-03-06 20:02:49,282 [MainThread  ] [DEBUG]  Creating FTP developer credentials...
2024-03-06 20:04:13,754 [MainThread  ] [DEBUG]  FTP Upload Blocksize:311296
2024-03-06 20:04:13,754 [MainThread  ] [DEBUG]  FTP User credentials:server.ravenverse.ai <secret> <secret>
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[4], line 1
----> 1 R.initialize(TOKEN)

File [~/src/ravop/ravop/core/__init__.py:76](http://localhost:9999/lab/tree/ravop/ravop/ravop/core/__init__.py#line=75), in initialize(ravenverse_token)
     72     g.ftp_upload_blocksize = 8192 * 1000
     74 g.logger.debug("FTP Upload Blocksize:{}".format(g.ftp_upload_blocksize))
---> 76 ftp_client = get_client(username=username, password=password)
     77 ftp_username = username
     78 ftp_password = password

File [~/src/ravop/ravop/core/ftp_client.py:34](http://localhost:9999/lab/tree/ravop/ravop/ravop/core/ftp_client.py#line=33), in get_client(username, password)
     32 def get_client(username, password):
     33     g.logger.debug("FTP User credentials:{} {} {}".format(RAVENVERSE_FTP_HOST, username, password))
---> 34     return FTPClient(host=RAVENVERSE_FTP_HOST, user=username, passwd=password)

File [~/src/ravop/ravop/core/ftp_client.py:11](http://localhost:9999/lab/tree/ravop/ravop/ravop/core/ftp_client.py#line=10), in FTPClient.__init__(self, host, user, passwd)
     10 def __init__(self, host, user, passwd):
---> 11     self.ftp = FTP(host)
     12     # self.ftp.set_debuglevel(2)
     13     self.ftp.set_pasv(True)

File [~/miniconda3/envs/snomedct/lib/python3.10/ftplib.py:121](http://localhost:9999/home/muhia/miniconda3/envs/snomedct/lib/python3.10/ftplib.py#line=120), in FTP.__init__(self, host, user, passwd, acct, timeout, source_address, encoding)
    119 self.timeout = timeout
    120 if host:
--> 121     self.connect(host)
    122     if user:
    123         self.login(user, passwd, acct)

File [~/miniconda3/envs/snomedct/lib/python3.10/ftplib.py:158](http://localhost:9999/home/muhia/miniconda3/envs/snomedct/lib/python3.10/ftplib.py#line=157), in FTP.connect(self, host, port, timeout, source_address)
    156     self.source_address = source_address
    157 sys.audit("ftplib.connect", self, self.host, self.port)
--> 158 self.sock = socket.create_connection((self.host, self.port), self.timeout,
    159                                      source_address=self.source_address)
    160 self.af = self.sock.family
    161 self.file = self.sock.makefile('r', encoding=self.encoding)

File [~/miniconda3/envs/snomedct/lib/python3.10/socket.py:845](http://localhost:9999/home/muhia/miniconda3/envs/snomedct/lib/python3.10/socket.py#line=844), in create_connection(address, timeout, source_address)
    843 if err is not None:
    844     try:
--> 845         raise err
    846     finally:
    847         # Break explicitly a reference cycle
    848         err = None

File [~/miniconda3/envs/snomedct/lib/python3.10/socket.py:833](http://localhost:9999/home/muhia/miniconda3/envs/snomedct/lib/python3.10/socket.py#line=832), in create_connection(address, timeout, source_address)
    831 if source_address:
    832     sock.bind(source_address)
--> 833 sock.connect(sa)
    834 # Break explicitly a reference cycle
    835 err = None

OSError: [Errno 101] Network is unreachable

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions