JFTP: :write: Bad Response

  • Posts: 120
  • Thank you received: 1
12 years 5 days ago #77352

Hello,

I am running my web site for a few months already. Everything was smooth, but today suddenly a error started to apper when I proceed to checkout page:
JFTP: :write: Bad Response

Apparently, some folder permissions have been changed occasionally, but what folder is affected?

Server Access Logs:
22:43:36 193.254.220.72 "GET /shop/checkout HTTP/1.1" 200 11287 " sitename.com/shop/product/cid-769 " "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML
22:43:35 193.254.220.72 "POST /shop/product/updatecart HTTP/1.1" 303 0 " sitename.com/shop/product/cid-769 " "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML

No Error logs at server side.

I tried to switch on Debug Mode, but I receive following error, which seems to be a Joomla bug (?):
Catchable fatal error: Object of class stdClass could not be converted to string in /home/watashi/sad-ogorod.com.ua/www/plugins/system/debug/debug.php on line 303
Therefore, I have turn off debug mode again.

I also tried to turn off FTP LAYER, but then the picture of product in the checkout page has disappeared.

FTP LAYER ENABLED (See error on top)




FTP LAYER DISABLED: (no error, but product image is not shown).



Another surprise:
My development version of web-site, which was exactly 100% copied today, does not show this error, but it also does not show the product image. It is despite FTP Layer enabled or disabled...

Now, at the end of writing this message, I become to understand this is not Hikashop issue. But do you think there may be any workaround with Hikashop files permissions?

Any other idea?

Thanks.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 5 days ago #77369

Hi,

I tried to switch on Debug Mode, but I receive following error, which seems to be a Joomla bug (?):
Catchable fatal error: Object of class stdClass could not be converted to string in /home/watashi/sad-ogorod.com.ua/www/plugins/system/debug/debug.php on line 303
Therefore, I have turn off debug mode again.

This is a Joomla bug that I reported some months ago but my patch is not yet include in the official packages. Hope it would be soon.
You could find the fix here : github.com/joomla/joomla-cms/pull/504/files

I think the error is link to the image thumbnail generation.
Please check permissions in the /media/com_hikashop/upload/ folder (and sub directories).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 5 days ago #77392

Jerome,

Thanks for reply.

As for the images, what permission must be set on the folders?
I understand, the subfolder "safe" shall be 777.
How about the rest main folder "upload" and the rest bunch of subfolders such as thumbnail 100x100, thumbnail 150x76 etc?
Shall I assign all of them with 777 permissions?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 4 days ago #77406

Hi,

Try with the 755 permissions, and if it's not working, you should try with 777.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 4 days ago #77583

Hi everyone,

I have tried both 777 and 755 on folder uploads and all its files and subfolders.
I have made sure that the permissions have actually been changed by checking it again.

However, the problem still persists.

Any other suggestions?

Regards,

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 4 days ago #77586

Hi,

I am not sure that's a file permission problem.
The thumbnail is generated so, the script could write the image, right ?

The best would be to add some debug trace while the "JWrite error" is trigger. In order to have the full debug_backtrace and know wich "write" action generate this error.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 4 days ago #77595

Jerome, thanks.
I have applied your fix to debug.php and now I can see errors from debug information:

