EDIorg / ecocomDP

A dataset design pattern and R package for ecological community data.
https://ediorg.github.io/ecocomDP/
Other
32 stars 13 forks source link

CRAN Checks Failing Due to Network Issues #154

Closed clnsmth closed 1 month ago

clnsmth commented 1 month ago

CRAN checks began failing around the beginning of August:

 ── Failure ('test_validate_arguments.R:323:3'): read_data()
────────────────────
     `validate_arguments("read_data", as.list(list(id = 1)))` threw an
error with unexpected message.
     Expected match: "Input 'id' should be character."
     Actual message: "Timeout was reached: [pasta.lternet.edu] SSL
connection timeout"

── Failure ('test_validate_arguments.R:425:3'): save_data()
────────────────────
     `validate_arguments("read_data", as.list(list(path =
"/some/invalid/path")))` threw an error with unexpected message.
     Expected match: "Input 'path' .+ doesn't exist."
     Actual message: "Timeout was reached: [pasta.lternet.edu] SSL
connection timeout"

The messages suggest network issues that may be related to the network re-factoring at the University of New Mexico (where the ED repository is located) that was resulted in issues for other EDI services.

Though the network and CRAN checks have since recovered, these functions should fail gracefully within an informative message.

clnsmth commented 1 month ago

The fix introduced in commit a97de6253404b6b3ffae0091abbf4c90447a0900 decreases the likelihood of failures, but it doesn't handle errors "gracefully". Instead of returning a null value and informative message, it returns an informative error message. This is a partial fix.

To fully address the issue, the codebase would require significant refactoring of error handling and return values. Until this refactoring is complete, clients should wrap function calls with try-except blocks to handle potential network errors.

The current approach was originally chosen to simplify handling cases where network resources are unavailable. By checking for connectivity at the beginning of functions, we avoid more complex error handling later on.