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

warning from compute_result #130

Closed
edzer opened this issue Aug 18, 2022 · 3 comments
Closed

warning from compute_result #130

edzer opened this issue Aug 18, 2022 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@edzer
Copy link
Member

edzer commented Aug 18, 2022

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
Copy link
Member

m-mohr commented Aug 18, 2022

Looks similar to #123

@edzer
Copy link
Member Author

edzer commented Aug 18, 2022

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
Copy link
Member

flahn commented Sep 16, 2022

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().

@m-mohr m-mohr added this to the 1.2.2 milestone Sep 27, 2022
@m-mohr m-mohr added the bug Something isn't working label Sep 27, 2022
@flahn flahn closed this as completed in bbabdee Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants