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

Failing gracefully edge case #235

Closed
wcornwell opened this issue Jun 19, 2024 · 5 comments
Closed

Failing gracefully edge case #235

wcornwell opened this issue Jun 19, 2024 · 5 comments
Assignees

Comments

@wcornwell
Copy link
Contributor

There is still a CI fail that arises when the network on the computer is up but github specifically is down. That doesn't happen that frequently, but does seem to cause an issue from time to time.

@wcornwell
Copy link
Contributor Author

wcornwell commented Jun 19, 2024

something like

   # Check for errors in the response
    if (inherits(response, "try-error") || httr::http_error(response) || !network) {
      message("API currently down, try again later")
      return(invisible(NULL))
    }

might help, but there may need to be changes to the tests also

@wcornwell
Copy link
Contributor Author

nevermind that approach didn't help, need to get the full error next time it occurs

@wcornwell
Copy link
Contributor Author

 test_check("APCalign")
Downloading...
trying URL 'https://github.com/traitecoevo/APCalign/releases/download/0.0.2.9000/apc.parquet'
Content type 'application/octet-stream' length 10895737 bytes (10.4 MB)
==================================================
downloaded 10.4 MB

File downloaded successfully.
trying URL 'https://github.com/traitecoevo/APCalign/releases/download/0.0.2.9000/apni.parquet'
Content type 'application/octet-stream' length 27817594 bytes (26.5 MB)
==================================================
downloaded 26.5 MB

File downloaded successfully.

Loading resources into memory...

===========================
=====================================================
================================================================================
...done
API currently down, try again later
API currently down, try again later
Downloading...
  6.       ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
  7.       │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8.       │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9.       │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 10.       └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7
── Warning ('test-connection.R:11:3'): Complains when network is down ──────────
cannot open URL 'https://github.com/traitecoevo/APCalign/releases/download//apni.parquet': HTTP status was '404 Not Found'
Backtrace:
     ▆
  1. ├─testthat::expect_visible(dataset_access_function()) at test-connection.R:11:3
  2. │ └─base::withVisible(call)
  3. └─APCalign:::dataset_access_function()
  4.   └─APCalign:::dataset_get(version, path) at APCalign/R/load_taxonomic_resources.R:322:7
  5.     └─APCalign (local) download_and_read_parquet(apni.url, path_to_apni) at APCalign/R/load_taxonomic_resources.R:475:5
  6.       ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
  7.       │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8.       │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9.       │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 10.       └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7
── Warning ('test-connection.R:12:3'): Complains when network is down ──────────
downloaded length 0 != reported length 9
Backtrace:
    ▆
 1. ├─testthat::expect_visible(dataset_get()) at test-connection.R:12:3
 2. │ └─base::withVisible(call)
 3. └─APCalign:::dataset_get()
 4.   └─APCalign (local) download_and_read_parquet(apc.url, path_to_apc) at APCalign/R/load_taxonomic_resources.R:469:5
 5.     ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
 6.     │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 7.     │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8.     │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 9.     └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7
── Warning ('test-connection.R:12:3'): Complains when network is down ──────────
cannot open URL 'https://github.com/traitecoevo/APCalign/releases/download//apc.parquet': HTTP status was '404 Not Found'
Backtrace:
    ▆
 1. ├─testthat::expect_visible(dataset_get()) at test-connection.R:12:3
 2. │ └─base::withVisible(call)
 3. └─APCalign:::dataset_get()
 4.   └─APCalign (local) download_and_read_parquet(apc.url, path_to_apc) at APCalign/R/load_taxonomic_resources.R:469:5
 5.     ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
 6.     │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 7.     │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8.     │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 9.     └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7
── Warning ('test-connection.R:12:3'): Complains when network is down ──────────
downloaded length 0 != reported length 9
Backtrace:
    ▆
 1. ├─testthat::expect_visible(dataset_get()) at test-connection.R:12:3
 2. │ └─base::withVisible(call)
 3. └─APCalign:::dataset_get()
 4.   └─APCalign (local) download_and_read_parquet(apni.url, path_to_apni) at APCalign/R/load_taxonomic_resources.R:475:5
 5.     ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
 6.     │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 7.     │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8.     │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 9.     └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7
── Warning ('test-connection.R:12:3'): Complains when network is down ──────────
cannot open URL 'https://github.com/traitecoevo/APCalign/releases/download//apni.parquet': HTTP status was '404 Not Found'
Backtrace:
    ▆
 1. ├─testthat::expect_visible(dataset_get()) at test-connection.R:12:3
 2. │ └─base::withVisible(call)
 3. └─APCalign:::dataset_get()
 4.   └─APCalign (local) download_and_read_parquet(apni.url, path_to_apni) at APCalign/R/load_taxonomic_resources.R:475:5
 5.     ├─base::tryCatch(...) at APCalign/R/load_taxonomic_resources.R:447:5
 6.     │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 7.     │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8.     │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 9.     └─utils::download.file(url, path_to_file, mode = "wb") at APCalign/R/load_taxonomic_resources.R:448:7

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-connection.R:10:3'): Complains when network is down ──────────
default_version() does not invisibly

