Skip to content

Commit

Permalink
Merge pull request #215 from UtrechtUniversity/develop
Browse files Browse the repository at this point in the history
v0.2.4
  • Loading branch information
chStaiger authored Jun 27, 2024
2 parents 1970de3 + c46d298 commit 2a50511
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
10 changes: 10 additions & 0 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ add this to the path on the command line: `export PATH="${PATH}:/home/your_usern
your shell to find the `ibridges` command. You would have to type the previous command every time you start a new shell, which can be inconvenient.
To fix this permanently, add the command to your `.bashrc` or `.zshrc` file in your home directory at the end of the file
(depending on your shell, type `echo ${SHELL}` to find out).


**Help, I'm getting a "NetworkError" while trying to transfer (large) files**
-----------------------------------------------------------------------------

This error is most likely to happen if you try to transfer a large file. The default timeout for iBridges is 25000 seconds,
which translates to roughly 7 hours. This should not cause issues during the actual transfer. However, if the calculation
of the checksum takes more than 7 hours (if the iRODS server is busy for example, or the file is many terabytes), then
you will get a network error. The checksum itself should still be created. You can increase the timeout in your `irods_environment.json`
file by adding a new entry with `"connection_timeout": 99999999999,`.
14 changes: 8 additions & 6 deletions ibridges/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def __init__(self,
raise TypeError(f"Error reading environment file '{irods_env_path}': "
f"expected dictionary, got {type(irods_env)}.")

if "connection_timeout" not in irods_env:
irods_env["connection_timeout"] = 25000
self.connection_timeout = irods_env.pop("connection_timeout", 25000)

self._password = password
self._irods_env: dict = irods_env
Expand Down Expand Up @@ -198,9 +197,11 @@ def close(self) -> None:
def authenticate_using_password(self) -> iRODSSession:
"""Authenticate with the iRODS server using a password."""
try:
irods_session = irods.session.iRODSSession(password=self._password,
**self._irods_env,
application_name=APP_NAME)
irods_session = irods.session.iRODSSession(
password=self._password,
**self._irods_env,
connection_timeout=self.connection_timeout,
application_name=APP_NAME)
_ = irods_session.server_version
except Exception as e:
raise _translate_irods_error(e) from e
Expand All @@ -212,7 +213,8 @@ def authenticate_using_auth_file(self) -> iRODSSession:
"""Authenticate with an authentication file."""
try:
irods_session = irods.session.iRODSSession(
irods_env_file=self._irods_env_path, application_name=APP_NAME)
irods_env_file=self._irods_env_path, application_name=APP_NAME,
connection_timeout=self.connection_timeout)
_ = irods_session.server_version
except NonAnonymousLoginWithoutPassword as e:
raise ValueError("No cached password found.") from e
Expand Down

0 comments on commit 2a50511

Please sign in to comment.