deployApp failure with private/organization GitHub repo as dependency

1,098 views
Skip to first unread message

ja...@prismfp.com

unread,
May 8, 2015, 11:04:21 AM5/8/15
to shinyap...@googlegroups.com
Hi there,

I am trying to deploy our Shiny app to ShinyApps.io._ One of the dependencies of the app is a GitHub project which is a private repo belonging to our organization. Since the repo belongs to the organization and not a user it seems we might have to do things slightly differently than what is recommended in the guide: https://support.rstudio.com/hc/en-us/articles/204536558-Enabling-use-of-private-packages-on-github-com

When I try to install the package locally, as expected it doesn't work without authenticating:
> install_github("mycompany/my-package", subdir="packagex")
Downloading github repo prismfp/prismfp-package@master
Error in download(dest, src, auth) : client error: (404) Not Found

If I try to authenticate using a password (using my personal GH account), it still fails:
> install_github("mycompany/my-package", auth_user="myname", password="trustno1", subdir="packagex")
Downloading github repo prismfp/prismfp-package@master
Error in download(dest, src, auth) : client error: (404) Not Found

I generated an authentication token for my personal account on GitHub, and used this to install instead of the password:

> install_github("mycompany/my-package", subdir="packagex", auth_token="15efaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414a")
Downloading github repo mycompany/prismfp-package@master
Installing packagex 
...

This seemed to work fine. I had the line library("packagex") in my code, and I hoped for the package to be automatically installed on deploy. However I got the error message:

> shinyapps::deployApp('.')
Preparing to deploy application...DONE
Uploading application bundle...DONE
Deploying application: 41756...
Waiting for task: 32072061
  building: Parsing manifest
  building: Building image: 179292
  building: Building package: packagex
################################## Begin Log ################################## 
################################### End Log ################################### 
Error: Unhandled Exception: Child Task 32072062 failed: Error building image: Error fetching packagex (0.23.0) source. Error accessing GitHub repository mycompany/my-package. HTTP 404: Not Found

I added my personal GitHub account 'myname' to 'GitHub authentication' in the ShinyApps.io dashboard, and ticked 'Private Repository Access'. However I still saw the same message as above when trying to deploy.

I think that possibly shinyapps::deployApp() makes some assumption when installing packages that the first part of the repo identifier (here the organization name 'mycompany') is the same as the user name (here 'myname') and that the installation fails if this is not the case. Am I doing something else wrong or can this problem be fixed or worked around?

Thanks in advance for your help,
Jack Grahl

Andy Kipp

unread,
May 8, 2015, 11:37:07 AM5/8/15
to ja...@prismfp.com, shinyap...@googlegroups.com
Jack,

Can you send over:

packageDescription('yourpackage')

Also, can you validate that shinyapps.io has access to your GitHub organization? You can check this by going to GitHub settings and going to the 'Applications' page. You should see shinyapps.io, click that, and send over a screenshot of the page (see attached for what it should look like).

Thanks
-Andy

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/58219b7b-1c5c-43fb-be2a-c00909e82f64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Screen Shot 2015-05-08 at 11.35.27 AM.png

Juan

unread,
May 9, 2015, 11:11:43 AM5/9/15
to shinyap...@googlegroups.com
Hi


I am actually loading the packages from a private organization.

First, make sure you install the packages with the auth token.  
install_github("mycompany/my-package", subdir="packagex", auth_token="15efaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414a")

Second,
Make sure to tick the organization access when you authorize github on shinyapps.io. Make sure the Check mark is GREEN for the desired organization. I was having the same issue until I realized that the organization chek mark was not green.

That should do it, cheers



Andy Kipp

unread,
May 11, 2015, 9:41:30 AM5/11/15
to Juan, shinyap...@googlegroups.com
Juan is correct. Within an GitHub organization's settings page, there is a setting for "3rd party access". 3rd party access needs to be enabled with no restrictions to allow the organization's member's authorized GiHub applications (e.g shinyapps.io) to access not only the users's repositories, but the organization's content as well.

-Andy

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.

ja...@prismfp.com

unread,
May 12, 2015, 6:02:58 AM5/12/15
to shinyap...@googlegroups.com
Thanks very much for this Juan,

I went through enabling the app again using your instructions, and it seems to be working this time, although I'm not sure what I did wrong the first time.

Alex Whitworth

unread,
May 2, 2016, 7:24:22 PM5/2/16
to ShinyApps Users
I'm having the same problem:

R> rsconnect::deployApp(".")
Preparing to deploy application...
Uploading bundle for application: 99578...
Error: Unable to retrieve package records for the following packages:
- "callProjection"

"callProjection" is a private package internal to my organization. I have linked/enabled my github account. I'm checking with my IT staff to ensure that 3rd party access is allowed to the organization's repos. 

While waiting on that confirmation, is there anything that I need in my server.R file?

For instance, is this fine?

library(callProjection)
........

or do I also need to install the package in the server.R file?

devtools::install_github("<my org folder>", ref= "call_projection",
                          subdir= "callProjection",
                         auth_token= "<my auth token>")

Joshua Spiewak

unread,
May 3, 2016, 9:10:49 AM5/3/16
to Alex Whitworth, ShinyApps Users
Hi Alex,

You need to use devtools::install_github in order to use a package from GitHub

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
    -- Josh

Tareef Kawaf

