parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Schema mismatch for _Session.expiresAt

Open blackxored opened this issue 10 years ago • 8 comments

error: ParseError {
  code: 111,
  message: 'schema mismatch for _Session.expiresAt; expected number but got date' 
}

blackxored avatar Feb 03 '16 19:02 blackxored

This symptom should be fixed in the latest version, 2.0.6, but if you had run an older version, your _SCHEMA record for _Session may have been committed with "number" as the type for the "expiresAt" column. In that case, you will need to edit the entry in your mongo database. If you need help with that, let us know.

gfosco avatar Feb 03 '16 19:02 gfosco

@gfosco On my local server shows this - [Error]: schema mismatch for _Session.expiresAt; expected date but got string (Code: 111, Version: 1.12.0)

But on the heroku server with the same mongo database uri it's working as expected.

NOTE: I am using 2.0.6 on my local server just updated and on heroku I deployed the server by clicking on the deploy button on github repo of parse-server-example. Please advice whats the issue. Thanks

hafizapp avatar Feb 03 '16 20:02 hafizapp

You're right, I ran this:

db.getCollection('_SCHEMA').update({_id: '_Session'}, {'$set': {expiresAt: 'date'}})

on a mongo shell and it appears to be working.

blackxored avatar Feb 03 '16 20:02 blackxored

Hi, I changed my schema in and I'm still having this issue. I am using MongoLabs for my db provider. Any idea why this would still be happening? The issue happens both from an iPhone app and from Javascript. Thanks!

chuckurbis avatar Feb 04 '16 00:02 chuckurbis

If you've changed the schema, what is the error you're getting now?

gfosco avatar Feb 04 '16 00:02 gfosco

I'm getting the same error and I'm not really sure why that would be. This is what I get:

schema mismatch for _Session.expiresAt; expected string but got date

This is what my schema looks like when I log in to mongo labs and look at the _SCHEMA:_Session document:

{ "id": "Session", "metadata": { "class_permissions": { "get": { "": true }, "find": { "": true }, "update": { "": true }, "create": { "": true }, "delete": { "": true }, "addField": { "_": true }, "readUserFields": [], "writeUserFields": [] } }, "expiresAt": "string", "createdWith": "object", "user": "*_User", "installationId": "string", "restricted": "boolean", "sessionToken": "string", "updatedAt": "string", "createdAt": "string", "objectId": "string" }

chuckurbis avatar Feb 04 '16 00:02 chuckurbis

You'll need to edit that entry and change the expiresAt entry from string to date.

gfosco avatar Feb 04 '16 00:02 gfosco

That did it for me. I thought it was the other way around. Thanks.

chuckurbis avatar Feb 04 '16 21:02 chuckurbis