Jump to content

Can't use AdminProducts - product tabs will not load


theillo

Recommended Posts

I had this problem before and I updated to ver 1.6.10, and it fixed it for a while. But now it's back:

 

I'm trying to create or edit a product. Loading the actual page takes about 4 seconds. Then it loads each product tab via Ajax. And always one of them will randomly not load, giving a 404 response to the ajax request (which then logs this to the console). If I check my server logs, they'll always say "premature end of script headers".

 

This now leads to the "save" and "save and stay" buttons to stay in they loading state, and I'll never be able to click them.

 

For a while I tried Firefox instead of chrome, and I had no problems with FF. Since the update it only worked on chrome, FF gave problems right away.

 

I am able to click on each tab and it'll load the tab once clicked. But for the initial setup it's trying to load all the tabs, fails on one, and this causes it to be unusable.

 

I am unable to create or edit products right now.

 

And the problem is also very random: Sometimes it'll be "features" that can't be loaded, sometimes "attachments"... 

 

In addition to that I get random 404 error pages when trying to navigate my back office. I'll refresh and it works again.

 

Super annoying! What could be causing this and how can I fix it?

Link to comment
Share on other sites

product page has several sections like informations ,associations, prices, images etc.

 

each of this section is loaded "in background". While browser trying to load one (or more) from these sections - it generates an error, so in effect you see popup with notification about some troubles, "save" buttons are spinning all the time etc.

 

To find what section generates such problems it will be necessary to:

  1. go to shop back office
  2. go to section catalog > products
  3. turn on browser console (in chrome ctrl+shift+j)
  4. clear it
  5. open product edit page
  6. watch the console output
  7. one of the entry will be red (error)
  8. copy it and paste here

are there some more errors, not only 404 ?

Link to comment
Share on other sites

Thank you so much for your response, as of right now I can't create new products, which is really bad as I am just starting to build my inventory.

 

You have assesed the problem correctly. With one exception: I think I know the popup you are talking about, and I've seen it before, but it doesn't show. 

 

I am happy to copy and paste the contents of my console here, however it is always a different tab that's not loading.

 

LjPICnw.png

jquery-1.11.0.min.js:4 GET http://www.[mydomain].com/admin[secret]/index.php?controller=AdminProducts&token=540017c50ffb96f4c464908af9334c09&id_product=50&action=[THIS WILL ALWAYS BE DIFFERENT]&updateproduct&ajax=1&rand=1483337521564&_=14833375207
send @ jquery-1.11.0.min.js:4
ajax @ jquery-1.11.0.min.js:4
ProductTabsManager.display @ products.js:117
ProductTabsManager.displayBulk @ products.js:166
(anonymous) @ products.js:208
products.js:177 Uncaught TypeError: Cannot read property 'replace' of undefined
    at Object.<anonymous> (products.js:177)
    at j (jquery-1.11.0.min.js:2)
    at Object.fireWith (jquery-1.11.0.min.js:2)
    at x (jquery-1.11.0.min.js:4)
    at XMLHttpRequest.b (jquery-1.11.0.min.js:4)
(anonymous) @ products.js:177
j @ jquery-1.11.0.min.js:2
fireWith @ jquery-1.11.0.min.js:2
x @ jquery-1.11.0.min.js:4
b @ jquery-1.11.0.min.js:4

I'm trying to reload 10 times, here's all the values for the action parameter I've gotten in the URL:

 

  1. Attachments
  2. Attachments
  3. Pack AND Images (two 404 GET responses in one request)
  4. Associations
  5. Just now it worked!
  6. ModuleAppointment_scheduler*
  7. Shipping
  8. Virtual Product
  9. Prices
  10. Features (I have features disabled by the way)

*I have 3 custom modules loading via hookDisplayAdminProductsExtra, they also utilize the hookActionProductUpdate

 

Now of course I'm wondering if they could cause any problems. But why would they cause such intermittent problems? I am doing an experiment now, 10x reloading with my 3 custom modules DISABLED:

 

  1. It worked
  2. Attachments
  3. Images
  4. Suppliers
  5. Images
  6. Quantities (I have the Quantity feature disabled)
  7. Shipping
  8. It worked
  9. It worked
  10. Suppliers

 

Well, while the success rate seems to be slightly better without my custom modules, that doesn't help much as my whole business revolves around these custom modules.

 

Now, my error logs on the apache server show this:

[Sun Jan 01 22:23:18 2017] [error] [client myIP] Premature end of script headers: index.php, referer: http://www.mydomain.com/adminsecret/index.php?controller=AdminProducts&addproduct&token=540017c50ffb96f4c464908af9334c09 

If I edit rather than add a product, the referer will have additional parameters: &id_product=50&updateproduct

 

So I have 17 of these errors now...

Link to comment
Share on other sites

Well, for now I did Line 1883:

var tabs_manager = new ProductTabsManager();

tabs_manager.setTabs(product_tabs);

$(document).ready(function() {

and I added this:

var tabs_manager = new ProductTabsManager();

delete product_tabs.Features;
delete product_tabs.Suppliers;
delete product_tabs.Quantities;
delete product_tabs.Warehouses;

tabs_manager.setTabs(product_tabs);

$(document).ready(function() {...

Seems to work for now... 

 

But I also cranked my memory limit up to 128M.

 

Please if you have any additional advice for me, let me know!!!!!

 

EDIT: actually it's still quite unreliable.

Edited by theillo (see edit history)
Link to comment
Share on other sites

Maybe this did the trick for now. Looks like there has been an issue in the past where prestashop was looking like a DOS attack. So they made a little workaround to always wait 1 second between each ajax request. So I'm making this my default now...

 

Line 202:

/*In order to prevent mod_evasive DOSPageInterval (Default 1s)*/
var time = 1000; //this was set to 0, I changed it//
if (mod_evasive) {
	time = 1000;
}
Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...