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

method '.cube_token_generator' error in sits_cube_copy() function #1303

Open
zplzmzmpl opened this issue Mar 11, 2025 · 0 comments
Open

method '.cube_token_generator' error in sits_cube_copy() function #1303

zplzmzmpl opened this issue Mar 11, 2025 · 0 comments
Assignees
Labels

Comments

@zplzmzmpl
Copy link

Error Detail:
Error: .cube_token_generator: invalid token to access data provider
Traceback:

  1. .cube_token_generator(cube)
  2. .cube_token_generator.mpc_cube(cube)
  3. .check_that(.has(res_content))
  4. stop(msg, call. = FALSE)
  5. .handleSimpleError(function (cnd)
    . {
    . watcher$capture_plot_and_output()
    . cnd <- sanitize_call(cnd)
    . watcher$push(cnd)
    . switch(on_error, continue = invokeRestart("eval_continue"),
    . stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error",
    . cnd))
    . }, ".cube_token_generator: invalid token to access data provider",
    . base::quote(NULL))

Code:
1. Use MPC provider to obtain 51PTS tiles S2-L2A images(WORKS WELL)
s2_cube <- sits_cube(
source = "MPC",
collection = "SENTINEL-2-L2A",# <-Bottom of the atmosphere reflectance data
tiles = c("51PTS"),# need use vector c()
bands = c("B02", "B03", "B04", "B08", "CLOUD"),
start_date = "2023-04-01",
end_date = "2024-03-01"
)
2. Regularize(ERROR)
gc_cube <- sits_regularize(
cube = s2_cube,
output_dir = "E:/2025/sits/tmp",
period = "P15D",
res = 10,
multicores = 4
)
error info->Warning message:"regularization is faster when data is stored locally use 'sits_cube_copy()' to copy data locally before regularization"
3. so Add sits_cube_copy() before sits_regularize() (ERROR)
local_cube <- sits_cube_copy(
cube = s2_cube,
output_dir = "E:/2025/sits/tmp",
)
error info->
Error: .cube_token_generator: invalid token to access data provider
Traceback:

  1. .cube_token_generator(cube)
  2. .cube_token_generator.mpc_cube(cube)
  3. .check_that(.has(res_content))
  4. stop(msg, call. = FALSE)
  5. .handleSimpleError(function (cnd)
    . {
    . watcher$capture_plot_and_output()
    . cnd <- sanitize_call(cnd)
    . watcher$push(cnd)
    . switch(on_error, continue = invokeRestart("eval_continue"),
    . stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error",
    . cnd))
    . }, ".cube_token_generator: invalid token to access data provider",
    . base::quote(NULL))

Environment
Windows x64
R version 4.4.2
SITS version 1.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants