Jump to content

1.7.5 [PrestaShopDatabaseException] Unknown column 'location' in 'field list'

Recommended Posts

hello everyone, I have a problem since I have updated to version 1.7.5.
The following message appears when I try to open my Webshop:
What can I do to fix the problem? Many thanks in advance.


Unknown column 'location' in 'field list'

SELECT location
FROM `othe_stock_available`
WHERE (id_product = 34) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1

at line 769 in file classes/db/Db.php


764.         if ($webservice_call && $errno) {
765.             $dbg = debug_backtrace();
766.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768.             if ($sql) {
769.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770.             }
772.             throw new PrestaShopDatabaseException($this->getMsgError());
773.         }
774.     }

Share this post

Link to post
Share on other sites

it seems there is leakage from old ps version (stock management) 

table ps_stock_available does not have 'location' in the table but did so in 1.6.

so some left over code is looking up stock using parms from old stock manger.

That is my guess!


Share this post

Link to post
Share on other sites

No, it's the other way round.

Location has been added with v1.7.5.

It seems the Update has not run the MySQL update queries, so you should do that yourself.

You can find them inside the Prestashop-ZIP-Archive (download the full installation from the website) inside install/upgrade/sql

Run all the queries (in the correct order) from the version you upgraded from.

I had the same issue, and I think I know why.
The SQL-Script has a bug!

ALTER TABLE `PREFIX_supply_order_receipt_history`
  CHANGE `employee_firstname` `employee_firstname` VARCHAR(255) DEFAULT '',
  CHANGE `employee_lastname` `employee_firstname` VARCHAR(255) DEFAULT '';

That, of course, throws an error.

It should be:

ALTER TABLE `PREFIX_supply_order_receipt_history`
  CHANGE `employee_firstname` `employee_firstname` VARCHAR(255) DEFAULT '',
  CHANGE `employee_lastname` `employee_lastname` VARCHAR(255) DEFAULT '';

Also be sure to change all PREFIX in the file to your actual prefix in the database.

This fixed my shop and it's now working well again (very same error message).

There seem to be a couple more bugs. More info on that here:

Edited by EvilDragon (see edit history)
  • Like 1

Share this post

Link to post
Share on other sites
On 26/12/2018 at 20:24, EvilDragon said:

No, es al revés.

Se ha agregado la ubicación con v1.7.5.

Parece que la Actualización no ha ejecutado las consultas de actualización de MySQL, por lo que debería hacerlo usted mismo.

Puede encontrarlos en Prestashop-ZIP-Archive (descargue la instalación completa del sitio web) en instalar / actualizar / sql

Ejecute todas las consultas (en el orden correcto) desde la versión desde la que se actualizó.

tuve el mismo problema, y creo que sé por qué.
El SQL-Script tiene un error!


Eso, por supuesto, arroja un error.

Debería ser:

También asegúrese de cambiar todos los PREFIX del archivo a su prefijo real en la base de datos.

Esto solucionó mi tienda y ahora está funcionando bien nuevamente (muy el mismo mensaje de error).

Parece que hay un par de errores más. Más información sobre eso aquí:

hello I have the same problem after updating my store from 1.7.4 to 1.7.5 and try several ways to fix and nothing


as meeting is part to change


Share this post

Link to post
Share on other sites

Hi, I've just delete VAR and OVERRIDE folders and replace them with new ones from the original PS install. It helped.

  • Like 1

Share this post

Link to post
Share on other sites


as pointed in documentation, You should run script in upgrade.php file


Database upgrade

Once the files have been copied, your shop database is ready to be upgraded.

All the changes to apply have been defined in the `install` folder, running them can be done with a specific PHP script.

When you’re ready, run the file `install/upgrade/upgrade.php`.

This can be done with a browser, by reaching the address http://<shop_domain>/install/upgrade/upgrade.php, or from your server’s command line:

php install/upgrade/upgrade.php

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More