Too many "invoice_line_ids" for one invoice : HTTP request too long

Bug #519720 reported by Alexandre (http://www.smile.fr)
88
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Medium
OpenERP R&D Web Team
5.0
Won't Fix
Undecided
Unassigned
Trunk
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

I use latest trunk version of the web-client (revno 2811) and of openerp-server (revno 1968)

After creating a new database, I create two draft invoices :
- first invoice "Invoice1" contains two invoice lines : 1 PC1 and 1 PC2
- second invoice "Invoice2" contains two invoice lines : 1 PC3 and 1 MB1
(PC1, PC2, PC3 and MB1 are products code for the invoice lines items).

In database, I get :
ID (invoice_line) INVOICE_ID
============================================
1 1 (Invoice1)
2 1 (Invoice1)
3 2 (Invoice2)
4 2 (Invoice2)

Up to now, it's OK.

Now, I open "Invoice1" and open the view "Invoice Line" by clicking on the first invoice line.
In the HTML code of the "invoice line" view, I get :
<input type="hidden" id="invoice_line/_terp_ids" name="invoice_line/_terp_ids" value="[1, 2, 3, 4]"/>

All invoice lines are here ! (allthough many lines don't belong to the current invoice !).
Then, by clicking on the "account" search help (magnifyng glass), all these invoice_line_ids are transmitted in a HTTP GET request, in an active_ids request parameter. This leads to a much-too-bigger HTTP GET request.

On a production base, with many invoices, and even more invoice lines, I currently get this :
Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.4 with Suhosin-Patch Server at <SERVER_NAME> Port <PORT>

That looks serious : from a certain number of invoice lines, it is not possible anymore to display, and modify the invoice lines !
Why are all invoice lines IDs transmitted ?

Attached file : the too-long request (look at "active_ids" parameter).

Revision history for this message
Alexandre (http://www.smile.fr) (alexandre-andrei) wrote :
affects: account-banking → openobject-client-web
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

We recently had to configure Apache (we use an Apache proxy to secure, via HTTPS, the connection) to allow bigger HTTP request lines, as OpenERP was using URLs way longer than 8KB (WTF!).

Maybe this bug was one of the causes of the problem.

As a workaround, the directive to set the max HTTP request line size on Apache is LimitRequestLine (http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestline); by default is 8KB, it worked for us setting it to 16KB.

Revision history for this message
Alexandre (http://www.smile.fr) (alexandre-andrei) wrote :

Our requests are currently weighing 18 kilobytes, and they'll keep growing (the size of the requests looks to depend on the increasing number of invoice lines).

We can't increase the Apache request size limit forever ! (How will we treat 100kb requests ?).

The fact that all the invoice lines of the database appears on a "Invoice" is not normal to me : we should only get the invoice lines related to the displayed invoice !

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi,

I bring some more information.

Revision history for this message
Supermanu35 (zephir35) wrote :

Hi !

I have one line in one2many list but all ids of table are included in the hidden field.
I have more than 130 000 lines on table, so the request is very very long (1mb), and require 2 or 3 minutes when we create or modify a line.

Any solution ?

(excuse my bad english, i'm french :-p )

Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

We have fixed the problem in lp:~openerp-dev/openobject-client-web/trunk-dev-web.
It will be merge with Trunk webclient branch soon so you can update your code.

Thanks.

Changed in openobject-client-web:
status: New → Fix Committed
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi sma,

You can patch stable version too, please. It's a great and waited fix.

Thanks

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

As an update, somebody reported that on some systems this bug may lead to segmentation faults on the web client: see bug 600792

summary: - Too many "invoice_line_ids" for one invoice : HTTP GET request too long
+ Too many "invoice_line_ids" for one invoice : HTTP request too long
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Seems that this problem is getting popular on 5.0, see bug 612501

sma, would it be posible to backport the fix from the 6.0 to the 5.0? What kind of fix was it?

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Any progress on this bug for 5.0 web client?

I just replied a related question: "Request-URI Too Large" https://answers.launchpad.net/openobject-client-web/+question/122536

Plus there are at least three duplicates of this bug for 5.0, so I think this is still a hot bug on 5.0 implantations.

I wonder if it is not fixable on 5.0, or just nobody took care to backport the fix...

sma, please, could you give us some feedback on what changes where done on the 6.0 to fix this?

Revision history for this message
ksh (Axelor) (ksh-axelor) wrote :

Hello,

   I found two issues in above posts:
   1. long-url.
   2. All record ids in hidden field in case of one2many pop-ups.

   I have tried to Fix these issues and attaching patch for the same.
   To test, Apply this patch on web-client5.0 revision number: 2943

   Please let us know the result if this patch fix the bugs correctly, so that it can be committed on branch.

Revision history for this message
Navrang Oza (noz-tiny) wrote :

Hello Borja López Soilán,

Can you please check is this patch is working fine for you ?
Please let us know the status from your side.

Thanks.

Revision history for this message
Julian Robbins (joolsr) wrote :
Download full text (15.7 KiB)

Hi

I've noticed thsi same error on other sections of 6.0 trunk ie

If I click on a Product and then clcik on the Right hand Side bar for 'Product Sales' I get the following related error

'Request-URI Too Large

The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.14 (Ubuntu) Server at openerp Port 80'

I have seen this error in other parts of the web client running 6.0 trunk too unfortunately, so pls can you check whether its fixed everywhere in web client ?

The url it tries to parse is (wait for it) :-

http://openerp/openerp/form/action?_terp_action=419&_terp_id=280&_terp_model=product.product&datas={%27groups_id%27%3A%20[5%2C%205%2C%205%2C%205%2C%205%2C%205%2C%205]%2C%20%27domain%27%3A%20u%27{}%27%2C%20%27help%27%3A%20False%2C%20%27res_model%27%3A%20u%27sale.order.line%27%2C%20%27search_view_id%27%3A%20False%2C%20%27id%27%3A%20419%2C%20%27src_model%27%3A%20u%27product.product%27%2C%20%27view_type%27%3A%20u%27form%27%2C%20%27menus%27%3A%20False%2C%20%27display_menu_tip%27%3A%20True%2C%20%27usage%27%3A%20u%27%27%2C%20%27type%27%3A%20u%27ir.actions.act_window%27%2C%20%27string%27%3A%20u%27Product%20sales%27%2C%20%27views%27%3A%20[%28False%2C%20u%27tree%27%29%2C%20%28False%2C%20u%27form%27%29]%2C%20%27view_id%27%3A%20False%2C%20%27auto_refresh%27%3A%200%2C%20%27view_mode%27%3A%20u%27tree%2Cform%27%2C%20%27view_ids%27%3A%20[]%2C%20%27target%27%3A%20u%27current%27%2C%20%27name%27%3A%20u%27Product%20sales%27%2C%20%27auto_search%27%3A%20True%2C%20%27search_view%27%3A%20u%27{\%27name\%27%3A%20u\%27sale.order.line.select\%27%2C%20\%27type\%27%3A%20u\%27search\%27%2C%20\%27view_id\%27%3A%20614%2C%20\%27fields\%27%3A%20{\%27property_ids\%27%3A%20{\%27related_columns\%27%3A%20[\%27order_id\%27%2C%20\%27property_id\%27]%2C%20\%27string\%27%3A%20u\%27Properties\%27%2C%20\%27third_table\%27%3A%20\%27sale_order_line_property_rel\%27%2C%20\%27domain\%27%3A%20[]%2C%20\%27states\%27%3A%20{\%27draft\%27%3A%20[%28\%27readonly\%27%2C%20False%29]}%2C%20\%27readonly\%27%3A%20True%2C%20\%27relation\%27%3A%20\%27mrp.property\%27%2C%20\%27context\%27%3A%20{}%2C%20\%27selectable\%27%3A%20True%2C%20\%27type\%27%3A%20\%27many2many\%27}%2C%20\%27product_uos_qty\%27%3A%20{\%27states\%27%3A%20{\%27draft\%27%3A%20[%28\%27readonly\%27%2C%20False%29]}%2C%20\%27selectable\%27%3A%20True%2C%20\%27readonly\%27%3A%20True%2C%20\%27type\%27%3A%20\%27float\%27%2C%20\%27string\%27%3A%20u\%27Quantity%20%28UoS%29\%27}%2C%20\%27product_uom\%27%3A%20{\%27domain\%27%3A%20[]%2C%20\%27string\%27%3A%20u\%27Unit%20of%20Measure%20\%27%2C%20\%27required\%27%3A%20True%2C%20\%27states\%27%3A%20{\%27draft\%27%3A%20[%28\%27readonly\%27%2C%20False%29]}%2C%20\%27readonly\%27%3A%20True%2C%20\%27relation\%27%3A%20\%27product.uom\%27%2C%20\%27context\%27%3A%20{}%2C%20\%27selectable\%27%3A%20True%2C%20\%27type\%27%3A%20\%27many2one\%27}%2C%20\%27sequence\%27%3A%20{\%27selectable\%27%3A%20True%2C%20\%27type\%27%3A%20\%27integer\%27%2C%20\%27string\%27%3A%20u\%27Sequence\%27%2C%20\%27help\%27%3A%20\%27Gives%20the%20sequence%20order%20when%20displaying%20a%20list%20of%20sale%20order%20lines.\%27}%2C%20\%27price_unit\%27%3A%20{\%27digits\%27%3A%20%2816%2C%202%29%2C%20\%27string...

Revision history for this message
Carlos Ch. (solracch) wrote :

the bug is reappearing...
no solution yet?
https://bugs.launchpad.net/openobject-client-web/+bug/671429

thnx

Revision history for this message
Navrang Oza (noz-tiny) wrote :

Hello Julian Robbins,

I have performed following steps as you said,

- Clicked on Product,
- Opened Right hand side bar.
- Clicked on "Product Sales" from Links.

I didnt get any error.

This bug has been fixed in trunk.
Please update your code and check it once.

Thanks.

Revision history for this message
Julian Robbins (joolsr) wrote :

It appears that with 6.0 RC2, if I

Clicked on Product,
- Opened Right hand side bar.
- Clicked on "Product Sales" from Links.

I don't get any errors now.

But I'm still not totally convinced that this whole problem of overtly long urls causing apache/browser issues has gone away.

e.g. the no of chars in the URL for this request above is 4775 ... not exactly small is it ?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.