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

HTTPS proxying returns "Import failed: Please copy paste" on import #976

Closed JohnMcLear closed 11 years ago

JohnMcLear commented 11 years ago

To replicate:

You will see the error.

Console returns:

Failed to load resource: the server responded with a status of 404 (Not Found) https://live.com/pad/static/js/jquery.js
Uncaught ReferenceError: $ is not defined 

The importiframe is probably playing a part somehow.

disy-mk commented 11 years ago

At least, although i would like to reproduce that error i cannot achieve the same result (epl v.1.1.3).

Following you steps i chose a pdf to be imported and it seems to parse the file. Shortly after parsing the file, an error appears between the "select file" and "import now" buttons:

Import failed: Please copy paste <<

Though, the pdf content is parsed and inside the text area.

Console log: [2012-10-03 21:26:36.029] [INFO] http - 200, POST /p/import_new/import [2012-10-03 21:26:36.114] [INFO] ueberDB - Flushed 2 values

tjwelde commented 11 years ago

We have the same error here. -> https://github.com/Pita/etherpad-lite/issues/1105 I tested this also without https and still the same error!

To get rid of the 404 you have to modify "src/node/handler/ImportHandler.js":199 src='/static/js/jquery.js' -> src='../../static/js/jquery.js'

That's a good start, but other errors occur..

disy-mk commented 11 years ago

Hi,

as I once read that nginx causes problems, I tried to "outsource" things, that would have fallen back to nginx; so actually I am using stunnel, providing https for EPL behind nginx. That actually word, I do not get that error.

joker-x commented 11 years ago

No, in localhost without SSL, this bug appear too :S

JohnMcLear commented 11 years ago

Are you using http://localhost:9001 ? If so, why? Use the IP. So is Nginx the cause of this or?

@goldquest please give me EXACT steps to replicate this problem

tjwelde commented 11 years ago

pull latest changes from branch develop settings.json:

create a group create a grouppad create an author create a session for the author and the group

open the pad in an iframe click import/export, select a file and click import

JohnMcLear commented 11 years ago

Okay, does it also happen on public pads that are in iframes? That would remove the majority of your replication requirements..

tjwelde commented 11 years ago

Yes, same error with public pads in an iframe. ^^ only 3 lines remaining

JohnMcLear commented 11 years ago

So actual steps to replicate..

Put a pad in an iframe.. IE

<iframe src="http://beta.etherpad.org/p/pm7A2EnBzO" width=800px height=800px></iframe>

click import/export, select a file and click import

Example page to replicate: http://beta.etherpad.org/static/test.html

joker-x commented 11 years ago

In my local machine without SSL and without Nginx and with 127.0.0.1, with develop branch, this bug appear.

I could test in the server with nginx (in port 8080) and varnish (in port 80). Do I do it?

tjwelde commented 11 years ago

FYI: Status here (05.12.2012-15:48) When trying to import Server: [2012-12-05 15:47:06.131] [ERROR] console - TypeError: Object # has no method 'tmpDir' at /var/lib/nodejs/node-apps/etherpad-lite/src/node/handler/ImportHandler.js:94:31 at /var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:486:21 at /var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:185:13 at /var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:108:13 at /var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:119:25 at /var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:187:17 at Object.oncomplete (/var/lib/nodejs/node-apps/etherpad-lite/src/node_modules/async/lib/async.js:491:34) [2012-12-05 15:47:06.131] [INFO] console - graceful shutdown... [2012-12-05 15:47:06.131] [INFO] console - db sucessfully closed.

JohnMcLear commented 11 years ago

What OS and what version of node/npm? And what is your git rev? tmpDir afaik is used in latest develop. Please note that this is a separate issue @goldquest and is way more serious than the title issue.. @joker-x

tjwelde commented 11 years ago

OS: Ubuntu 12.04.1 LTS node: v0.6.12 npm: v1.1.4 git-rev: https://github.com/ether/etherpad-lite/commit/b5af6439692c8474766f445009666c256f25c143 if it helps, here is the result of the git bisect d0a17d547168a0bcb8e35a7f63ba37ad2d360f5c is the first bad commit commit d0a17d547168a0bcb8e35a7f63ba37ad2d360f5c Author: Iván Eixarch miao.org@gmail.com Date: Fri Nov 23 18:18:03 2012 +0100

test import converting to html instead to txt by default

:040000 040000 63d442ae48fc20a375566ffaa90400c8cc824b21 463fadca6074e2f1d355dc80dece649653879a7e M src

