Open-EO / openeo-r-client

R client package for working with openEO backends
https://open-eo.github.io/openeo-r-client
Apache License 2.0
61 stars 17 forks source link

warning from compute_result #130

Closed edzer closed 2 years ago

edzer commented 2 years ago

Here is a warning (elevated to error) + traceback, let me know if you need the full script to reproduce.

> compute_result(result, format = "NetCDF", output_file = "ndvi.nc", con = con)
Error serializing parameter 'spatial_extent' in process node 'load_collection_MGYIR4202S' :(converted from warning) 'length(x) = 4 > 1' in coercion to 'logical(1)'
> traceback()
21: readline("Press <enter> to proceed:")
20: oauth_flow_device(client = client, auth_url = private$endpoints$device_authorization_endpoint, 
        scope = paste0(private$scopes, collapse = " "), pkce = TRUE)
19: rlang::with_interactive(oauth_flow_device(client = client, auth_url = private$endpoints$device_authorization_endpoint, 
        scope = paste0(private$scopes, collapse = " "), pkce = TRUE), 
        value = private$isInteractive())
18: private$auth_client$login()
17: doTryCatch(return(expr), name, parentenv, handler)
16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
15: tryCatchList(expr, classes, parentenv, handlers)
14: tryCatch({
        provider = .get_oidc_provider(provider)
        auth_pkce = "authorization_code+pkce"
        device_pkce = "urn:ietf:params:oauth:grant-type:device_code+pkce"
        device_code = "urn:ietf:params:oauth:grant-type:device_code"
        has_default_clients = "default_clients" %in% names(provider) && 
            length(provider[["default_clients"]]) > 0
        client_id_given = "client_id" %in% names(config)
        if (length(config) > 0) {
            if (!is.list(config)) {
                stop("parameter 'config' is not a named list")
            }
            full_credentials = all(c("client_id", "secret") %in% 
                names(config))
            is_auth_code = length(config$grant_type) > 0 && config$grant_type == 
                "authorization_code"
            if (full_credentials && (is_auth_code || is.null(config$grant_type))) {
                private$auth_client = OIDCAuthCodeFlow$new(provider = provider, 
                    config = config, force = TRUE)
            }
     ...
13: withCallingHandlers(expr, warning = function(w) if (inherits(w, 
        classes)) tryInvokeRestart("muffleWarning"))
12: suppressWarnings({
        tryCatch({
            provider = .get_oidc_provider(provider)
            auth_pkce = "authorization_code+pkce"
            device_pkce = "urn:ietf:params:oauth:grant-type:device_code+pkce"
            device_code = "urn:ietf:params:oauth:grant-type:device_code"
            has_default_clients = "default_clients" %in% names(provider) && 
                length(provider[["default_clients"]]) > 0
            client_id_given = "client_id" %in% names(config)
            if (length(config) > 0) {
                if (!is.list(config)) {
                    stop("parameter 'config' is not a named list")
                }
                full_credentials = all(c("client_id", "secret") %in% 
                    names(config))
                is_auth_code = length(config$grant_type) > 0 && config$grant_type == 
                    "authorization_code"
                if (full_credentials && (is_auth_code || is.null(config$grant_type))) {
                    private$auth_client = OIDCAuthCodeFlow$new(provider = provider, 
                      config = config, force = TRUE)
     ...
11: private$loginOIDC(provider = provider, config = config)
10: doTryCatch(return(expr), name, parentenv, handler)
9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
8: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch({
       if (!is.null(user) && !is.null(password)) {
           private$loginBasic(user = user, password = password)
       }
       else {
           if (is.null(provider)) {
               providers = list_oidc_providers()
               provider = providers[[1]]
               if (is_null(provider)) {
                   message("Either a provider needs to be provided, or a username and password for basic authentication.")
                   return(invisible(self))
               }
           }
           private$loginOIDC(provider = provider, config = config)
       }
       invisible(self)
   }, error = .capturedErrorToMessage)
6: con$login(user = user, password = password, provider = provider, 
       config = config)
5: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
3: tryCatchList(expr, classes, parentenv, handlers)
2: tryCatch({
       con = .assure_connection(con)
       return(con$login(user = user, password = password, provider = provider, 
           config = config))
   }, error = .capturedErrorToMessage)
1: login()
m-mohr commented 2 years ago

Looks similar to #123

edzer commented 2 years ago

complete output, only as warnings:

Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 4 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 4 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 2 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'Warning: 'length(x) = 12 > 1' in coercion to 'logical(1)'[1] "ndvi.nc"
flahn commented 2 years ago

The traceback shows the complete authentication negotiation with the server. But the error / warning occurs when serializing the parameter "spatial_extent" in that script. Can you provide the value of "spatial_extent" of load_collection? Might be that there is an uncaptured is.na check for some classes that need wrapping with all().