unread,
May 3, 2016, 9:38:23 AM5/3/16
to Joshua Spiewak, Alex Whitworth, ShinyApps Users
After you install_github() you should try deploying again.  the rsconnect package will detect the dependencies at deploy time and push them up to the server.  Please do not put an explicit install call in either the server.R or ui.R files, that will definitely not work.

Alex Whitworth

unread,
May 3, 2016, 11:25:10 AM5/3/16
to Tareef Kawaf, Joshua Spiewak, ShinyApps Users
Forgive my confusion Tareef / Joshua, but I'm unclear on your suggestions. 

The package is installed on the machine and R instance from which I'm running [rsconnect::deployApp(".")]. If not in my server.R or ui.R files, where do I put the "install_github" command? 

Tareef Kawaf

unread,
May 3, 2016, 11:29:53 AM5/3/16
to Alex Whitworth, Joshua Spiewak, ShinyApps Users
Hi Alex,
All Josh and I were saying was that if you have a private package that is in github, you should install it locally using devtools::install_github().  If you could do me a favor and checkout the output of rsconnect::appDependencies() within the directory that you are in, it would be good to see if your package shows up in the list or not.

-Tareef

Alex Whitworth

unread,
May 3, 2016, 11:34:32 AM5/3/16
to Tareef Kawaf, Joshua Spiewak, ShinyApps Users
Thanks--the package is installed locally. Here is the requested output:

> rsconnect::appDependencies(".")
Error: Unable to retrieve package records for the following packages:
- "callProjection"

> rsconnect::deployApp(".")
Preparing to deploy application...DONE
Uploading bundle for application: 99676...
Error: Unable to retrieve package records for the following packages:
- "callProjection"

Alex Whitworth

unread,
May 3, 2016, 2:05:06 PM5/3/16
to Tareef Kawaf, ShinyApps Users, Joshua Spiewak
That appears to have been what the problem was... It needed a fresh install from github to recognize correctly. (Note: I would guess that the most recent install of 'callProjection' was from local, not direct from Github. Not sure if that caused the problem. Are you?)

> devtools::install_github(... redacted...)
Downloading GitHub repo dandb/data-analysis@call_projection
Installing callProjection
"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/awhitworth/AppData/Local/Temp/RtmpgBJFfa/devtoolsa07462474299/dandb-data-analysis-a60907d11b086d74ca72d67815448d4343c635ab/callProjection"  \
  --library="C:/Users/awhitworth/Documents/R/win-library/3.2" --install-tests 

* installing *source* package 'callProjection' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (callProjection)
Warning message:
GitHub repo contains submodules, may not function as expected! 
> rsconnect::appDependencies(".")
          package     version source
1            MASS      7.3-45   CRAN
2              R6       2.1.2   CRAN
3    RColorBrewer       1.1-2   CRAN
4           RODBC      1.3-13   CRAN
5            Rcpp      0.12.4   CRAN
6   RcppArmadillo 0.6.700.3.0   CRAN
7  callProjection       0.4.7 github
8           chron      2.3-47   CRAN
9      colorspace       1.2-6   CRAN
10     data.table       1.9.6   CRAN
11      dichromat       2.0-0   CRAN
12         digest       0.6.9   CRAN
13       forecast         7.1   CRAN
14       fracdiff       1.4-2   CRAN
15        ggplot2       2.1.0   CRAN
16         gtable       0.2.0   CRAN
17      htmltools       0.3.5   CRAN
18         httpuv       1.3.3   CRAN
19       jsonlite      0.9.19   CRAN
20       labeling         0.3   CRAN
21        lattice     0.20-33   CRAN
22      lubridate       1.5.6   CRAN
23       magrittr         1.5   CRAN
24           mime         0.4   CRAN
25        munsell       0.4.3   CRAN
26           nnet      7.3-12   CRAN
27        packrat     0.4.7-1   CRAN
28           plyr       1.8.3   CRAN
29       quadprog       1.5-5   CRAN
30       reshape2       1.4.1   CRAN
31         scales       0.4.0   CRAN
32          shiny      0.13.2   CRAN
33        stringi       1.0-1   CRAN
34        stringr       1.0.0   CRAN
35       timeDate    3012.100   CRAN
36        tseries     0.10-34   CRAN
37         xtable       1.8-2   CRAN
38            zoo      1.7-12   CRAN
> rsconnect::deployApp(".")
Preparing to deploy application...
Update application currently deployed at
DONE
Uploading bundle for application: 99676...
Detecting system locale ... en_US
DONE
Deploying bundle: 440713 for application: 99676 ...
Waiting for task: 181195350
  building: Parsing manifest
  building: Building image: 433024
  building: Installing system dependencies
  building: Fetching packages
  building: Building package: callProjection
  building: Installing packages
  building: Pushing image: 433024
  deploying: Starting instances
  rollforward: Activating new instances
  success: Stopping old instances
Application successfully deployed to https://....


On Tue, May 3, 2016 at 10:40 AM, Tareef Kawaf <tar...@rstudio.com> wrote:
Could you run the devtools::install_github() call again and capture the output, along with the output of appDependencies()?

Also, can you please send me the output of devtools::session_info()?

-Tareef

Tareef Kawaf

unread,
May 3, 2016, 2:10:11 PM5/3/16
to Alex Whitworth, ShinyApps Users, Joshua Spiewak
Yep, my guess was that the package was installed earlier, or perhaps with an old version of devtools.  I am glad everything is working right now.

Reply all
Reply to author
Forward
0 new messages