cran4linux / bspm

R Bridge to System Package Manager
https://cran4linux.github.io/bspm
Other
80 stars 4 forks source link

"Call failed: Could not activate remote peer" #75

Closed bbolker closed 1 year ago

bbolker commented 1 year ago

Since r2u was broken and then fixed a few days ago, I've been getting this error from bspm whenever I have it enabled and try to install a package ... (I already tried removing the package and re-installing it from source.)

Error: dbus: Call failed: Could not activate remote peer: unit failed.

Installing packages via apt-get install seems to work fine.

Any ideas?

R Under development (unstable) (2023-07-18 r84703)
Platform: x86_64-pc-linux-gnu
Running under: Pop!_OS 22.04 LTS

Matrix products: default
BLAS:   /usr/local/lib/R/lib/libRblas.so 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.10.0

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

time zone: America/Toronto
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
[1] compiler_4.4.0 tools_4.4.0    bspm_0.5.3    
bbolker commented 1 year ago

Sorry, reinstalling as root/with sudo (as specified at the end of the README) resolved the problem.

bbolker commented 1 year ago

Hmm, this is happening to me again, and reinstalling hasn't helped. Any clues for what to try next for diagnostics/troubleshooting?

$ sudo rm -Rf /usr/local/lib/R/site-library/bspm/
$ sudo rm -Rf /usr/local/lib/R/library/bspm
$ sudo Rscript --vanilla -e 'install.packages("bspm", repos="https://cloud.r-project.org")'

bspm::enable() is in my .Rprofile.

> sessionInfo()
R Under development (unstable) (2023-08-08 r84906)
Platform: x86_64-pc-linux-gnu
Running under: Pop!_OS 22.04 LTS

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

other attached packages:
[1] bspm_0.5.5

loaded via a namespace (and not attached):
[1] compiler_4.4.0 tools_4.4.0   
lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 22.04 LTS
Release:    22.04
Codename:   jammy
eddelbuettel commented 1 year ago

Hm, everything still works in the Docker container rocker/r2u. I went to also quick check on my laptop as the default and there, I noticed, the locally and installed as a standard R package version bspm 0.5.0 in /usr/local/lib/R/site-library shadows the one that bspm itself updated to 0.5.5 in /usr/lib/R/site-library so I may have been running for a few weeks with 0.5.0 there.

Enchufa2 commented 1 year ago

@bbolker Is there something useful in the journal's output (i.e. journalctl -f) when you try to install packages? Also, could you please run bspm::shadowed_packages() and report the output?

eddelbuettel commented 1 year ago

So I get Error: dbus: Call failed: Cannot launch daemon, file not found or permissions invalid when the auto-upgraded bspm runs. When I revert to a local one earlier in the .libPaths() it works.

Do we need to white-list bspm to exclude it? Or do I need to do 'something different' (but what?) with the r-cran-bspm I ship?

Enchufa2 commented 1 year ago

An autogenerated r-cran-bspm won't have the required files packaged. If such package shadows the one that was manually installed, this issue happens. So either 1) r2u implements an exception to exclude bspm, or 2) r2u implements an exception to package bspm properly following the scheme in this repo, or 3) bspm is excluded in the user's apt configuration.

eddelbuettel commented 1 year ago

Yes yes and yes. Maybe I should just not package bspm in the (robotically autogenerated) r2u repo? A bit of a design wart but easy to document and I do mention the 'black list' of a handful or two packages.

eddelbuettel commented 1 year ago

And/or inject a hand-curated proper bspm. Probably better.

eddelbuettel commented 1 year ago

And/or inject a hand-curated proper bspm. Probably better.

I used to do that during the 0.3.* series and then convinced myself I did not have to do that. I was likely wrong.

Is there a proper way for me to test if the package is fine? I just re-did what I did then and built one off your repo so I now have a 0.5.5.1 on the laptop and it works. I guess I can script this to in the actual r2u build setup. If I were to peek into the create deb, what needs to be present?

Now I have

