r-lib / gitcreds

Query git credentials from R
https://gitcreds.r-lib.org/
Other
27 stars 10 forks source link

gitcreds_fill() inconsistent #34

Closed tsahota closed 10 months ago

tsahota commented 3 years ago
gitcreds::gitcreds_fill(list(url="https://impossible.com"))

[1] "protocol=dummy" "host=dummy" "username=dummy" "password=dummy get"

gitcreds::gitcreds_fill(list(url="https://impossible.com"))

Error in new_git_error("git_error", args = args, stdout = out, status = attr(out, : System git failed:

gitcreds::gitcreds_fill(list(url="https://impossible.com"))

[1] "protocol=dummy" "host=dummy" "username=dummy" "password=dummy get"

gitcreds::gitcreds_fill(list(url="https://impossible.com"))

Error in new_git_error("git_error", args = args, stdout = out, status = attr(out, : System git failed:

I have traced the problem back to inconsistent results coming from the system2() command in git_run(). Some times it's blank and sometimes its the protocol=dummy:

$ 'git' -c credential.helper="! echo protocol=dummy;echo host=dummy;echo username=dummy;echo password=dummy" credential fill 2> '/tmp/RtmpdAswNP/gitcreds-stderr-52cf16a5050a' < '/tmp/RtmpdAswNP/gitcreds-stdin-52cfb48c91f'
$ 'git' -c credential.helper="! echo protocol=dummy;echo host=dummy;echo username=dummy;echo password=dummy" credential fill 2> '/tmp/RtmpdAswNP/gitcreds-stderr-52cf16a5050a' < '/tmp/RtmpdAswNP/gitcreds-stdin-52cfb48c91f'
host=dummy
username=dummy
password=dummy get
$ 'git' -c credential.helper="! echo protocol=dummy;echo host=dummy;echo username=dummy;echo password=dummy" credential fill 2> '/tmp/RtmpdAswNP/gitcreds-stderr-52cf16a5050a' < '/tmp/RtmpdAswNP/gitcreds-stdin-52cfb48c91f'
host=dummy
username=dummy
password=dummy get
$ 'git' -c credential.helper="! echo protocol=dummy;echo host=dummy;echo username=dummy;echo password=dummy" credential fill 2> '/tmp/RtmpdAswNP/gitcreds-stderr-52cf16a5050a' < '/tmp/RtmpdAswNP/gitcreds-stdin-52cfb48c91f'

Any ideas of what might be causing this?

Thanks,

Tarj.

gaborcsardi commented 3 years ago

Can you show sessionInfo() and sessioninfo::session_info()?

tsahota commented 3 years ago

Thanks!

> sessionInfo()
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS/LAPACK: /opt/intel/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] compiler_4.0.3 gitcreds_0.1.1 tools_4.0.3    yaml_2.2.1 
sessioninfo::session_info()
─ Session info ────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.3 (2020-10-10)
 os       Ubuntu 18.04.5 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2021-07-09                  

─ Packages ────────────────────────────────────────────────────────────
 package     * version date       lib source        
 assertthat    0.2.1   2019-03-21 [2] CRAN (R 4.0.3)
 cli           2.2.0   2020-11-20 [2] CRAN (R 4.0.3)
 crayon        1.3.4   2017-09-16 [2] CRAN (R 4.0.3)
 fansi         0.4.1   2020-01-08 [2] CRAN (R 4.0.3)
 gitcreds      0.1.1   2020-12-04 [2] CRAN (R 4.0.3)
 glue          1.4.2   2020-08-27 [2] CRAN (R 4.0.3)
 rstudioapi    0.13    2020-11-12 [2] CRAN (R 4.0.3)
 sessioninfo   1.1.1   2018-11-05 [2] CRAN (R 4.0.3)
 withr         2.3.0   2020-09-22 [2] CRAN (R 4.0.3)
 yaml          2.2.1   2020-02-01 [2] CRAN (R 4.0.3)

[1] /data/home/tarjinde/R/x86_64-pc-linux-gnu-library/4.0
[2] /opt/rpkgs/4.0
[3] /opt/R/4.0.3/lib/R/library

Just in case, here's the git version

> system("git --version")
git version 2.17.1
gaborcsardi commented 2 years ago

Do you still have this issue?

gaborcsardi commented 10 months ago

I am going to close this now, as I don't have a way to reproduce it. Please reopen it if you still have issues. Thanks!