MarkEdmondson1234 / googleCloudRunner

Easy R scripts on Google Cloud Platform via Cloud Run, Cloud Build and Cloud Scheduler
https://code.markedmondson.me/googleCloudRunner/
Other
81 stars 26 forks source link

Intermittent error with cr_deploy_plumber #133

Closed dcaud closed 2 years ago

dcaud commented 2 years ago

Sometimes the code below works, other times it seems to get stuck with the message "2021-10-03 17:14:10 -- File size detected as 155.4 K" until it times out and gives the errors below.

cr <- cr_deploy_plumber(my_plumber_folder,
                         timeout = 3500)

Let me know what additional info would be needed. My internet connection seems stable, but perhaps unstable internet connection is causing this problem?

ℹ 2021-10-03 17:03:11 > Using existing Dockerfile found in folder ℹ 2021-10-03 17:03:11 > Uploading api folder for Cloud Run ℹ 2021-10-03 17:03:11 > Dockerfile found in api

── #Deploy docker build for image: .... ──────────────────────────

── #Upload api to .... ──────────────────────────────────────────────── ℹ 2021-10-03 17:03:11 > Uploading api.tar.gz to ... 2021-10-03 17:03:11 -- File size detected as 155.4 Kb Request failed [408]. Retrying in 1.8 seconds... Error in curl::curl_fetch_memory(url, handle = handle): HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Request failed [ERROR]. Retrying in 3.4 seconds... Error in curl::curl_fetch_memory(url, handle = handle) : HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Error: Request failed before finding status code: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Session Info

sessionInfo() R version 4.1.1 (2021-08-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] googleCloudRunner_0.4.1 future.callr_0.6.1 furrr_0.2.3
[4] future.apply_1.8.1 future_1.22.1 purrr_0.3.4
[7] Rook_1.1-1 magick_2.7.3 magrittr_2.0.1
[10] plumber_1.1.0

loaded via a namespace (and not attached): [1] progress_1.2.2 qpdf_1.1 webutils_1.1
[4] listenv_0.8.0 gargle_1.2.0 swagger_3.33.1
[7] vctrs_0.3.8 yaml_2.2.1 rlang_0.4.11
[10] later_1.3.0 glue_1.4.2 lifecycle_1.0.1
[13] zip_2.2.0 codetools_0.2-18 memoise_2.0.0
[16] callr_3.7.0 fastmap_1.1.0 httpuv_1.6.3
[19] ps_1.6.0 parallel_4.1.1 curl_4.3.2
[22] pdftools_3.0.1 Rcpp_1.0.7 openssl_1.4.5
[25] promises_1.2.0.1 cachem_1.0.6 jsonlite_1.7.2
[28] mime_0.12 parallelly_1.28.1 fs_1.5.0
[31] googleAuthR_1.4.0 brew_1.0-6 jose_1.1.0
[34] askpass_1.1 hms_1.1.1 digest_0.6.28
[37] stringi_1.7.4 processx_3.5.2 googleCloudStorageR_0.6.0 [40] cli_3.0.1 tools_4.1.1 crayon_1.4.1
[43] pkgconfig_2.0.3 ellipsis_0.3.2 prettyunits_1.1.1
[46] rsconnect_0.8.24 assertthat_0.2.1 httr_1.4.2
[49] rstudioapi_0.13 R6_2.5.1 globals_0.14.0
[52] compiler_4.1.1

MarkEdmondson1234 commented 2 years ago

Is it possible an existing api.tar.gz file is in the folder? It sounds like the upload of it to Cloud storage is timing out for some reason.

On 3 Oct 2021, at 23.23, Ryan @.***> wrote:

 Sometimes the code below works, other times it seems to get stuck with the message "2021-10-03 17:14:10 -- File size detected as 155.4 K" until it times out and gives the errors below.

cr <- cr_deploy_plumber(my_plumber_folder, timeout = 3500) Let me know what additional info would be needed. My internet connection seems stable, but perhaps unstable internet connection is causing this problem?

ℹ 2021-10-03 17:03:11 > Using existing Dockerfile found in folder ℹ 2021-10-03 17:03:11 > Uploading api folder for Cloud Run ℹ 2021-10-03 17:03:11 > Dockerfile found in api

── #Deploy docker build for image: .... ──────────────────────────

── #Upload api to .... ──────────────────────────────────────────────── ℹ 2021-10-03 17:03:11 > Uploading api.tar.gz to ... 2021-10-03 17:03:11 -- File size detected as 155.4 Kb Request failed [408]. Retrying in 1.8 seconds... Error in curl::curl_fetch_memory(url, handle = handle): HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Request failed [ERROR]. Retrying in 3.4 seconds... Error in curl::curl_fetch_memory(url, handle = handle) : HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Error: Request failed before finding status code: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Session Info

sessionInfo() R version 4.1.1 (2021-08-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] googleCloudRunner_0.4.1 future.callr_0.6.1 furrr_0.2.3 [4] future.apply_1.8.1 future_1.22.1 purrr_0.3.4 [7] Rook_1.1-1 magick_2.7.3 magrittr_2.0.1 [10] plumber_1.1.0

loaded via a namespace (and not attached): [1] progress_1.2.2 qpdf_1.1 webutils_1.1 [4] listenv_0.8.0 gargle_1.2.0 swagger_3.33.1 [7] vctrs_0.3.8 yaml_2.2.1 rlang_0.4.11 [10] later_1.3.0 glue_1.4.2 lifecycle_1.0.1 [13] zip_2.2.0 codetools_0.2-18 memoise_2.0.0 [16] callr_3.7.0 fastmap_1.1.0 httpuv_1.6.3 [19] ps_1.6.0 parallel_4.1.1 curl_4.3.2 [22] pdftools_3.0.1 Rcpp_1.0.7 openssl_1.4.5 [25] promises_1.2.0.1 cachem_1.0.6 jsonlite_1.7.2 [28] mime_0.12 parallelly_1.28.1 fs_1.5.0 [31] googleAuthR_1.4.0 brew_1.0-6 jose_1.1.0 [34] askpass_1.1 hms_1.1.1 digest_0.6.28 [37] stringi_1.7.4 processx_3.5.2 googleCloudStorageR_0.6.0 [40] cli_3.0.1 tools_4.1.1 crayon_1.4.1 [43] pkgconfig_2.0.3 ellipsis_0.3.2 prettyunits_1.1.1 [46] rsconnect_0.8.24 assertthat_0.2.1 httr_1.4.2 [49] rstudioapi_0.13 R6_2.5.1 globals_0.14.0 [52] compiler_4.1.1

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dcaud commented 2 years ago

Yes, there is a api.tar.gz in the folder. Should that be programmatically deleted to prevent this error?

MarkEdmondson1234 commented 2 years ago

Could you see if it solves your issue deleting it? It may not.

MarkEdmondson1234 commented 2 years ago

The dockerfiles should be in a tempdir now and should not allow this to happen, will close but please reopen if it happens again.