/.
/etc
/etc/dbus-1
/etc/dbus-1/system.d
/etc/dbus-1/system.d/org.r_project.linux1.conf
/usr
/usr/lib
/usr/lib/R
/usr/lib/R/site-library
/usr/lib/R/site-library/bspm
/usr/lib/R/site-library/bspm/DESCRIPTION
/usr/lib/R/site-library/bspm/INDEX
/usr/lib/R/site-library/bspm/Meta
/usr/lib/R/site-library/bspm/Meta/Rd.rds
/usr/lib/R/site-library/bspm/Meta/features.rds
/usr/lib/R/site-library/bspm/Meta/hsearch.rds
/usr/lib/R/site-library/bspm/Meta/links.rds
/usr/lib/R/site-library/bspm/Meta/nsInfo.rds
/usr/lib/R/site-library/bspm/Meta/package.rds
/usr/lib/R/site-library/bspm/NAMESPACE
/usr/lib/R/site-library/bspm/NEWS.md
/usr/lib/R/site-library/bspm/R
/usr/lib/R/site-library/bspm/R/bspm
/usr/lib/R/site-library/bspm/R/bspm.rdb
/usr/lib/R/site-library/bspm/R/bspm.rdx
/usr/lib/R/site-library/bspm/help
/usr/lib/R/site-library/bspm/help/AnIndex
/usr/lib/R/site-library/bspm/help/aliases.rds
/usr/lib/R/site-library/bspm/help/bspm.rdb
/usr/lib/R/site-library/bspm/help/bspm.rdx
/usr/lib/R/site-library/bspm/help/paths.rds
/usr/lib/R/site-library/bspm/html
/usr/lib/R/site-library/bspm/html/00Index.html
/usr/lib/R/site-library/bspm/html/R.css
/usr/lib/R/site-library/bspm/scripts
/usr/lib/R/site-library/bspm/scripts/mass_move.sh
/usr/lib/R/site-library/bspm/service
/usr/lib/R/site-library/bspm/service/backend
/usr/lib/R/site-library/bspm/service/backend/__init__.py
/usr/lib/R/site-library/bspm/service/backend/_utils.py
/usr/lib/R/site-library/bspm/service/backend/alpm.py
/usr/lib/R/site-library/bspm/service/backend/apt.py
/usr/lib/R/site-library/bspm/service/backend/dnf.py
/usr/lib/R/site-library/bspm/service/bspm.py
/usr/lib/R/site-library/bspm/service/dbus-paths
/usr/lib/R/site-library/bspm/service/dbus.conf.in
/usr/lib/R/site-library/bspm/service/dbus.service.in
/usr/lib/R/site-library/bspm/tinytest
/usr/lib/R/site-library/bspm/tinytest/db.rds
/usr/lib/R/site-library/bspm/tinytest/setup.R
/usr/lib/R/site-library/bspm/tinytest/teardown.R
/usr/lib/R/site-library/bspm/tinytest/test_integration.R
/usr/lib/R/site-library/bspm/tinytest/test_manager.R
/usr/lib/R/site-library/bspm/tinytest/test_manager_ci.R
/usr/lib/R/site-library/bspm/tinytest/test_scripts.R
/usr/lib/R/site-library/bspm/tinytest/test_utils.R
/usr/share
/usr/share/dbus-1
/usr/share/dbus-1/system-services
/usr/share/dbus-1/system-services/org.r_project.linux1.service
/usr/share/doc
/usr/share/doc/r-cran-bspm
/usr/share/doc/r-cran-bspm/changelog.Debian.gz
/usr/share/doc/r-cran-bspm/copyright

whereas the last 'bad' one directly in r2u has

