Skip to content

Schema mismatch for _Session.expiresAt #220

Description

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

Activity

  1. gfosco commented on Feb 3, 2016

    @gfosco
    Contributor

    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.

  2. hafizapp commented on Feb 3, 2016

    @hafizapp

    @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

  3. blackxored commented on Feb 3, 2016

    @blackxored
    Author

    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.

  4. chuckurbis commented on Feb 4, 2016

    @chuckurbis

    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!

  5. gfosco commented on Feb 4, 2016

    @gfosco
    Contributor

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

  6. chuckurbis commented on Feb 4, 2016

    @chuckurbis

    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"
    }

  7. gfosco commented on Feb 4, 2016

    @gfosco
    Contributor

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

  8. chuckurbis commented on Feb 4, 2016

    @chuckurbis

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

  9. added a commit that references this issue on Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions