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

createGroupPad() requests are dying when starter text is too big #23

Open
boonebgorges opened this issue Jan 17, 2013 · 5 comments
Open

Comments

@boonebgorges
Copy link
Owner

When creating a new pad from an existing WP post, Participad creates a new pad using the createGroupPad API method. The third parameter is the WP post text. When there's more than a few lines of text, the request URI (the API request works over GET) is too large, and Participad gets a 414 back.

This causes a number of problems.

  1. Pads are not created for these posts (obviously this is the biggest problem)
  2. There's no good error handler in place in Participad for this case (Participad_Post::create_ep_post()). When a createGroupPad request fails, Participad assumes that it's because of a name conflict, and it attempts to create a the pad with a new index. This results in an infinite loop of requests while the page is open.
  3. As a result of 2, the EPL error logs can get really big really fast.

The first thing that should be fixed (which is pretty straightforward) is to do a better job in create_ep_post() of detecting failure. Apparently the API lib is not bailing with an Exception, so I'll have to inspect the return value and bail if it's a 414. This will at least prevent 2 and 3.

Fixing 1, the real root problem, is more complicated. I guess I'll have to stop pre-populating pad content over the HTTP API. I'll try to do it client-side instead. Once the editor is loaded (perhaps postAceInit http://etherpad.org/doc/v1.2.0/#index_client_side_hooks), I'll inject the editor with the WP post content, and let EPL think the content has been typed natively into the editor.

@JohnMcLear
Copy link

Why does Etherpad think the content is too big? Can you replicate the problem outside of participad? It might be something we need to adjust in the api

@boonebgorges
Copy link
Owner Author

The problem is that the request looks like

GET /pad/api/1/createGroupPad?apikey=abcde&groupID=g.WAGuIMfRytqm6O
oX&padName=387193bee0297bbbc5b251837e0f660e&text=lorem+ipsum+foo+bar

When that text gets really long - longer than Apache's LimitRequestLine
setting - Apache refuses the request and returns a 414.

I don't think this is an EPL issue, as I haven't seen it on every
server. I'm in the process of doing more testing.

On 01/17/2013 03:47 PM, John McLear wrote:

Why does Etherpad think the content is too big? Can you replicate the
problem outside of participad? It might be something we need to adjust
in the api


Reply to this email directly or view it on GitHub
#23 (comment).

@JohnMcLear
Copy link

Righto, we might need a way for createGroupPad to support a "textURL" or something to grab the text from a URL or so, I'd rather avoid doing that though and I'm not sure WP cleanly exposes text (other than maybe grabbing from inside main post div tags) ;/
Will keep an eye on this.

John McLearMcLear LtdEtherpad FoundationPrimary Technology Ltd

Date: Thu, 17 Jan 2013 12:54:11 -0800
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [participad] createGroupPad() requests are dying when starter text is too big (#23)

The problem is that the request looks like

GET /pad/api/1/createGroupPad?apikey=abcde&groupID=g.WAGuIMfRytqm6O

oX&padName=387193bee0297bbbc5b251837e0f660e&text=lorem+ipsum+foo+bar

When that text gets really long - longer than Apache's LimitRequestLine

setting - Apache refuses the request and returns a 414.

I don't think this is an EPL issue, as I haven't seen it on every

server. I'm in the process of doing more testing.

On 01/17/2013 03:47 PM, John McLear wrote:

Why does Etherpad think the content is too big? Can you replicate the

problem outside of participad? It might be something we need to adjust

in the api

Reply to this email directly or view it on GitHub

#23 (comment).

          —

          Reply to this email directly or view it on GitHub.

@boonebgorges
Copy link
Owner Author

Would allowing requests to the API via POST help with this? I assume
that POST payload is less limited as far as size is concerned.

On 01/17/2013 03:58 PM, John McLear wrote:

Righto, we might need a way for createGroupPad to support a "textURL" or
something to grab the text from a URL or so, I'd rather avoid doing that
though and I'm not sure WP cleanly exposes text (other than maybe
grabbing from inside main post div tags) ;/
Will keep an eye on this.

John McLearMcLear LtdEtherpad FoundationPrimary Technology Ltd

Date: Thu, 17 Jan 2013 12:54:11 -0800
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [participad] createGroupPad() requests are dying when
starter text is too big (#23)

The problem is that the request looks like

GET /pad/api/1/createGroupPad?apikey=abcde&groupID=g.WAGuIMfRytqm6O

oX&padName=387193bee0297bbbc5b251837e0f660e&text=lorem+ipsum+foo+bar

When that text gets really long - longer than Apache's LimitRequestLine

setting - Apache refuses the request and returns a 414.

I don't think this is an EPL issue, as I haven't seen it on every

server. I'm in the process of doing more testing.

On 01/17/2013 03:47 PM, John McLear wrote:

Why does Etherpad think the content is too big? Can you replicate the

problem outside of participad? It might be something we need to adjust

in the api

Reply to this email directly or view it on GitHub

#23 (comment).

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#23 (comment).

@JohnMcLear
Copy link

Yea actually it should..
Good point..
POST is way better.

John McLearMcLear LtdEtherpad FoundationPrimary Technology Ltd

Date: Thu, 17 Jan 2013 13:27:43 -0800
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [participad] createGroupPad() requests are dying when starter text is too big (#23)

Would allowing requests to the API via POST help with this? I assume

that POST payload is less limited as far as size is concerned.

On 01/17/2013 03:58 PM, John McLear wrote:

Righto, we might need a way for createGroupPad to support a "textURL" or

something to grab the text from a URL or so, I'd rather avoid doing that

though and I'm not sure WP cleanly exposes text (other than maybe

grabbing from inside main post div tags) ;/

Will keep an eye on this.

John McLearMcLear LtdEtherpad FoundationPrimary Technology Ltd

Date: Thu, 17 Jan 2013 12:54:11 -0800

From: [email protected]

To: [email protected]

CC: [email protected]

Subject: Re: [participad] createGroupPad() requests are dying when

starter text is too big (#23)

The problem is that the request looks like

GET /pad/api/1/createGroupPad?apikey=abcde&groupID=g.WAGuIMfRytqm6O

oX&padName=387193bee0297bbbc5b251837e0f660e&text=lorem+ipsum+foo+bar

When that text gets really long - longer than Apache's LimitRequestLine

setting - Apache refuses the request and returns a 414.

I don't think this is an EPL issue, as I haven't seen it on every

server. I'm in the process of doing more testing.

On 01/17/2013 03:47 PM, John McLear wrote:

Why does Etherpad think the content is too big? Can you replicate the

problem outside of participad? It might be something we need to adjust

in the api

Reply to this email directly or view it on GitHub

#23 (comment).

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub

#23 (comment).

          —

          Reply to this email directly or view it on GitHub.

boonebgorges added a commit that referenced this issue Jan 22, 2013
This technique prevents infinite loops when an unexpected result is returned
by requests to Etherpad Lite, such as for an overlong request URI.

See #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants