Namespace load failed when deploying R shiny app

Heya,
I am trying to deploy an R shiny app. This app uses an R package "pedicure" which I have placed onto GitHub at TolhurstStatisticalConsulting/pedicure. I have installed pedicure onto the R system library from this repository and it works fine. Currently this is a private repository, but the issue discribed below remains regardless of public/private.

pedicure depends on the Matrix package and imports the methods package. I am unsure if this is a package dependency issue, so my apologies if I have posted this issue in the wrong place!

Also note, I have not previously deployed this App so I can't turn the package cache off.

When deploying the app to the shiny server, I encounter the following error. Any advice would be greatly appreciated!

Error: package or namespace load failed for ‘pedicure’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/3.5.1/lib/R/library/pedicure/libs/pedicure.so':
/opt/R/3.5.1/lib/R/library/pedicure/libs/pedicure.so: invalid ELF header
Error: loading failed
Execution halted
ERROR: loading failed

  • removing ‘/opt/R/3.5.1/lib/R/library/pedicure’
    ################################# End Task Log #################################
    Error: Unhandled Exception: Child Task 683995742 failed: Error building image: Error building pedicure (1.2). Build exited with non-zero status: 1
    Execution halted

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_3.5.1 rsconnect_0.8.16 tools_3.5.1 curl_3.2 jsonlite_1.5 digest_0.6.15
[7] openssl_1.0.1

Are you committing pedicure.so into GitHub? If so, compiled for what architecture?

Hi Josh,
thank you for your reply! Indeed I had the wrong pedicure.so file on GitHub (compiled for Mac, not linux).

I have now committed pedicure.so (compiled for linux) to GitHub, but I encounter a new error...

error: Building package: pedicure
################################ Begin Task Log ################################
[2020-02-13T11:48:35.039867254+0000] Execute script: packages/build/sys.sh

  • set -e
  • apt-get update -qq
  • apt-get install -y libapparmor-dev
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following NEW packages will be installed:
    libapparmor-dev
    0 upgraded, 1 newly installed, 0 to remove and 104 not upgraded.
    Need to get 67.8 kB of archives.
    After this operation, 229 kB of additional disk space will be used.
    Get:1 Index of /ubuntu xenial-updates/main amd64 libapparmor-dev amd64 2.10.95-0ubuntu2.11 [67.8 kB]
    debconf: delaying package configuration, since apt-utils is not installed
    Fetched 67.8 kB in 0s (0 B/s)
    Selecting previously unselected package libapparmor-dev:amd64.
    (Reading database ... 119718 files and directories currently installed.)
    Preparing to unpack .../libapparmor-dev_2.10.95-0ubuntu2.11_amd64.deb ...
    Unpacking libapparmor-dev:amd64 (2.10.95-0ubuntu2.11) ...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up libapparmor-dev:amd64 (2.10.95-0ubuntu2.11) ...
    ################################# End Task Log #################################
    Error: Unhandled Exception: Child Task 691976706 failed: Error building image: Error fetching pedicure (2.0.0) source. unable to satisfy package: pedicure (2.0.0)
    Execution halted

In general, I don't believe it is intended that the compiled output is committed. It should be built for the platform on which the package is installed.

If pedicure can no longer be fetched, double check how it is installed locally, double check the permissions on the private GitHub repository, and double check that you have Private Repository Access checked in the shinyapps.io dashboard under Account -> Profile. If all of that looks good, try reseting the Private Repository Access by unchecking it, and then re-checking.

1 Like