JohnMcLear commented 11 years ago

@goldquest see http://nodejs.org/ @joker-x you are going to have to tell users to upgrade if they aren't using node 8 afaik. I'm not sure what point os.tmpDir was introduced but afaik ti wasn't available in 6

tjwelde commented 11 years ago

fyi: My version is the actual version of nodejs distributed through apt-get

disy-mk commented 11 years ago

Maybe have a look at

http://dev.squarecows.com/2012/06/28/nodejs-0-8-on-ubuntu-12-04/

you also might consider installing nodejs-dev (http://www.ubuntuupdates.org/package/chris_lea_nodejs/precise/main/base/nodejs-dev) but I guess the first hint might be the better one

JohnMcLear commented 11 years ago

@goldquest Please read the INSTALL docs.

tjwelde commented 11 years ago

@disy-mk Thanks a lot. Good options, but I compiled it by myself now @johnyma22 I didn't find any notice about which version to use in the Install docs

tjwelde commented 11 years ago

@johnyma22 Ah you changed it, wonderfull! Sorry that it wasn't issue related, but good to have this clear

To be back on topic: Nothing changed! Same error as before.

joker-x commented 11 years ago

@johnyma22 i will fix it today ... sorry

Wikinaut commented 11 years ago

@johnyma22 @marcelklehr Just a question: is compatibility with older node versions really needed ?

joker-x commented 11 years ago

@Wikinaut i think so, many sysadmins only install from packages and node 0.8 isn't available from package in many distros

marcelklehr commented 11 years ago

Fixed by #1267, apparently

JohnMcLear commented 11 years ago

Can anyone running with HTTPS in front of their instance (IE proxy by apache or so) test this please?

Thanks

tjwelde commented 11 years ago

This is now tested with following configurations: Standard: over port 9001 nginx reverse proxy (always disabling the other possibilities):

  • HTTPS with and without path
  • HTTP with and without path

Everything is working as expected, but there is still the issue as discussed in https://github.com/ether/etherpad-lite/pull/1267

JohnMcLear commented 11 years ago

You are running latest develop?

tjwelde commented 11 years ago

No, at the time of the testing i was at 666c0adcd270e442a252b68274cac2bcdc1682fb

After the commit c6882aa65a20d2d7ab016acd61bc35a0f294b08c it's broken again

tjwelde commented 11 years ago

It's broken, when using HTTPS (with and without path)

The Url should be: https://**_.de/p/g.rTq5Oe6kh7zaVlsI$something2/import but is: https://**_.de/import

JohnMcLear commented 11 years ago

Weird cause I drop based on ?..

JohnMcLear commented 11 years ago

works fine

var pad_root_url = "http://test.com/p/foo?naked=true";
undefined
> var pad_root_url = pad_root_url.substring(0, pad_root_url.indexOf('?'));
undefined
> console.log(pad_root_url);
http://test.com/p/foo

doesnt work

> var pad_root_url = "http://test.com/p/g.rTq5Oe6kh7zaVlsI$something2";
undefined
> var pad_root_url = pad_root_url.substring(0, pad_root_url.indexOf('?'));
undefined
> console.log(pad_root_url);
undefined
>

heh it's obvious why this is broken.. fixing

JohnMcLear commented 11 years ago

Try now please

tjwelde commented 11 years ago

Yes, looks good now

JohnMcLear commented 11 years ago

So this can be closed or?

tjwelde commented 11 years ago

Yes, but we should keep an eye on the issue we discussed here: https://github.com/ether/etherpad-lite/pull/1267

JohnMcLear commented 11 years ago

So import is working but now it's hanging after successful import or?

tjwelde commented 11 years ago

I don't know if it's hanging, but after some minutes the red label appears: "Import failed, please copy and paste". Missing Callback? Missing functionality? EDIT: See closed issue #1395

xintellion commented 11 years ago

Was this issue fixed? I have exactly the same problem. The import is working but it is hanging after succesful import with the message: "Import failed, please copy and paste".

tjwelde commented 11 years ago

Yes, it is fully fixed in 1.2.7 and 1.2.10. Which version are you using?

xintellion commented 11 years ago

I think I am using 1.2.81 with node-v0.8.7. It is running behind a reverse proxy. I'll try upgrading it to 1.2.10 and see if it works.

xintellion commented 10 years ago

Thanks! Upgrading to 1.2.10 solved the problem.