Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning when using Etherpad remotely #3645

Closed
Duddy67 opened this issue Oct 1, 2019 · 3 comments
Closed

UnhandledPromiseRejectionWarning when using Etherpad remotely #3645

Duddy67 opened this issue Oct 1, 2019 · 3 comments
Labels
async-migration Migration from callback-style programming to async functions

Comments

@Duddy67
Copy link

Duddy67 commented Oct 1, 2019

I installed Node.js on my server to run Etherpad Lite in order to use it remotely.
Etherpad Lite is called through its API from another website.
But when the website tries to load a pad previously created I get these errors:

[2019-10-01 06:29:49.378] [INFO] API - REQUEST, v1.2.11:listSessionsOfGroup, {"groupID":"g.tmG0M1C0NlWZmIda","apikey":"c3bbaabe1dcdf87c88bcaf744069e8c7e5270b7b331d484faa2debd957701064"}
[2019-10-01 06:29:49.379] [INFO] API - RESPONSE, listSessionsOfGroup, {"code":0,"message":"ok","data":{"s.352dc0a46382ab16c030d93c31e5a33d":{"groupID":"g.tmG0M1C0NlWZmIda","authorID":"a.NQUUTpWqPVV2LezT","validUntil":1569911468}}}
[2019-10-01 06:29:49.391] [INFO] API - REQUEST, v1.2.11:listSessionsOfGroup, {"groupID":"g.tmG0M1C0NlWZmIda","apikey":"c3bbaabe1dcdf87c88bcaf744069e8c7e5270b7b331d484faa2debd957701064"}
[2019-10-01 06:29:49.392] [INFO] API - RESPONSE, listSessionsOfGroup, {"code":0,"message":"ok","data":{"s.352dc0a46382ab16c030d93c31e5a33d":{"groupID":"g.tmG0M1C0NlWZmIda","authorID":"a.NQUUTpWqPVV2LezT","validUntil":1569911468}}}
[2019-10-01 06:29:49.406] [INFO] ueberDB - Flushed 2 values
[2019-10-01 06:29:49.706] [INFO] ueberDB - Flushed 1 values
[2019-10-01 06:29:49.906] [INFO] ueberDB - Flushed 1 values
[2019-10-01 06:29:50.007] [INFO] ueberDB - Flushed 1 values
[2019-10-01 06:29:50.039] [ERROR] console - (node:2498) UnhandledPromiseRejectionWarning: apierror: sessionID does not exist
    at Object.exports.getSessionInfo (/home/etherpad/etherpad-lite/src/node/db/SessionManager.js:128:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2019-10-01 06:29:50.044] [ERROR] console - (node:2498) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
[2019-10-01 06:29:50.108] [INFO] ueberDB - Flushed 1 values

I checked in the MySQL Etherpad store table but the session does exist.
So I have no idea where those errors come from.
Can someone help me.

Ubuntu 18.04
Node.js v10.16.3
Etherpad 1.7.5
MySQL 5.7

@muxator
Copy link
Contributor

muxator commented Nov 26, 2019

That kind of error on src/node/db/SessionManager.js:128 seems to be more compatible with a version after 1.7.5 (specifically, after #3540 was merged).

Etherpad 1.8.0-beta.1 code:

exports.getSessionInfo = async function(sessionID)
{
// check if the database entry of this session exists
let session = await db.get("session:" + sessionID);
if (session == null) {
// session does not exist
throw new customError("sessionID does not exist", "apierror");
}
// everything is fine, return the sessioninfos
return session;
}

At the same location, Etherpad 1.7.5 has an empty line :)

db.set("session:" + sessionID, {"groupID": groupID, "authorID": authorID, "validUntil": validUntil});
callback();
},

@muxator muxator added the async-migration Migration from callback-style programming to async functions label Nov 26, 2019
@muxator
Copy link
Contributor

muxator commented Dec 25, 2019

@Duddy67, did you happen to step on this error again? Do you remember which Etherpad version you were using?

I am debugging an unrelated issue (#3600) that also manifests in API calls. It is possible that the work there may give some ideas about this.

@JohnMcLear
Copy link
Member

Closing due to staleness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async-migration Migration from callback-style programming to async functions
Projects
None yet
Development

No branches or pull requests

3 participants