ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.08k stars 2.79k forks source link

socket.io - handshake error Bad session #1734

Closed keyndark closed 11 years ago

keyndark commented 11 years ago

Hi! I got error when access exists or new pad after update node.js and etherpad-lite from repo. I have sessionKey with value in settings.json.

[2013-04-14 12:07:11.591] [WARN] socket.io - handshake error Bad session / session has expired

$ node -v
v0.10.4

$ git pull
Already up-to-date.

$ ./bin/run.sh
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
Ensure jQuery is downloaded and up to date...
Clear minfified cache...
ensure custom css/js files are created...
start...
[2013-04-14 12:06:34.527] [INFO] console - Installed plugins: ep_etherpad-lite
[2013-04-14 12:06:34.551] [INFO] console - Your Etherpad Lite git version is 08b54ef
[2013-04-14 12:06:34.552] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2013-04-14 12:06:34.586] [INFO] console -    info  - 'socket.io started'
[2013-04-14 12:06:34.622] [INFO] console - You can access your Etherpad-Lite instance at http://0.0.0.0:9001/
[2013-04-14 12:06:34.622] [INFO] console - The plugin admin page is at http://0.0.0.0:9001/admin/plugins
[2013-04-14 12:06:40.048] [INFO] ueberDB - Flushed 1 values
[2013-04-14 12:06:40.812] [INFO] ueberDB - Flushed 1 values
[2013-04-14 12:06:42.512] [INFO] ueberDB - Flushed 1 values
[2013-04-14 12:06:42.712] [INFO] ueberDB - Flushed 2 values
[2013-04-14 12:06:42.832] [WARN] socket.io - handshake error Bad session / session has expired
JohnMcLear commented 11 years ago

That shouldn't matter, does it affect user experience at all? Sessions are allowed to expire.

0ip commented 11 years ago

Same here on Ubuntu 12.04 w/ nodejs v0.10.4/0.8.9.

rddaz2013 commented 11 years ago

Fedora 18 // nodejs v0.10.4 // chrome Version 26.0.14.10.63 Etherpad Lite git version is 08b54ef

same thing

Etherpad stop's at loading text on screen.

rgbkrk commented 11 years ago

Freshly setup nvm (tried node 0.8.23, 0.10.4) and etherpad-lite, running into same problem. I can't get past a loading screen in the browser.

Are the Travis tests misreporting success?

JackPo commented 11 years ago

yup, same problem here.

OSX // nodejs v 0.10.4

Djcd commented 11 years ago

can also confirm this problem with nodejs 0.8.9 and ubuntu 12.04 with a fresh installed system, stuck on loading screen

unshorn commented 11 years ago

Same problem OS X nodejs v0.10.4

interbr commented 11 years ago

Struggled with this too after updating on ubuntu 10.04 Commenting out // if (err || !session) return accept('Bad session / session has expired', false); in src/node/hooks/express/socketio.js makes it load again. Admin-Panel is still not functional after this.

JohnMcLear commented 11 years ago

Fixed in develop, releasing to Master now. Really could do with help releasing if anyone has some spare time to create packages, do blog post etc.. I need to run..

svrkispm commented 11 years ago

I am still having this problem, my system is CentOS 6.4, node.js 0.10.4, I am not sure how to view current version, but I have done git pull origin and git show lists: commit 2c8699506d3c1a46a9fd1afae8ec1dcb69811905 Author: John McLear john@mclear.co.uk Date: Mon Apr 15 12:21:10 2013 +0100

push express back as it breaks sessions
JohnMcLear commented 11 years ago

Can anyone else please test?

What does src/package.json show for express?

Djcd commented 11 years ago

Hi John,

deleted the complete etherpad folder and cloned it again. Your commit fixed the error on my installation (Ubuntu 12.04 and Nodejs 0.8.9), the package.json shows
"express" : "3.1.0", therefore it contains your fix ;)

Thank you

JackPo commented 11 years ago

it works now for me!

JackPo commented 11 years ago

now a second problem shows up. It doesn't happen when one user is connected, but when a second user is connected to the same pad, etherpad instantly crashes:

[2013-04-15 08:26:28.913] [INFO] access - [CREATE] Pad "bronx": Client llmovxoCOXAmJbqXqNMx with IP "160.39.240.27" created the pad [2013-04-15 08:26:28.916] [ERROR] console - Error: Not sending the same event twice... at Object.exports.prepareForWire (/opt/etherpad-lite/src/static/js/Changeset.js:1671:11) at /opt/etherpad-lite/src/node/handler/PadMessageHandler.js:991:40 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:486:21 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:185:13 at iterate (/opt/etherpad-lite/src/node_modules/async/lib/async.js:108:13) at /opt/etherpad-lite/src/node_modules/async/lib/async.js:119:25 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:187:17 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:491:34 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:190:13 at /opt/etherpad-lite/src/node_modules/async/lib/async.js:94:25 [2013-04-15 08:26:28.935] [INFO] console - graceful shutdown... [2013-04-15 08:26:28.947] [INFO] ueberDB - Flushed 1 values [2013-04-15 08:26:29.049] [INFO] console - db sucessfully closed.

