I have a website that uses Meteor 0.9. I deployed this site to OpenShift ( http://www.truthpecker.com ).
The problem that I encountered is that when I go to the path on my site (/ discover), sometimes (though not always) the necessary data is not accepted by the Meteor. Instead, I get the following errors:
On the client side:
WebSocket connection to 'ws://www.truthpecker.com/sockjs/796/3tfowlag/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
And on the server side:
Exception from sub rD8cj6FGa6bpTDivh Error: Match error: Failed Match.OneOf or Match.Optional validation at checkSubtree (packages/check/match.js:222) at check (packages/check/match.js:21) at _.extend._getFindOptions (packages/mongo-livedata/collection.js:216) at _.extend.find (packages/mongo-livedata/collection.js:236) at Meteor.publish.Activities.find.user [as _handler] (app/server/publications.js:41:19) at maybeAuditArgumentChecks (packages/livedata/livedata_server.js:1492) at _.extend._runHandler (packages/livedata/livedata_server.js:914) at _.extend._startSubscription (packages/livedata/livedata_server.js:764) at _.extend.protocol_handlers.sub (packages/livedata/livedata_server.js:577) at packages/livedata/livedata_server.js:541 Sanitized and reported to the client as: Match failed [400]
Can someone help me fix this error and make the site work? I would be very grateful!
Tony
PS: I never got this error using localhost.
EDIT:
The line causing the problem is the problem (line 41):
return Activities.find({user: id}, {sort: {timeStamp: -1}, limit:40});
One document in the action collection is as follows:
{ "user" : "ZJrgYm34rR92zg6z7", "type" : "editArg", "debId" : "wtziFDS4bB3CCkNLo", "argId" : "YAnjh2Pu6QESzHQLH", "timeStamp" : ISODate("2014-09-12T22:10:29.586Z"), "_id" : "sEDDreehonp67haDg" }
When I run the query on line 41 in the mongo shell, I get the following error:
error: { "$err" : "Unsupported projection option: timeStamp", "code" : 13097 }
I really donโt understand why this is so. Can you help me there too? Thanks.