[ FAIL 1 | WARN 8 | SKIP 0 | PASS 102 ]
Error: Error: Test failures

@wcornwell
Copy link
Contributor Author

wcornwell added a commit that referenced this issue Jul 31, 2024
wcornwell added a commit that referenced this issue Jul 31, 2024
@wcornwell
Copy link
Contributor Author

fixed here: a99fc67

wcornwell added a commit that referenced this issue Jul 31, 2024
* Bump version number (1.0.0.9000)

[skip ci]

* spelling fixes and removing special Mac install instructions (#229)

* spelling fixes and removing special Mac install instructions

* adding mac back into CI

* Cran preparations (#230)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* cleaning up (#231)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* Removed auto package version in citation

* Updated CRAN comments

* Fixed typo in CITATION

* Resubmitted

---------

Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>

* fixing badges

* Tweaks (#234)

* fix example

* fix vignette paths

* testing for issue #235

* still working on #235

* one more try to find the edge case

* another edge case?

* reformat code in release file

* another edge case

* reverting previous commit to documentation

* adding check on resources to all functions that need resources

* bumping version number and updating readme

* missed two checking spots

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>
wcornwell added a commit that referenced this issue Aug 13, 2024
* dealing with cran and CI issues (#236)

* Bump version number (1.0.0.9000)

[skip ci]

* spelling fixes and removing special Mac install instructions (#229)

* spelling fixes and removing special Mac install instructions

* adding mac back into CI

* Cran preparations (#230)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* cleaning up (#231)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* Removed auto package version in citation

* Updated CRAN comments

* Fixed typo in CITATION

* Resubmitted

---------

Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>

* fixing badges

* Tweaks (#234)

* fix example

* fix vignette paths

* testing for issue #235

* still working on #235

* one more try to find the edge case

* another edge case?

* reformat code in release file

* another edge case

* reverting previous commit to documentation

* adding check on resources to all functions that need resources

* bumping version number and updating readme

* missed two checking spots

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>

* Update new

* fixing bug in hidden function and re-naming a bit

* adding new genus in family function

* testing?

* namespaces

* testing testing

* forgot how namespaces work

* so many details *sigh*

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>
wcornwell added a commit that referenced this issue Aug 13, 2024
* Bump version number (1.0.0.9000)

[skip ci]

* spelling fixes and removing special Mac install instructions (#229)

* spelling fixes and removing special Mac install instructions

* adding mac back into CI

* Cran preparations (#230)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* cleaning up (#231)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* Removed auto package version in citation

* Updated CRAN comments

* Fixed typo in CITATION

* Resubmitted

---------

Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>

* fixing badges

* Tweaks (#234)

* fix example

* fix vignette paths

* testing for issue #235

* still working on #235

* one more try to find the edge case

* another edge case?

* reformat code in release file

* another edge case

* reverting previous commit to documentation

* adding check on resources to all functions that need resources

* bumping version number and updating readme

* missed two checking spots

* 238 genus family lookup (#239)

* dealing with cran and CI issues (#236)

* Bump version number (1.0.0.9000)

[skip ci]

* spelling fixes and removing special Mac install instructions (#229)

* spelling fixes and removing special Mac install instructions

* adding mac back into CI

* Cran preparations (#230)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* cleaning up (#231)

* Added example for default_version, updated LICENSE year, added R CMD CHECK results

* Comment about Tidy and Mac and HTML validation

* Updated CITATION file

* Updated version numbers

* Removed auto package version in citation

* Updated CRAN comments

* Fixed typo in CITATION

* Resubmitted

---------

Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>

* fixing badges

* Tweaks (#234)

* fix example

* fix vignette paths

* testing for issue #235

* still working on #235

* one more try to find the edge case

* another edge case?

* reformat code in release file

* another edge case

* reverting previous commit to documentation

* adding check on resources to all functions that need resources

* bumping version number and updating readme

* missed two checking spots

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>

* Update new

* fixing bug in hidden function and re-naming a bit

* adding new genus in family function

* testing?

* namespaces

* testing testing

* forgot how namespaces work

* so many details *sigh*

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>

* bumping version number and updating news

* update readme

* no empty lines in description

---------

Co-authored-by: Daniel Falster <daniel.falster@unsw.edu.au>
Co-authored-by: Fonti Kar <f.kar@unsw.edu.au>
Co-authored-by: Dave Slager <slager@users.noreply.github.com>
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

No branches or pull requests

2 participants