{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/doAzureParallel/issues/334","repository_url":"https://api.github.com/repos/Azure/doAzureParallel","labels_url":"https://api.github.com/repos/Azure/doAzureParallel/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/Azure/doAzureParallel/issues/334/comments","events_url":"https://api.github.com/repos/Azure/doAzureParallel/issues/334/events","html_url":"https://github.com/Azure/doAzureParallel/issues/334","id":385385560,"node_id":"MDU6SXNzdWUzODUzODU1NjA=","number":334,"title":"object 'results' not found","user":{"login":"ericchansen","id":5395779,"node_id":"MDQ6VXNlcjUzOTU3Nzk=","avatar_url":"https://avatars2.githubusercontent.com/u/5395779?v=4","gravatar_id":"","url":"https://api.github.com/users/ericchansen","html_url":"https://github.com/ericchansen","followers_url":"https://api.github.com/users/ericchansen/followers","following_url":"https://api.github.com/users/ericchansen/following{/other_user}","gists_url":"https://api.github.com/users/ericchansen/gists{/gist_id}","starred_url":"https://api.github.com/users/ericchansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericchansen/subscriptions","organizations_url":"https://api.github.com/users/ericchansen/orgs","repos_url":"https://api.github.com/users/ericchansen/repos","events_url":"https://api.github.com/users/ericchansen/events{/privacy}","received_events_url":"https://api.github.com/users/ericchansen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-28T17:46:35Z","updated_at":"2019-01-04T13:54:00Z","closed_at":null,"author_association":"NONE","body":"Before submitting a bug please check the following:\r\n- [x] Start a new R session\r\n- [x] Check your credentials file\r\n- [x] Install the latest doAzureParallel package\r\n- [x] Submit a minimal, reproducible example \r\n- [x] run `sessionInfo()`\r\n\r\nUpdates\r\n---------\r\n\r\n**EDIT (11/29/2018)** - Added additional examples, corrected a typo and improved formatting.\r\n\r\nDescription\r\n------------\r\n\r\n\r\n\r\nCan someone please explain why I get the error `object 'results' not found`? Full code below.\r\n\r\nIdeally, I need to return two objects from inside the loop. One is a data frame that gets row binded, and the other is a list that needs to become a list of lists. In the example below, I'm only returning the data frame (will work on adding the list as additional output once this issue is resolved).\r\n\r\nInstruction to repro the problem if applicable\r\n--------------------------------------------------\r\n\r\n**Example 1**\r\n\r\n```\r\nremove.packages(\"rAzureBatch\")\r\nremove.packages(\"doAzureParallel\")\r\ndevtools::install_github(\"Azure/rAzureBatch\", force = TRUE)\r\ndevtools::install_github(\"Azure/doAzureParallel\", force = TRUE)\r\n\r\nlibrary(doAzureParallel)\r\nsetVerbose(TRUE)\r\n\r\nsetCredentials(file.path(getwd(), \"credentials.json\"))\r\ncluster <- makeCluster(file.path(getwd(), \"cluster.json\"), fullName=TRUE)\r\nregisterDoAzureParallel(cluster)\r\ngetDoParWorkers()\r\n\r\n# my_results <- foreach(t = 1:3) %do% { # Works.\r\n# my_results <- foreach(t = 1:3, .combine = 'rbind') %do% { # Works.\r\n# my_results <- foreach(t = 1:3, .combine = 'rbind', .options.azure = list(autoDeleteJob = FALSE)) %dopar% { # Works.\r\n# my_results <- foreach(t = 1:3, .options.azure = list(enableCloudCombine = FALSE, autoDeleteJob = FALSE)) %dopar% { # object 'results' not found\r\nmy_results <- foreach(t = 1:3, .combine = 'rbind', .options.azure = list(enableCloudCombine = FALSE, autoDeleteJob = FALSE)) %dopar% { # object 'results' not found\r\n  my_results_df <- data.frame(\"x\" = runif(2), \"trial\" = replicate(2, t))\r\n  my_results_list <- runif(3)\r\n  return(my_results_df)\r\n}\r\n\r\nsessionInfo()\r\n```\r\n\r\n**Example 2 featuring superfluous use of `setAutoDeleteJob(FALSE)`**\r\n\r\n```\r\nlibrary(doAzureParallel)\r\nsetVerbose(TRUE)\r\nsetAutoDeleteJob(FALSE)\r\n\r\nsetCredentials(file.path(getwd(), \"credentials.json\"))\r\ncluster <- makeCluster(file.path(getwd(), \"cluster.json\"), fullName=TRUE)\r\nregisterDoAzureParallel(cluster)\r\ngetDoParWorkers()\r\n\r\n# my_results <- foreach(t = 1:3, .options.azure = list(enableCloudCombine = FALSE, autoDeleteJob = FALSE)) %dopar% { # object 'results' not found\r\n# my_results <- foreach(t = 1:3, .options.azure = list(enableCloudCombine = FALSE)) %dopar% { # object 'results' not found\r\n# my_results <- foreach(t = 1:3, .combine = 'rbind', .options.azure = list(enableCloudCombine = FALSE)) %dopar% { # object 'results' not found\r\nmy_results <- foreach(t = 1:3, .combine = 'rbind', .options.azure = list(enableCloudCombine = FALSE, autoDeleteJob = FALSE)) %dopar% { # object 'results' not found\r\n  my_results_df <- data.frame(\"x\" = runif(2), \"trial\" = replicate(2, t))\r\n  my_results_list <- runif(3)\r\n  return(my_results_df)\r\n}\r\n```\r\n\r\n**Output from `sessionInfo()`**\r\n\r\n```\r\nR version 3.4.3 (2017-11-30)\r\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\r\nRunning under: Windows Server >= 2012 x64 (build 9200)\r\n\r\nMatrix products: default\r\n\r\nlocale:\r\n[1] LC_COLLATE=English_United States.1252 \r\n[2] LC_CTYPE=English_United States.1252   \r\n[3] LC_MONETARY=English_United States.1252\r\n[4] LC_NUMERIC=C                          \r\n[5] LC_TIME=English_United States.1252    \r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n [1] doAzureParallel_0.7.2 iterators_1.0.9       foreach_1.4.5        \r\n [4] RevoUtilsMath_10.0.1  RevoUtils_10.0.7      RevoMods_11.0.0      \r\n [7] MicrosoftML_9.3.0     mrsdeploy_1.1.3       RevoScaleR_9.3.0     \r\n[10] lattice_0.20-35       rpart_4.1-11         \r\n\r\nloaded via a namespace (and not attached):\r\n [1] codetools_0.2-15       CompatibilityAPI_1.1.0 digest_0.6.13         \r\n [4] rAzureBatch_0.6.2      mime_0.5               bitops_1.0-6          \r\n [7] grid_3.4.3             R6_2.2.2               jsonlite_1.5          \r\n[10] httr_1.3.1             curl_3.1               rjson_0.2.15          \r\n[13] tools_3.4.3            RCurl_1.95-4.9         yaml_2.1.16           \r\n[16] compiler_3.4.3         mrupdate_1.0.1       \r\n```\r\n\r\n**Output from error**\r\n\r\n```\r\n==============================================================================\r\nId: job20181128173916\r\nchunkSize: 1\r\nenableCloudCombine: FALSE\r\nerrorHandling: stop\r\nwait: TRUE\r\nautoDeleteJob: TRUE\r\n==============================================================================\r\nSubmitting tasks (3/3)\r\nWaiting for tasks to complete. . .\r\n| Progress: 100.00% (3/3) | Running: 0 | Queued: 0 | Completed: 3 | Failed: 0 |\r\nTasks have completed. \r\nError in e$fun(obj, substitute(ex), parent.frame(), e$data) : \r\n  object 'results' not found\r\nCalled from: e$fun(obj, substitute(ex), parent.frame(), e$data)\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/doAzureParallel/issues/comments/451449276","html_url":"https://github.com/Azure/doAzureParallel/issues/334#issuecomment-451449276","issue_url":"https://api.github.com/repos/Azure/doAzureParallel/issues/334","id":451449276,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTQ0OTI3Ng==","user":{"login":"angusrtaylor","id":19972816,"node_id":"MDQ6VXNlcjE5OTcyODE2","avatar_url":"https://avatars2.githubusercontent.com/u/19972816?v=4","gravatar_id":"","url":"https://api.github.com/users/angusrtaylor","html_url":"https://github.com/angusrtaylor","followers_url":"https://api.github.com/users/angusrtaylor/followers","following_url":"https://api.github.com/users/angusrtaylor/following{/other_user}","gists_url":"https://api.github.com/users/angusrtaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/angusrtaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angusrtaylor/subscriptions","organizations_url":"https://api.github.com/users/angusrtaylor/orgs","repos_url":"https://api.github.com/users/angusrtaylor/repos","events_url":"https://api.github.com/users/angusrtaylor/events{/privacy}","received_events_url":"https://api.github.com/users/angusrtaylor/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T13:54:00Z","updated_at":"2019-01-04T13:54:00Z","author_association":"CONTRIBUTOR","body":"I'm getting the same error even with `enableCloudCombine = FALSE`. In my code, I am not returning any results from the %dopar% block. Instead, I am just writing my result dataframe to disk. My code runs correctly but the error still appears. Is there a way to avoid this error when the code intentionally does not return a result?"}}
{"actor":{"display_login":"angusrtaylor"}}