JFTP: :write: Некорректный ответ
Call stack
#	Function	Location
1	JSite->dispatch()	JROOT/index.php:42
2	JComponentHelper::renderComponent()	JROOT/includes/application.php:197
3	JComponentHelper::executeComponent()	JROOT/libraries/joomla/application/component/helper.php:351
4	require_once()	JROOT/libraries/joomla/application/component/helper.php:383
5	JController->execute()	JROOT/components/com_hikashop/hikashop.php:69
6	checkoutController->step()	JROOT/libraries/joomla/application/component/controller.php:761
7	checkoutController->display()	JROOT/components/com_hikashop/controllers/checkout.php:355
8	hikashopController->display()	JROOT/components/com_hikashop/controllers/checkout.php:1525
9	JController->display()	JROOT/administrator/components/com_hikashop/helpers/helper.php:1172
10	CheckoutViewCheckout->display()	JROOT/libraries/joomla/application/component/controller.php:722
11	hikashopView->display()	JROOT/components/com_hikashop/views/checkout/view.html.php:45
12	JView->display()	JROOT/administrator/components/com_hikashop/helpers/helper.php:1347
13	JView->loadTemplate()	JROOT/libraries/joomla/application/component/view.php:205
14	include()	JROOT/libraries/joomla/application/component/view.php:649
15	JView->loadTemplate()	JROOT/components/com_hikashop/views/checkout/tmpl/step.php:111
16	include()	JROOT/libraries/joomla/application/component/view.php:649
17	hikashopImageHelper->display()	JROOT/templates/rt_voxel/html/com_hikashop/checkout/cart.php:303
18	hikashopImageHelper->displayThumbnail()	JROOT/administrator/components/com_hikashop/helpers/image.php:74
19	hikashopImageHelper->generateThumbnail()	JROOT/administrator/components/com_hikashop/helpers/image.php:268
20	hikashopImageHelper->_resizeImage()	JROOT/administrator/components/com_hikashop/helpers/image.php:311
21	JFile::write()	JROOT/administrator/components/com_hikashop/helpers/image.php:478
22	JFTP->write()	JROOT/libraries/joomla/filesystem/file.php:413
23	JError::raiseWarning()	JROOT/libraries/joomla/client/ftp.php:1100
24	JError::raise()	JROOT/libraries/joomla/error/error.php:276

So many errors?...

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 4 days ago #77629

Hi,

It's not many errors, it's just the call stack.
So now we know that it came from the image generateThumbnail.
I checked the line and the image helper try to save the thumbnail.

Thing I don't understand is that, you have already thumbnails. So, it's like the file could not be overwrite or the destination path is not the right and you're opening another file.
Can you send me a backend and FTP access to your website in a private message ?
I would make some tests in your website, adding some traces and.. fix the problem.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 3 days ago #77685

Hi,

There is a problem with Image generation path while the FTP is not enable and I would report the bug to Nicolas.
Otherwise, your main problem is : Your ftp account does not right access to write files.
By disabling the FTP, generate the image (in the right folder, but the system look at the image in the wrong one), moving the image to the "wrong" folder, there is no more error.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 3 days ago #77801

Hi Jerome,

Thanks for taking time. I see now it seems to be working without problems.
I have to recreate the workaround at my development server, but frankly speaking from your message I can not understand how could you correct the error.
I understand you have disabled FTP, but I can't understand which folder is right one and which is wrong one? What files did you move to where?

Can you kindly clarify?

Another question.
I understand you have discovered some bug with image generation path while FTP is not anabled and you recommend to report it to Nicolas. Have you already reported to him, or do I have to report it to him?

Thanks..

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 3 days ago #77826

Hi,

The image resizing is already report in our Project Manager.

In order to overpass the resizing error, you should specify the image sizes in your module.
Or maybe you have made some overrides in the product page/listing before the 1.5.9 version which introduce badges.

If the size image is specify in the module, the Image Helper would found and generate the images in a unique directory.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 3 days ago #77861

Hi Jerome,

I did overrides of product/listing. I will try to look at it and see what happened.

Please clarify in what module I have to specify image sizes? I can't find it under Hikashop/Display/Content Modules. It is not awailabe under Extensions/Module Manager. Under Hikashiop/System/Configuration/Files, image sizes are indicated.

I still can't understand how did you cure the issue. What modifications and where did you do?

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 2 days ago #78013

Hi,

In your checkout cart view, you have this code

	<?php if(!empty($row->images)){
 		$image = reset($row->images);
		if(!$this->config->get('thumbnail')){
			echo '<img src="'.$this->image->uploadFolder_url.$image->file_path.'" alt="'.$image->file_name.'" id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" />';
		}else{
			$height = $this->config->get('thumbnail_y');  ?>
			<div class="hikashop_cart_product_image_thumb" >
			<?php echo $this->image->display($image->file_path,true,$image->file_name,'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"'); ?>
			</div>
	<?php }
	} ?>
It call the help image class in order to display a thumbnail image.
This code has changed in HikaShop 1.6/2.0 and now, we give two more parameters for the size.
	<?php if(!empty($row->images)){
		$image = reset($row->images);
		$width = $this->config->get('thumbnail_x');
		$height = $this->config->get('thumbnail_y');
		$this->image->checkSize($width,$height,$image);
		if(!$this->config->get('thumbnail')){
			echo '<img src="'.$this->image->uploadFolder_url.$image->file_path.'" alt="'.$image->file_name.'" id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" />';
		}else{ ?>
			<div class="hikashop_cart_product_image_thumb" >
			<?php echo $this->image->display($image->file_path,true,$image->file_name,'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"', '', $width, $height); ?>
			</div>
		<?php }
	} ?>
Thanks to this parameters, it improves the thumbnails generations by fixing a destination directory.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 12 years 2 days ago by Jerome.
The following user(s) said Thank You: watashi

Please Log in or Create an account to join the conversation.

  • Posts: 120
  • Thank you received: 1
12 years 2 days ago #78031

You just saved my life! Thanks!!

Regards,

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 11 months ago #83012

Jerome,

I'm getting the same error on a production site on both admin and site, and in the product detail page and checkout.

Can you give me a clue of what I need to check ( is it the image helper ) in order to get it gone? ( the error )

this is kind of urgent since the site is now on production.

Hikashop 2.0 Business + Hikamarket.


Eduardo Chongkan - Likan Development
http://likandevelopment.com
Last edit: 11 years 11 months ago by likandev.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 11 months ago #83020

Hi,

There have been several problems reported in that thread. Which one do you have ?

If it's the FTP error, you need to fix the permissions of the folder media/com_hikashop/upload so that HikaShop can write the thumbnails in it.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 1
11 years 11 months ago #83028

Hi Nicolas,

Yes it's the JFTP: :write: Bad Response Error.

We have already verified the file permissions for upload. But the error persists.

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 11 months ago #83029

gabriela wrote: Hi Nicolas,

Yes it's the JFTP: :write: Bad Response Error.

We have already verified the file permissions for upload. But the error persists.


Gabriela is working with me. We changed the folder and subfolders permissions to 777 and enabled the FTP layer, still no go.

We have 2 copies of the same website, 1 runs in the server and others run in workstations ( the file system ), but they all are getting the data from the same DB. In the local copies, we have no errors. I assume this has to do with permissions because of that but permissions but can't find the appropiate folders to check.

madecostarica.com/es/catalogo/p/cid-17


Eduardo Chongkan - Likan Development
http://likandevelopment.com
Last edit: 11 years 11 months ago by likandev.

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 11 months ago #83066

Hi, Sorry, the previous link was wrong. This is the product throwing the error:

madecostarica.com/es/catalogo/c/64-vitral

madecostarica.com/es/catalogo/p/4-pasito.../category_pathway-64


Eduardo Chongkan - Likan Development
http://likandevelopment.com
Last edit: 11 years 11 months ago by likandev.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #83115

Hi,

Yes with these links we could see the error.
The thing that I don't understand is that, you do not require to generate the thumbnail because the image has the right size.
I have made such patch but maybe my patch is not yet included in HikaShop 2.0
But, that's another point.

About your image generation, Having an FTP access to the HikaShop website would help me to make some debug.
The idea is to print the file path when JFTP::write return an error. So you would be able to see where the file should be create/modified.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.136 seconds
Powered by Kunena Forum