$ dpkg -c ubuntu/pool/dists/jammy/main/r-cran-bspm_0.5.5-1.ca2204.1_all.deb                                                                          [9/93490]
drwxr-xr-x root/root         0 2023-08-23 16:39 ./                                                       
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/                                                  
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/lib/                                           
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/lib/R/                                       
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/lib/R/site-library/
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/lib/R/site-library/bspm/
-rw-r--r-- root/root      1313 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/DESCRIPTION
-rw-r--r-- root/root       335 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/INDEX            
-rw-r--r-- root/root        41 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/LICENSE
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/
-rw-r--r-- root/root       455 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/Rd.rds
-rw-r--r-- root/root       121 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/features.rds
-rw-r--r-- root/root       460 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/hsearch.rds
-rw-r--r-- root/root       241 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/links.rds
-rw-r--r-- root/root       259 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/nsInfo.rds
-rw-r--r-- root/root      1132 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/Meta/package.rds
-rw-r--r-- root/root       200 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/NAMESPACE
-rw-r--r-- root/root      5177 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/NEWS.md
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/R/
-rw-r--r-- root/root      1058 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/R/bspm
-rw-r--r-- root/root     26274 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/R/bspm.rdb
-rw-r--r-- root/root       661 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/R/bspm.rdx
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/
-rw-r--r-- root/root       290 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/AnIndex
-rw-r--r-- root/root       202 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/aliases.rds
-rw-r--r-- root/root     14280 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/bspm.rdb
-rw-r--r-- root/root       292 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/bspm.rdx
-rw-r--r-- root/root       195 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/help/paths.rds
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/html/
-rw-r--r-- root/root      2566 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/html/00Index.html
-rw-r--r-- root/root      1735 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/html/R.css
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/scripts/
-rwxr-xr-x root/root      1877 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/scripts/mass_move.sh
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/
-rw-r--r-- root/root       471 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/__init__.py 
-rw-r--r-- root/root      1659 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/_utils.py
-rw-r--r-- root/root      2686 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/alpm.py
-rw-r--r-- root/root      2021 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/apt.py
-rw-r--r-- root/root      2249 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/backend/dnf.py
-rwxr-xr-x root/root      4845 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/bspm.py
-rw-r--r-- root/root       121 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/dbus-paths
-rw-r--r-- root/root       365 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/dbus.conf.in
-rw-r--r-- root/root        84 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/service/dbus.service.in
drwxr-xr-x root/root         0 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/
-rw-r--r-- root/root      1577 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/db.rds
-rw-r--r-- root/root       714 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/setup.R
-rw-r--r-- root/root        60 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/teardown.R
-rw-r--r-- root/root      3409 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/test_integration.R 
-rw-r--r-- root/root       489 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/test_manager.R
-rw-r--r-- root/root      1806 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/test_manager_ci.R
-rw-r--r-- root/root       606 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/test_scripts.R
-rw-r--r-- root/root      3217 2023-08-23 06:18 ./usr/lib/R/site-library/bspm/tinytest/test_utils.R
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/share/
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/share/doc/
drwxr-xr-x root/root         0 2023-08-23 16:39 ./usr/share/doc/r-cran-bspm/
-rw-r--r-- root/root       150 2023-08-23 16:39 ./usr/share/doc/r-cran-bspm/changelog.Debian.gz
-rw-r--r-- root/root       149 2023-08-23 16:39 ./usr/share/doc/r-cran-bspm/copyright

Is the missing /usr/share/dbus-1/system-services/org.r_project.linux1.service enough of a 'tell'?

eddelbuettel commented 1 year ago

When I force a rebuild inside r2u it looks like it may skip the configure step under the default setup. And it doesn't have the Python packages. I'll have to do that outside of r2u and/or with a special script. Not a biggie.

eddelbuettel commented 1 year ago

@bbolker Thanks again for spotting that. I injected properly built .deb packages for 20.04 and 22.04, if you update now you should get them and they should hopefully works as expected without the need for a local shadow.

Enchufa2 commented 1 year ago

f I were to peek into the create deb, what needs to be present?

These two:

<snip>
/etc/dbus-1/system.d/org.r_project.linux1.conf
<snip>
/usr/share/dbus-1/system-services/org.r_project.linux1.service
<snip>
bbolker commented 1 year ago

I'm still having some trouble, but at least part of it is permissions problems on my end (since things work better, although not entirely smoothly, when I run R as root); I will try to work it out. bspm is not shadowed on my system.

Feel free to close.

eddelbuettel commented 1 year ago

You should not need root. I have this in /etc/R/Rprofile.site

suppressMessages(bspm::enable())
options(bspm.version.check=FALSE)
bbolker commented 1 year ago

I re-re-installed bspm making sure to do so as root (this part is necessary) and works now, again. Thanks for all your help -- I know that I stumble around sometimes.

eddelbuettel commented 1 year ago

Ben we are talking past each other.

Yes, locally installing bspm works. It always has. But it should not be ncessary. What I changed to todat was to make the r-cran-bspm package inside r2u correct and that is what I wanted you to test. To do so r-cran-bspm (from r2u) should be your sole bspm, ie none in /usr/loca/lib/R/site-library or ~/.R/ or elsewhere.

Ie by testing this and asserting that it works you can help not to break r2u by shipping an autogenerated bspm without the Python hooks.

bbolker commented 1 year ago

I really think my system is weird and I should just go debug it myself, but ...

shell:

sudo apt-get update
## Hit:6 https://r2u.stat.illinois.edu/ubuntu jammy Release 
sudo apt-get install --reinstall r-cran-bspm
## Setting up r-cran-bspm (0.5.5.1-1.2204.1) ...

R

.libPaths()
## [1] "/usr/local/lib/R/site-library" "/usr/local/lib/R/library" 
library(bspm)
## Error in library(bspm) : there is no package called ‘bspm’
eddelbuettel commented 1 year ago

Sure. All the r2u packages go into /usr/lib/R/site-library and always have. Your .libPaths() is non-standard and different from the suggested / provided default of the Debian package and its Ubuntu port at CRAN:

> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"      
[3] "/usr/lib/R/library"           
> 

So you if you add what I have here things should work. You can do dpkg -l | grep r-cran- to see what binaries you installed, and dpkg -L r-cran-bspm will tell you where it lives. If R looks another way it will complain 'no bspm' ....