Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when using configureApp(): attempt to apply non-function #271

Closed
jorgepda opened this issue May 14, 2018 · 11 comments
Closed

error when using configureApp(): attempt to apply non-function #271

jorgepda opened this issue May 14, 2018 · 11 comments
Milestone

Comments

@jorgepda
Copy link

@jorgepda jorgepda commented May 14, 2018

I have an app that's successfully deployed on shinyapps.io. When running the following line of code

rsconnect::configureApp("renkejhsph3863256", size="small", account="dnalc")

I get the error message

Error in client$configureApplication(application$id, propertyName, propertyValue) : 
  attempt to apply non-function
@gusmclennan
Copy link

@gusmclennan gusmclennan commented Jul 5, 2018

I am having the same issue. Trying to resize a deployed app due to memory issues, but can't find a way to submit the configureApp command without getting the above error message. Let me know if you were able to resolve this @jorgepda !

@colearendt
Copy link
Member

@colearendt colearendt commented Jul 5, 2018

Very interesting! It looks like in configureApp, client no longer has a configureApplication method. Perhaps this is a bug, or maybe intentional removing?

for (i in names(properties)) {
propertyName <- i
propertyValue <- properties[[i]]
if (identical(client, lucid))
lucid$setApplicationProperty(application$id, propertyName, propertyValue)
else
client$configureApplication(application$id, propertyName, propertyValue)
}

names(client)
 [1] "status"                      "currentUser"                 "accountsForUser"             "getAccountUsage"            
 [5] "getBundle"                   "updateBundleStatus"          "createBundle"                "listApplications"           
 [9] "getApplication"              "getApplicationMetrics"       "getLogs"                     "createApplication"          
[13] "listApplicationProperties"   "setApplicationProperty"      "unsetApplicationProperty"    "uploadApplication"          
[17] "deployApplication"           "terminateApplication"        "inviteApplicationUser"       "addApplicationUser"         
[21] "removeApplicationUser"       "listApplicationAuthoization" "listApplicationUsers"        "listApplicationGroups"      
[25] "listApplicationInvitations"  "listTasks"                   "getTaskInfo"                 "getTaskLogs"                
[29] "waitForTask"  

I was able to determine that client$setApplicationProperty is ultimately what we want for sizing changes. I also confirmed that this worked.

client$setApplicationProperty("app-id", "application.instances.template", "small")

It looks like we may be getting a strange client that is unexpected (lucid has similar methods, but the two are not identical, which is putting us into this case). Maybe our comparison to lucid with identical is too strict? Not sure how to enumerate differences:

> names(lucid)
 [1] "status"                      "currentUser"                 "accountsForUser"             "getAccountUsage"            
 [5] "getBundle"                   "updateBundleStatus"          "createBundle"                "listApplications"           
 [9] "getApplication"              "getApplicationMetrics"       "getLogs"                     "createApplication"          
[13] "listApplicationProperties"   "setApplicationProperty"      "unsetApplicationProperty"    "uploadApplication"          
[17] "deployApplication"           "terminateApplication"        "inviteApplicationUser"       "addApplicationUser"         
[21] "removeApplicationUser"       "listApplicationAuthoization" "listApplicationUsers"        "listApplicationGroups"      
[25] "listApplicationInvitations"  "listTasks"                   "getTaskInfo"                 "getTaskLogs"                
[29] "waitForTask" 

@jspiewak
Copy link
Member

@jspiewak jspiewak commented Jul 5, 2018

I presume the issue is that it is choosing the wrong branch of the if clause in the case of trying to deploy to shinyapps.io, as it ought to be using the lucid.setApplicationProperty call.

@jspiewak
Copy link
Member

@jspiewak jspiewak commented Jul 5, 2018

This seems to be the only case of using identical to determine which client we have.
I wonder if the introduction of the certificate in clientForAccount caused this identical call to start failing?

@jmcphers ?

@jmcphers jmcphers added this to the 0.9 milestone Jul 5, 2018
@jmcphers
Copy link
Member

@jmcphers jmcphers commented Jul 5, 2018

Yes, it looks like we think the client isn't Lucid for some reason. This seems like an unusual way to dispatch to the appropriate setter so I've rewritten it.

cd0e0aa

@colearendt and/or @gusmclennan, can you confirm whether this fixes your issue? (You can use devtools::install_github("rstudio/rsconnect") install the development version.)

@gusmclennan
Copy link

@gusmclennan gusmclennan commented Jul 6, 2018

Hey - have run devtools to install dev version, and retested. Getting different error messages now, so some progress...

Resubmitted configureApp request specifying "xlarge" size, and got this unexpected response:

> rsconnect::configureApp("GLORIA_Demo_1000_LaTrobe_Street", size = "xlarge", account = "brintelligence")
Error: HTTP 400
PUT https://api.shinyapps.io/v1/applications/360869/properties/application.instances.template?force=0
Validation Error: 'xlarge' is not allowed.

Wasn't sure whether our current account settings were restricting available size for instances (we are only the Starter plan). So tried to resize instance to Medium, and received this error message:

> rsconnect::configureApp("GLORIA_Demo_1000_LaTrobe_Street", size = "medium", account = "brintelligence")
Error in lint(appDir, appFiles, appPrimaryDoc) : 
  Cancelling deployment: invalid project layout.
The project should have one of the following layouts:
1. 'shiny.R' and 'ui.R' in the application base directory,
2. 'shiny.R' and 'www/index.html' in the application base directory,
3. 'app.R' or a single-file Shiny .R file,
4. An R Markdown (.Rmd) document,
5. A static HTML (.html) or PDF (.pdf) document.
6. 'plumber.R' API description .R file
7. 'entrypoint.R' plumber startup script
8. A tensorflow saved model

The app we have deployed is a single Shiny R file, that currently works on shinyapps.io, albeit with memory issues since the most recent deployment.

FYI - I am running Microsoft R Open v3.5.0, and RStudio v1.0.153

Thanks for your assistance, please let me know when you need me to retest anything.

@jspiewak
Copy link
Member

@jspiewak jspiewak commented Jul 6, 2018

@gusmclennan the Starter plan cannot use instance types beyond "large". Clearly the error message could use some improvement there.

Just to confirm, for the second error your working directory was the project directory?

@gusmclennan
Copy link

@gusmclennan gusmclennan commented Jul 9, 2018

@jspiewak - yes, I think so. I deployed the app to Shinyapps from my working directory in R Studio (if that answers the question...).

@jspiewak
Copy link
Member

@jspiewak jspiewak commented Jul 9, 2018

@gusmclennan in that case I need to defer to folks more familiar with the innards of rsconnect.
Could you please add a directory listing for your project directory?

@jorgepda
Copy link
Author

@jorgepda jorgepda commented Aug 29, 2018

Hi all. I installed the dev version and was able to run the command
rsconnect::configureApp("renkejhsph3863256", size="small", account="dnalc")

I am now getting the following error

Preparing to deploy application...DONE
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 1, 0

@jmcphers
Copy link
Member

@jmcphers jmcphers commented Sep 12, 2018

Should be fixed now on master -- thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants