{"action":"opened","issue":{"url":"https://api.github.com/repos/peerlibrary/meteor-aws-sdk/issues/26","labels_url":"https://api.github.com/repos/peerlibrary/meteor-aws-sdk/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/peerlibrary/meteor-aws-sdk/issues/26/comments","events_url":"https://api.github.com/repos/peerlibrary/meteor-aws-sdk/issues/26/events","html_url":"https://github.com/peerlibrary/meteor-aws-sdk/issues/26","id":110894332,"number":26,"title":"Meteor Fiber error on upsert","user":{"login":"aadamsx","id":5341158,"avatar_url":"https://avatars.githubusercontent.com/u/5341158?v=3","gravatar_id":"","url":"https://api.github.com/users/aadamsx","html_url":"https://github.com/aadamsx","followers_url":"https://api.github.com/users/aadamsx/followers","following_url":"https://api.github.com/users/aadamsx/following{/other_user}","gists_url":"https://api.github.com/users/aadamsx/gists{/gist_id}","starred_url":"https://api.github.com/users/aadamsx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aadamsx/subscriptions","organizations_url":"https://api.github.com/users/aadamsx/orgs","repos_url":"https://api.github.com/users/aadamsx/repos","events_url":"https://api.github.com/users/aadamsx/events{/privacy}","received_events_url":"https://api.github.com/users/aadamsx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-12T00:45:03Z","updated_at":"2015-10-12T00:45:03Z","closed_at":null,"body":"I'm trying to run the following code but get the infamous 'Meteor code must always run within a Fiber...'\r\n\r\nHere's the basic code:\r\n\r\n```\r\n       sns.listSubscriptionsByTopic({NextToken: nextToken}, function (err, data) {\r\n            debugger;\r\n            if (err) console.log(err, err.stack); // an error occurred\r\n            else {\r\n              // call ListSubscriptionsByTopic again?  How?\r\n              subscriptions = data.Subscriptions;\r\n\r\n              // if (NextToken) {\r\n              //   nextToken = NextToken;\r\n              //   index = index + 1;\r\n              // } else {\r\n              //   nextToken = null;\r\n              // }\r\n\r\n              if (subscriptions) {\r\n                var length = subscriptions.length;\r\n\r\n                for (var i = 0; i < length; i++) {\r\n                  var sub = subscriptions[i];\r\n                  smsSubscriptions.upsert({endPoint: sub.Endpoint}, {\r\n                    $set: {\r\n                      endPoint: sub.Endpoint,\r\n                      owner: sub.Owner,\r\n                      subArn: sub.SubscriptionArn,\r\n                      timeStamp: new Date()\r\n                    }\r\n                  });\r\n                }\r\n              }\r\n            }\r\n          })\r\n      }\r\n      while (nextToken !== null);\r\n```\r\n\r\nI can call out to a collection, but any attempt to insert, upsert fails with the Fiber error.  I've tried to do the wrapAync, bindEnviornment but nothing seems to work -- i still get the Fiber error.\r\n\r\nThis code running on the server inside a method.\r\n\r\nAny help is appreciated."}}