Technical error unexpected response returned by server import stopped

Reasons may vary, but you can find the info you need to fix the error inspecting the current AJAX request with your browser's developer tools.

I’m , the creator of digital products like PromptHero, Hustl, or Edit that are used by people in companies like Google, Uber,
Adobe and thousands of people around the globe; and that have been covered in media like Fast Company, The Wall Street Journal, Vox or
the Next Web.

Home » Blog » Prestashop import error: «Technical error: Unexpected response returned by server. Import stopped.»

TL;DR: Reasons may vary, but you can find the info you need to fix the error inspecting the current AJAX request with your browser’s developer tools. For me it was that because of the ordering of my Excel sheet I was trying to create a category before its parent had been created.

When it comes to Prestashop I have mixed feelings. It is an awesome platform for non-technical people to set up and manage a fully-featured, customizable online shop; but on the other side I’ve always felt it is so developer unfriendly.

Hard to find documentation, weird dev community, intricate architecture, incomprehensible errors and a vast number of variables and constants to set up… I feel like there is no reason for Prestashop to have such a steep learning curve. I might talk more in-depth about this on other post, but for now let’s get our hands dirty with an error that I’ve recently encountered working in a client’s project that has brought me ungodly amounts of frustration.

The Prestashop import error comes up when trying to import categories from a CSV or Excel sheet in Prestashop 1.7. It states nothing but:

Screen_Shot_2017-07-10_at_13_53_16.png

“Errors occurred: Technical error: Unexpected response returned by server. Import stopped.”

Which gives us close to no information at all about the error, even with debug mode enabled.

Turns out it’s just a poor error handling of AJAX requests and that the actual request holds the information we just might need to succeed.

Open up the developer tools (in Chrome: right click / Inspect) and head over the “Network” tab right before importing. There you should see all the AJAX requests that are being made “behind the scenes” by Prestashop. Click on start import and wait for the error to pop out.

When that happens, check out the last request in the list and look into the request “Preview” or “Response” tab:

Screen_Shot_2017-07-10_at_13_53_16.png

There you go! That’s the reason it wasn’t working.

If we check out the Excel list to import we see that in fact there was trying to assign a category to a parent that wasn’t created yet (it was far below it in the Excel sheet).

If we search for that error message in our Prestashop codebase:

Pasted_Image_10_07_2017__14_19.png

Prestashop’s classes/Category.php, around line 445

We see that, in fact, there is a function trying to calculate the current category to import depth and it throws an exception if it hasn’t been created yet.

Errors and fixing procedures may vary. It can be that your category name is too long, or that it contains weird characters that Prestashop may not like… just open up the developer tools, inspect the request and get the right info.

For me, the fix was obvious: I just ordered my Excel Sheet so that I create first 0-depth-level categories, then depth level 1 categories, and so on.

I tried commenting those 3 exception-related lines in Category.php and worked fine as well. That validation may not be necessary after all.


Picture: Clark Street Mercantile


Thanks for reading!

I’m most active on Twitter
– follow me to stay in the loop.

You can also join my newsletter, and get cool stuff delivered directly to your inbox.

You’ll be the first one to know about my private betas, early releases, and behind-the-scenes stories of an indie
entrepreneur! No spam ever, unsubscribe with one single click.

As a quick reminder – I’m rameerez, an indie software developer that’s making cool stuff like Hustl or Edit used by people all around the world in
165+ countries, among cool people at companies like Google, Uber or Adobe. My work has been featured in media like
Fast Company, The Wall Street Journal, Vox, or The Next Web.

Тема: Ошибка импорта Technical error: Unexpected response returned by server  (Прочитано 763 раз)

Здравствуйте! Кто сталкивался с такой ошибкой при импорте? Импорт в админке престы только начинается, как появляется такое: «Technical error: Unexpected response returned by server. Import stopped»
Нашла на английском одно решение — там чувак просто убрал десятичные знаки из отображения цены, и у него всё заработало; но это не мой случай, у меня стоит округление и 0 десятичных знаков.
Что делать?


Записан

27 Январь 2018, 00:01:45

Ответ #1

Файл импорта проверь. Такое сообщение при ошибках в файле.


Записан

27 Январь 2018, 11:17:41

Ответ #2

Эх. А что искать? Особенно если учесть, что этот файл уже импортировался нормально. Но потом я решила очистить магазин от товаров и повторить процедуру импорта, и началось такое…


Записан

27 Январь 2018, 14:18:43

Ответ #3

После удаления товаров у вас изменились ид в таблице товаров. Импортируйте товары без ид.


Записан

27 Январь 2018, 16:09:52

Ответ #4

Попробовала импортировать товары без id. Та же самая ошибка импорта.


Записан

27 Январь 2018, 16:17:48

Ответ #5


Записан

Интернет-магазин под ключ.
Какой выбрать движок для интернет магазина ?
Какой движок лучше ?
Magento или Prestashop ?
Решение всех Ваших вопросов в создании Интернет-магазина.

28 Январь 2018, 14:32:02

Ответ #6

И при импорте одного товара та же ошибка.


Записан

28 Январь 2018, 14:55:32

Ответ #7

Значит ошибка в представлении данных, данные в файле импорта не соотвествуют разрешенным переменным. Проверять нужно файл импорта.


Записан

28 Январь 2018, 17:26:34

Ответ #8

Хм. Я этот файл уже несколько раз успешно импортировала до этого. Ничего в нём с тех пор не меняла. Не уверена, что дело в нём — он сам, что ли, как-то видоизменился?


Записан

29 Январь 2018, 11:45:45

Ответ #9

Нет файл сам не может измениться, ишменились данные в бд после удаления товаров.


Записан

29 Январь 2018, 13:18:53

Ответ #10

Судя по тому, что мне всё же удалось импортировать файл, ничего в нём не меняя, дело было в чём-то другом. Я сначала импортировала несколько строчек из другого файла через Store Manager, а затем мой файл нормально импортировался через админку престы  :)


Записан

29 Январь 2018, 15:37:52

Ответ #11

Так сразу и нужно писать, что ошибки через Store Manager. Соединения с базлй нет, логин или пароль неправильно указанны, на хостинге запрет на удаленное подключение или в самом prestashop отключен вебсервис.


Записан

29 Январь 2018, 15:50:00

Ответ #12

Ошибка импорта была при импорте через админку престы, я так и написала. А починилось всё, когда я импортировала несколько товаров через менеджер — после этого заработал импорт через админку.


Записан

Recommended Posts

lixotuka

Newbie

    • Share

Hi,

I’m trying to import a CSV with categories that imports without errors in Prestashop 1.6.0.13, but I get the following Error message in TB 1.0.3:

Errors occurred:
Technical error: Unexpected response returned by server. Import stopped.

0_1503098638346_Captura de pantalla 2017-08-19 a las 1.07.27.png

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

How can I know if it’s 100% compatible?

The import works fine in PS 1.6.0.13

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

Hi mdekker,

I have checked and it’s fully compatible. Also Prestashop 1.6 & 1.7 work perfectly and import without errors.

Any idea?

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

It is a normal CSV with categories. I’ve been using it for a long time on Prestashop.

Can I send it to your email for you to review?

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share
Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

Thank you mdekker!
I didn’t need to import twice. I imported with FORCE ID and it worked well (no problems with images and parent categories). So FORCE ID was the problem.

The whole CSV is imported but I get this error:
Some errors were detected. Please check the details:
The confirmation email couldn’t be sent, but the import is successful. Yay!

0_1503249036655_Captura de pantalla 2017-08-20 a las 18.50.46.png

Thank you again!!

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

@mdekker said in Error importing CSV categories file:

your server is unable to connect to the outside world and the CSV contains external images that need to be downloaded

I think that the images are on my server

Link to comment
Share on other sites

Occam

Newbie

    • Share

Anyway, you should see to the import controller, @mdekker. A developer named gabdara posted a commit on Github last Friday. This fixes a bug in all PrestaShop 1.6 and 1.7 and thirty bees releases, which came along with a totally rewritten AdminImportController.php since 1.6.
It occurs when trying a product csv import without option force ids, but with an id column in the csv file.
Check the function categoryImportOne. You will find here the same bug for categories. Without fix!

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

Anyone know how to solve this confirmation email error?

Some errors were detected. Please check the details:
The confirmation email couldn’t be sent, but the import is successful. Yay!

Link to comment
Share on other sites

Traumflug

Newbie

    • Share

@Occam

A developer named gabdara posted a commit on Github last Friday.

Thanks. I just applied this patch to 30bz and pushed it to a new branch import. Totally untested, it might even contain syntax errors.

For your convenience and if you don’t run off a Git clone, here’s the patched file (replace the one in controllers/admin/):

01503312519447AdminImportController.php

Let us know how it works :-)

Link to comment
Share on other sites

alwayspaws

Newbie

    • Share

@lixotuka said in Error importing CSV categories file:

Anyone know how to solve this confirmation email error?

Some errors were detected. Please check the details:
The confirmation email couldn’t be sent, but the import is successful. Yay!

I just unselect the confirmation email because the resulting display on the screen shows if the import was successful. If you see «errors were detected» just scroll down the screen inside the results. Usually, it reports a missing image.

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

The import is done correctly. I know that I can unselect «Send notification email». However, I would like to know how to solve that to get the email.

Link to comment
Share on other sites

alwayspaws

Newbie

    • Share

We all want to know this, but it’s a minor issue compared to other features we’re updating and adding, etc. BTW, if that’s your only issue, come and help me add 10,000 more items to my site!

Link to comment
Share on other sites

lixotuka

Newbie

  • Author
    • Share

@alwayspaws said in Error importing CSV categories file:

We all want to know this, but it’s a minor issue compared to other features we’re updating and adding, etc. BTW, if that’s your only issue, come and help me add 10,000 more items to my site!

Solving an issue, however small, helps to improve TB.

Link to comment
Share on other sites

Create an account or sign in to comment

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

Sign in

Already have an account? Sign in here.

Sign In Now

Понравилась статья? Поделить с друзьями:
  • Technical error server was unreachable for too long and your connection was lost
  • Teamspeak как изменить порт
  • Team fortress 2 ошибка engine error
  • Team fortress 2 как изменить ник
  • Tdu2 qa v069 has stopped working как исправить