keyndark commented 11 years ago

Thanks, now can access pads, but update page with opened pad got this error:

[2013-04-15 15:18:17.332] [INFO] socket.io - handshake authorized 'XgbW4vQo9rGQqNtXoXgD'
[2013-04-15 15:18:17.350] [INFO] ueberDB - Flushed 1 values
[2013-04-15 15:18:17.451] [INFO] ueberDB - Flushed 1 values
[2013-04-15 15:18:17.468] [INFO] access - [ENTER] Pad "test": Client XgbW4vQo9rGQqNtXoXgD with IP "127.0.0.1" entered the pad
[2013-04-15 15:18:17.470] [ERROR] console - Error: Not sending the same event twice...
    at Object.exports.prepareForWire (/usr/share/etherpad-lite/src/static/js/Changeset.js:1671:11)
    at /usr/share/etherpad-lite/src/node/handler/PadMessageHandler.js:991:40
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:486:21
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:185:13
    at iterate (/usr/share/etherpad-lite/src/node_modules/async/lib/async.js:108:13)
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:119:25
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:187:17
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:491:34
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:190:13
    at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:94:25
[2013-04-15 15:18:17.470] [INFO] console - graceful shutdown...
[2013-04-15 15:18:17.551] [INFO] ueberDB - Flushed 1 values
[2013-04-15 15:18:17.651] [INFO] console - db sucessfully closed.

Chrome 26.0.1410.64 m

An error occured
The error was reported with the following id: 'f91UD3vj6wjX5JZyCZGV'

Please send this error message to us:
'ErrorId: f91UD3vj6wjX5JZyCZGV
URL: http://mypad/p/test
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Uncaught TypeError: Cannot call method 'setChannelState' of null in http://mypad/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define at line 3'

Opera 12.15.1748

An error occured
The error was reported with the following id: 'Hj9fRINYGTYYkl3NsE9r'

Please send this error message to us: 
'ErrorId: Hj9fRINYGTYYkl3NsE9r
URL: http://mypad/p/left4dead2
UserAgent: Opera/9.80 (Windows NT 6.1; Win64; x64) Presto/2.12.388 Version/12.15
Uncaught exception: TypeError: Cannot convert 'pad.collabClient' to object in http://mypad/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define at line 3'
svrkispm commented 11 years ago

I have deleted whole folder, cloned from git again and now it works fine

JackPo commented 11 years ago

I pull down a new clone from git and it doesn't change the error above.

JohnMcLear commented 11 years ago

hrm, crap, will test that.

JohnMcLear commented 11 years ago

Insert expletive here.. Fixing and releasing.. GAH

0ip commented 11 years ago

946289c221 broke it, right? ;)

JohnMcLear commented 11 years ago

Right it was there for over a week and no one tested it, thanks guys.

JohnMcLear commented 11 years ago

Fixed by removing the bad patch. Someone really needs to address that issue though...

ali commented 11 years ago

Thanks, @JohnMcLear. Updated my install and everything works now.

rddaz2013 commented 11 years ago

everything works now, after updating..thx

ding444 commented 11 years ago

I'm still seeing the same error off of the current version. I just pulled it down about 5 min ago and see

[2013-04-15 15:51:00.969] [WARN] socket.io - handshake error Bad session / session has expired

Also plugins never load on the admin screen

JohnMcLear commented 11 years ago

@ding444 how did you pull it down and did you clear your cache & restart the Etherpad instance? I'm 99% sure it's fixed.

ding444 commented 11 years ago

I did a clone off of the development branch. I've cleared the cache, tried 3 different browsers, and restarted the server multiple times. I also deleted the whole folder, re-cloned it and tried it before modifying any settings.

This was a fresh install.

JohnMcLear commented 11 years ago

Ugh, for some reason your node deps cache isn't clearing after getting an updated packages.json

do this..

git checkout develop
git pull origin develop
rm -Rf src/node_modules
bin/run.sh
JohnMcLear commented 11 years ago

Oh wait, I just got it on a fresh clone.. Ugh you have to be kidding me :|

JohnMcLear commented 11 years ago

Okay pull develop, run, I reverted the express upgrade, I guess something is still really broken with that dep

ding444 commented 11 years ago

It works now!

LongHairedHacker commented 11 years ago

I ran into this problem this weekend, latest commit seems to have fixed it. Didn't get a lot of sleep beacause of this nasty bug .... so thanks a lot !

I'm running ubuntu 11.10 with node v0.10.4.

JohnMcLear commented 11 years ago

No worries, it's only a temporary fix btw, one of our middleware apps causes the issue so really we need some resources/donations so we can fund a proper fix! Big donation buttons are on http://etherpad.org :)