Closed asitemade4u closed 12 months ago
thanks for the bug report! I'll take a look.
Can you try the dev version? I think this was fixed in https://github.com/cboettig/minioclient/pull/7 but not yet released to CRAN. (Will try and prep a CRAN release now!)
Hi Carl,
And many thanks for the prompt response.
Unfortunately, the last version (which I installed by executing remotes::install_github("cboettig/minioclient")
) did not change the outcome.
S.
can you give me a reprex? I see:
library(minioclient)
mc_mb("play/test-tag")
#> Bucket created successfully `play/test-tag`.
mc("tag set play/test-tag key=value", verbose = TRUE)
#> Tags set for https://play.min.io/test-tag.
Created on 2023-11-05 with reprex v2.0.2
Here you go:
bkttst <- paste0(sample(letters, 12, replace = TRUE), collapse = "") %>%
paste0("mio/play-", .)
minioclient::mc_mb(bkttst, verbose = TRUE)
system(command = "touch /tmp/test.csv")
minioclient::mc_cp("/tmp/test.csv", bkttst, recursive = TRUE, verbose = TRUE)
thekey <- "tst"
theval <- "test"
minioclient::mc(command = glue::glue('tag set {bkttst}/test.csv "{thekey}={theval}"'))
Basically:
mio
The only external thing I need in the reprex is the alias of the Minio server, mio
in that case.
Please change it for something you have on your side.
Oh sorry, I did not know about the package reprex... Is what I sent enough for you?
@asitemade4u apologies I was unclear. Can you
a. Test my reprex above for you and let me know precisely what output you see. As you see in my example above, that works for me.
b. Can you please provide the output of sessionInfo() or sessioninfo::sessioninfo() so we know the version of the packages and operating system details you are running? Again, you can see an example of my session info in my reprex above.
c. You did the right thing to install the dev version from github. please confirm you also restarted your R session after doing that, otherwise you would still be running the old version.
d. I did run the code you gave above without any issue. Note that I modified it slightly, it really helps to use the play
alias that ships with the minio client. Technically your code above is not a "reprex" example because it implicitly assumes that the alias mio
exists, which is not accurate. However, it runs fine for me with the default test alias:
library(minioclient)
library(magrittr)
bkttst <- paste0(sample(letters, 12, replace = TRUE), collapse = "") %>%
paste0("play/play-", .)
minioclient::mc_mb(bkttst, verbose = TRUE)
#> Bucket created successfully `play/play-njmnrivqubcx`.
system(command = "touch /tmp/test.csv")
minioclient::mc_cp("/tmp/test.csv", bkttst, recursive = TRUE, verbose = TRUE)
#> `/tmp/test.csv` -> `play/play-njmnrivqubcx/test.csv`
#> Total: 0 B, Transferred: 0 B, Speed: 0 B/s
thekey <- "tst"
theval <- "test"
minioclient::mc(command = glue::glue('tag set {bkttst}/test.csv "{thekey}={theval}"'))
Created on 2023-11-05 with reprex v2.0.2
Note the footer included by the reprex R package -- I know it's a bit pedantic but using the 'reprex' facility in R helps make sure you are sharing copy-paste examples that a developer can run.
I could reproduce your issue on the CRAN version, but it is resolved for me on the dev version, so I can only guess that perhaps you did not restart the R session and didn't get the dev version? Do try the minimal example I sent above
library(minioclient)
mc_mb("play/test-tag")
#> Bucket created successfully `play/test-tag`.
mc("tag set play/test-tag key=value", verbose = TRUE)
#> Tags set for https://play.min.io/test-tag.
and do tell me the sessionInfo() output.
OK, here are my answers:
sessioninfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C
[3] LC_TIME=C LC_COLLATE=C
[5] LC_MONETARY=C LC_MESSAGES=C
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=C LC_IDENTIFICATION=C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils
[5] datasets methods base
other attached packages:
[1] yaml_2.3.7 utf8_1.2.3
[3] tibble_3.2.1 sys_3.4.2
[5] stringr_1.5.0 stringi_1.7.12
[7] RMariaDB_1.2.2 rlang_1.1.1
[9] readr_2.1.4.9000 purrr_1.0.2
[11] minioclient_0.0.5 jsonlite_1.8.7
[13] httr_1.4.7.9000 hms_1.1.3.9002
[15] dplyr_1.1.3 DBI_1.1.3
[17] data.table_1.14.8 curl_5.1.0
[19] magrittr_2.0.3 glue_1.6.2
loaded via a namespace (and not attached):
[1] crayon_1.5.2 vctrs_0.6.3
[3] cli_3.6.1 processx_3.8.2
[5] generics_0.1.3 bit_4.0.5
[7] ps_1.7.5 fansi_1.0.5
[9] tzdb_0.4.0 lifecycle_1.0.3
[11] config_0.3.2.9000 compiler_4.3.1
[13] sessioninfo_1.2.2 fs_1.6.3
[15] Rcpp_1.0.11 pkgconfig_2.0.3
[17] R6_2.5.1 tidyselect_1.2.0
[19] pillar_1.9.0 tools_4.3.1
[21] bit64_4.0.5
When I execute my code modified by you, ie:
library(minioclient)
library(magrittr)
bkttst <- paste0(sample(letters, 12, replace = TRUE), collapse = "") %>%
paste0("play/play-", .)
minioclient::mc_mb(bkttst, verbose = TRUE)
#> Bucket created successfully `play/play-njmnrivqubcx`.
system(command = "touch /tmp/test.csv")
minioclient::mc_cp("/tmp/test.csv", bkttst, recursive = TRUE, verbose = TRUE)
#> `/tmp/test.csv` -> `play/play-njmnrivqubcx/test.csv`
#> Total: 0 B, Transferred: 0 B, Speed: 0 B/s
thekey <- "tst"
theval <- "test"
minioclient::mc(command = glue::glue('tag set {bkttst}/test.csv "{thekey}={theval}"'))
I get the exact same error as before. That is weird because I do not get it with the simpler code from the reprex, ie:
mc_mb("play/test-tag")
#> Bucket created successfully `play/test-tag`.
mc("tag set play/test-tag key=value", verbose = TRUE)
#> Tags set for https://play.min.io/test-tag.
Please notice that in your reprex you are assigning the tag to a BUCKET, not to a file. Maybe the issue occurs only when assigning tags to files...
And yet, when I execute my+your code after transforming it to tag the bucket, ie:
library(minioclient)
library(magrittr)
bkttst <- paste0(sample(letters, 12, replace = TRUE), collapse = "") %>%
paste0("play/play-", .)
minioclient::mc_mb(bkttst, verbose = TRUE)
thekey <- "tst"
theval <- "test"
minioclient::mc(command = glue::glue('tag set {bkttst} "{thekey}={theval}"'))
I still get the error.
Also, I just noticed that in the sessioninfo
dump, minioclient's version is still 0.0.5
.
Have you changed the version in the GitHub repo or am I wrong when I say I installed the last version?
As a test, I will:
All looks good. Note in the failing reprex you still have version 0.0.5.
Please ensure you use the dev version, which should be 0.0.6
I think that should resolve the issue
On Sun, Nov 5, 2023 at 4:03 PM Stephen S. @.***> wrote:
Please notice that in your reprex you are assigning the tag to a BUCKET, not to a file. Maybe the issue occurs only when assigning tags to files...
— Reply to this email directly, view it on GitHub https://github.com/cboettig/minioclient/issues/11#issuecomment-1793890468, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWK6WFQSH4QKXQC3AKK7LYDALKZAVCNFSM6AAAAAA66TDQYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTHA4TANBWHA . You are receiving this because you commented.Message ID: @.***>
APOLOGIES!!! I must have messed up because I did as above and IT WORKS. I am ashamed of having wasted your time like that... S.
At least, I have learned about reprex...
no worries, we've all been there! these things are so often more confusing than they look! Learning tools like reprex & sessionInfo() do help a lot though!
Hi, And thank you for the package which is very useful!
I have an issue with
mc
.mc
mio_tag
function in R as:I have followed the syntax of the native function in
mc
,mc tag set
. For example, with test values as:my function outputs this command in Minio's
mc
, which seems valid to me:mc
is appended when executing with yourmc
function.Yet, I get this execution error:
What am I doing wrong? S.