Skip to content

Postgres: unhandledpromiserejectionwarning _Session #4169

Closed

Description

@dplewis

While running test I saw the following error. Just wanted to make sure there wasn't a bigger issue here.

 it("user sign up class method", (done) => {
    Parse.User.signUp("asdf", "zxcv", null, {
      success: function(user) {
        ok(user.getSessionToken());
        done();
      }
    });
  });
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): error: relation "_Session" does not exist
debug: PG: find _User { username: 'asdf', objectId: { '$ne': 'vOHJPeTw7S' } } skip=undefined, limit=1, , keys=undefined
debug: PG: SELECT * FROM $1:name WHERE $2:name = $3 AND ($4:name <> $5 OR $4:name IS NULL)  LIMIT $6  0=_User, 1=username, 2=asdf, 3=objectId, 4=vOHJPeTw7S, 5=1
debug: PG: createObject _User username=asdf, iso=2017-09-15T18:19:38.333Z, __type=Date, iso=2017-09-15T18:19:38.333Z, __type=Date, objectId=vOHJPeTw7S, _hashed_password=$2a$10$4ttN924ZugTtrK51j0Um5eQ3nrd8VIqemj2n2zJmuE1hm1Rg7Ylfa, _wperm=[vOHJPeTw7S], _rperm=[*, vOHJPeTw7S]
debug: PG: INSERT INTO $1:name ($2:name,$3:name,$4:name,$5:name,$6:name,$7:name,$8:name) VALUES ($9,$10,$11,$12,$13,$14::text[],$15::text[]) 0=_User, 1=username, 2=updatedAt, 3=createdAt, 4=objectId, 5=_hashed_password, 6=_wperm, 7=_rperm, 8=asdf, 9=2017-09-15T18:19:38.333Z, 10=2017-09-15T18:19:38.333Z, 11=vOHJPeTw7S, 12=$2a$10$4ttN924ZugTtrK51j0Um5eQ3nrd8VIqemj2n2zJmuE1hm1Rg7Ylfa, 13=[vOHJPeTw7S], 14=[*, vOHJPeTw7S]
debug: PG: getClass _Session
debug: PG: createTable _Session className=_Session, type=String, type=Date, type=Date, type=Boolean, type=Pointer, targetClass=_User, type=String, type=String, type=Date, type=Object, type=Array, type=Array, classLevelPermissions=undefined
debug: PG: deleteObjectsByQuery _Session __type=Pointer, className=_User, objectId=vOHJPeTw7S, installationId=10e643d6-bf04-3c44-000f-b6a445c0edef, $ne=r:05445db59e5293e467d97fa6448e78eb
debug: PG: WITH deleted AS (DELETE FROM $1:name WHERE $2:name = $3 AND $4:name = $5 AND ($6:name <> $7 OR $6:name IS NULL) RETURNING *) SELECT count(*) FROM deleted 0=_Session, 1=user, 2=vOHJPeTw7S, 3=installationId, 4=10e643d6-bf04-3c44-000f-b6a445c0edef, 5=sessionToken, 6=r:05445db59e5293e467d97fa6448e78eb
(node:24675) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): error: relation "_Session" does not exist
debug: PG: createObject _Session sessionToken=r:05445db59e5293e467d97fa6448e78eb, __type=Pointer, className=_User, objectId=vOHJPeTw7S, action=signup, authProvider=password, restricted=false, installationId=10e643d6-bf04-3c44-000f-b6a445c0edef, __type=Date, iso=2018-09-15T18:19:38.449Z, iso=2017-09-15T18:19:38.449Z, __type=Date, iso=2017-09-15T18:19:38.449Z, __type=Date, objectId=5ZnKhwlNwq
debug: PG: INSERT INTO $1:name ($2:name,$3:name,$4:name,$5:name,$6:name,$7:name,$8:name,$9:name,$10:name) VALUES ($11,$12,$13,$14,$15,$16,$17,$18,$19) 0=_Session, 1=sessionToken, 2=user, 3=createdWith, 4=restricted, 5=installationId, 6=expiresAt, 7=updatedAt, 8=createdAt, 9=objectId, 10=r:05445db59e5293e467d97fa6448e78eb, 11=vOHJPeTw7S, action=signup, authProvider=password, 13=false, 14=10e643d6-bf04-3c44-000f-b6a445c0edef, 15=2018-09-15T18:19:38.449Z, 16=2017-09-15T18:19:38.449Z, 17=2017-09-15T18:19:38.449Z, 18=5ZnKhwlNwq
debug: PG: find _Session { sessionToken: 'r:05445db59e5293e467d97fa6448e78eb' } skip=undefined, limit=1, , keys=undefined
debug: PG: SELECT * FROM $1:name WHERE $2:name = $3  LIMIT $4  0=_Session, 1=sessionToken, 2=r:05445db59e5293e467d97fa6448e78eb, 3=1
debug: PG: find _User { objectId: 'vOHJPeTw7S' } skip=undefined, limit=undefined, , keys=undefined
debug: PG: SELECT * FROM $1:name WHERE $2:name = $3    0=_User, 1=objectId, 2=vOHJPeTw7S
debug: PG: find _Session { sessionToken: 'r:05445db59e5293e467d97fa6448e78eb' } skip=undefined, limit=undefined, , keys=undefined
debug: PG: SELECT * FROM $1:name WHERE $2:name = $3    0=_Session, 1=sessionToken, 2=r:05445db59e5293e467d97fa6448e78eb
debug: PG: find _Session { objectId: '5ZnKhwlNwq' } skip=undefined, limit=undefined, , keys=undefined
debug: PG: SELECT * FROM $1:name WHERE $2:name = $3    0=_Session, 1=objectId, 2=5ZnKhwlNwq
debug: PG: deleteObjectsByQuery _Session objectId=5ZnKhwlNwq
debug: PG: WITH deleted AS (DELETE FROM $1:name WHERE $2:name = $3 RETURNING *) SELECT count(*) FROM deleted 0=_Session, 1=objectId, 2=5ZnKhwlNwq

Activity

  1. flovilmart commented on Sep 15, 2017

    @flovilmart
    Contributor

    That’s odd maybe because inside TX?

  2. dplewis commented on Sep 15, 2017

    @dplewis
    MemberAuthor

    @vitaly-t Is it save to catch the error and ignore it?

  3. vitaly-t commented on Sep 16, 2017

    @vitaly-t
    Contributor

    Well, if you execute a query without any .then and .catch - that's both unreliable in terms of the data you are getting back, and dangerous, while ignoring any possible errors. Other than that, I don't know any specific of the test, as I've never run those for parse-server.

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