Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connection adapters were found for 'ftp://ftp.expasy.org/databases/rhea/rhea-release.properties' #39

Closed
hrshdhgd opened this issue Mar 16, 2024 · 5 comments · Fixed by #40

Comments

@hrshdhgd
Copy link
Contributor

hrshdhgd commented Mar 16, 2024

This error is not consistent and happens abruptly with no pattern. Here's what's going on:

I'm trying to get the relations dataframe through pyobo using

  rhea_relation = get_relations_df("rhea")

This in turn calls

    version = get_version(prefix)

get_version() in pyobo looks like this

def get_version(prefix: str) -> Optional[str]:
    """Get the version for the resource, if available.

    :param prefix: the resource name
    :return: The version if available else None
    """
    try:
        version = bioversions.get_version(prefix)
    except KeyError:
        pass  # this prefix isn't available from bioversions
    except Exception as e:
        raise ValueError(f"[{prefix}] could not get version from bioversions") from e
    else:
        if version:
            return version

When prefix == rhea it throws the following error:

*** requests.exceptions.InvalidSchema: No connection adapters were found for 'ftp://ftp.expasy.org/databases/rhea/rhea-release.properties'

Again, this does not happen consistently but does happen. It happened on my system (multiple times) as well as a colleague's system at a different time. I cannot pin-point what the reason could be. Any thoughts @cthoyt ?

@cthoyt
Copy link
Member

cthoyt commented Mar 18, 2024

not sure what's going on here. requests_ftp gets imported and monkeypatched in the rhea module:

requests_ftp.monkeypatch_session()

@cthoyt
Copy link
Member

cthoyt commented Mar 19, 2024

We could switch the URL to https://ftp.expasy.org/databases/rhea/rhea-release.properties and it would still work. That might be the safest solution

@hrshdhgd
Copy link
Contributor Author

I agree. Testing it right now. The only way I could make it work with ftp:/ was if I called requests_ftp.monkeypatch_session() right before get_relations_df() call in my project. Not sure if it is an optimal solution.

@hrshdhgd
Copy link
Contributor Author

.. and that worked!

@hrshdhgd
Copy link
Contributor Author

#40

cthoyt pushed a commit that referenced this issue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants