mzungu2003 Posted December 27, 2013 Share Posted December 27, 2013 Hi All, I am having a problem when trying to upload images to products. I get a red ribbon at the bottom of the images upload page that simply says 'undefined error' when trying to upload an image. I've not added any images for a while, so this could be due to an upgrade to 1.5.6.1 not so long ago. I have searched around the forums a bit and people have been suggesting that it is something to do with mod_sec settings on the server. I have contacted my host (Krystal Hosting) who have looked into the problem for me and have advised that they are seeing a problem with the requests for the site appearing to be malformed. I have attached a Modsecurity audit log entry for one such interception by my host if that helps anyone decipher the issue. Any help would be much appreciated, Many Thanks =) modsec.txt Link to comment Share on other sites More sharing options...
Dh42 Posted December 27, 2013 Share Posted December 27, 2013 Ask your host to disable mod_sec Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 30, 2013 Author Share Posted December 30, 2013 I have had my host look into this issue quite thoroughly for me and they have finally tried disabling mod_sec completely for me and the issue still continues to be present. The technician at my host says 'the requests being made by this webpage are badly formed, and I suspect are so broken that it is causing the receiving script to give the error it is doing, and thus failing to capture any meaningful image data.' Any further ideas? Link to comment Share on other sites More sharing options...
Dh42 Posted December 30, 2013 Share Posted December 30, 2013 Can you ask them to give you the error log for when the request is generated? Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 30, 2013 Author Share Posted December 30, 2013 My host says: 'No errors are recorded by apache, and PHP does not write an error_log file. This is an internal bug in Prestashop.' I've attached the latest modsec log before they turned modsec off for me if that helps at all? Many Thanks modsec (1).txt Link to comment Share on other sites More sharing options...
Dh42 Posted December 30, 2013 Share Posted December 30, 2013 What version of Prestashop are you using? edit: I see where you said above. Does this happen also when you try to upload a category image, or an image to a cms page? Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 30, 2013 Author Share Posted December 30, 2013 I'm using version 1.5.6.1 - updated to this version through the auto-update feature. Link to comment Share on other sites More sharing options...
El Patron Posted December 30, 2013 Share Posted December 30, 2013 one thing you can check is your php settings for file uploads. this helped another poster in that their php.ini settings were blocking file uploads... The easy way is to load this free module http://www.prestashop.com/forums/topic/278164-free-module-display-php-environment-phpinfo-back-office/ then under tab info_configuration check settings: file_uploads On upload_max_filesize (size) max_file_uploads (more than 1 generally 20) post_max_size (This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.) Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 30, 2013 Author Share Posted December 30, 2013 I have loaded the free module and check the settings you suggest and they all seem to be OK: file_uploads: On upload_max_filesize: 100M max_file_uploads: 20 post_max_size: 100M Although the post_max_size is the same as the upload_max_filesize I am not trying to upload a file anywhere near 100M - it is less than 1M. Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 31, 2013 Author Share Posted December 31, 2013 OK, I have managed to find a work around to this error, but it is obviously not ideal. I was reading through the post here looking for some solutions and noticed someone said that the problem did not occur for them under internet explorer. I tried internet explorer to no avail and was still getting the same error. Someone in the thread above noted that it worked fine for them on Windows XP using internet explorer. I am using Windows 7 with the latest update of IE. If I add my domain to the compatibility view settings in IE, I have no issue uploading images! Can anyone offer an explanation of this? Is this a bug in PrestaShop that I need to open a support ticket for? 1 Link to comment Share on other sites More sharing options...
El Patron Posted December 31, 2013 Share Posted December 31, 2013 what was the version before upgrade? please make sure you have this fix http://forge.prestashop.com/browse/PSCFV-6074 https://github.com/PrestaShop/PrestaShop/commit/3d1663279af813dafd19f128569c7c8fa4b34dea also look through this post http://www.prestashop.com/forums/topic/295761-undefined-error-when-try-to-upload-a-product-image/ good luck! Link to comment Share on other sites More sharing options...
mzungu2003 Posted December 31, 2013 Author Share Posted December 31, 2013 Thank you for the extra links to other threads for the same issue El Patron. It seems this is a much more common issue than it should be, but with many obscure reasons and workarounds linked to it... When reading through this thread I came across another work around that suits me better - if i log in to my BO using the URL without the www prefix I can upload images in all browsers without an issue, despite PrestaShop giving the error: "You are currently connected under the following domain name inkfinity.co.uk. This is different from the domain name set in the "SEO & URLs" tab. If this is your main domain, please change it now." I can live with this error if it gives me a workaround to the show-stopping "undefined" error when uploading images... Can anyone explain why the above workaround works though? 1 Link to comment Share on other sites More sharing options...
nayll Posted January 5, 2014 Share Posted January 5, 2014 No www?. tried this on firefox and IE and error still persists. bummer, this renders the whole thing unusable for an ecommerce site if one can't upload product images?? any new workarounds?? jh Link to comment Share on other sites More sharing options...
nayll Posted January 5, 2014 Share Posted January 5, 2014 I am using Windows 7 with the latest update of IE. If I add my domain to the compatibility view settings in IE, I have no issue uploading images! well I did this but didn't have to do it before, but IE will now let me upload successfully ----- FOR NOW! no such option in firefox jh Link to comment Share on other sites More sharing options...
mzungu2003 Posted January 5, 2014 Author Share Posted January 5, 2014 Unfortunately I have not come across any new workarounds but the two above continue to work for me, so they are the best I have at present. I still think there is something broken behind the scenes that PrestaShop developers should be aware but I don't know whether to log it on the repository or not. My host continues to inform me it is something to do with malformed url's. Link to comment Share on other sites More sharing options...
Dh42 Posted January 6, 2014 Share Posted January 6, 2014 If you could report it at the bug tracker at http://forge.prestashop.com/secure/Dashboard.jspa that would be awesome. Then the developers can take a look at it. Be as detailed as possible about the server and the Prestashop version. Link to comment Share on other sites More sharing options...
aun4some1 Posted January 16, 2014 Share Posted January 16, 2014 one thing you can check is your php settings for file uploads. this helped another poster in that their php.ini settings were blocking file uploads... The easy way is to load this free module http://www.prestashop.com/forums/topic/278164-free-module-display-php-environment-phpinfo-back-office/ then under tab info_configuration check settings: file_uploads On upload_max_filesize (size) max_file_uploads (more than 1 generally 20) post_max_size (This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.) Hello Sir, I tried to check about php configuration and installed the module you suggested above, but i am having error in "INFO_CONFIGURATION". I have attached a screenshot too. Trying to resolve image upload "undefined" error, but no luck yet. Any kind of help will be really appreciated. Thank you very much. Link to comment Share on other sites More sharing options...
aun4some1 Posted January 16, 2014 Share Posted January 16, 2014 what was the version before upgrade? please make sure you have this fix http://forge.prestashop.com/browse/PSCFV-6074 https://github.com/PrestaShop/PrestaShop/commit/3d1663279af813dafd19f128569c7c8fa4b34dea also look through this post http://www.prestashop.com/forums/topic/295761-undefined-error-when-try-to-upload-a-product-image/ good luck! Tried all the methods told in above links ... but no success Link to comment Share on other sites More sharing options...
nikolaosp Posted February 22, 2014 Share Posted February 22, 2014 I have the same problem. I have updated to version 1.5.6.2 and i cannot upload images as it tells me that there was an error copying your picture. I have tried chrome and firefox and also cleared caches, deleted histories etc. I have another instance of prestashop running, which is a backup of my previous installation. In version 1.5.4.1 there are no issues, from either browser. Any solutions to this problem? Link to comment Share on other sites More sharing options...
aun4some1 Posted February 22, 2014 Share Posted February 22, 2014 (edited) I have the same problem. I have updated to version 1.5.6.2 and i cannot upload images as it tells me that there was an error copying your picture. I have tried chrome and firefox and also cleared caches, deleted histories etc. I have another instance of prestashop running, which is a backup of my previous installation. In version 1.5.4.1 there are no issues, from either browser. Any solutions to this problem? Hi, I was resolved with this issue. This issue was in extension of Web Hosting Manager (WHM) If you have access to WHM, follow this tutorial http://forums.cpanel.net/f5/enable-install-mbstring-module-158165.html to turn on the mbstring module. If you don't have access to WHM, ask your hosting provider to turn on the "mbstring extension" for you. Edited February 22, 2014 by aun4some1 (see edit history) Link to comment Share on other sites More sharing options...
nikolaosp Posted February 22, 2014 Share Posted February 22, 2014 (edited) Hi, I was resolved with this issue. This issue was in extension of Web Hosting Manager (WHM) If you have access to WHM, follow this tutorial http://forums.cpanel.net/f5/enable-install-mbstring-module-158165.html to turn on the mbstring module. If you don't have access to WHM, ask your hosting provider to turn on the "mbstring extension" for you. I am running prestashop on my own server, and mbstring is already enabled. my phpinfo file has the screenshot Am i doing something wrong? Edited February 22, 2014 by nikolaosp (see edit history) Link to comment Share on other sites More sharing options...
nikolaosp Posted February 23, 2014 Share Posted February 23, 2014 I am running prestashop on my own server, and mbstring is already enabled. my phpinfo file has the screenshot Am i doing something wrong? so, it appears that the simplest explanation is always the last one you check... Although my site's folder was owned by www-data user and group, some subfolders of img folder where owned by another user. Don't know how this could happen, but there you go... It works now as it should . Link to comment Share on other sites More sharing options...
El Patron Posted February 23, 2014 Share Posted February 23, 2014 so, it appears that the simplest explanation is always the last one you check... Although my site's folder was owned by www-data user and group, some subfolders of img folder where owned by another user. Don't know how this could happen, but there you go... It works now as it should . we were also wanting to know if there was any change to out file system, including permissions, so I wrote this: http://www.prestashop.com/forums/topic/303132-module-prestavault-malware-trojan-virus-protection/ Link to comment Share on other sites More sharing options...
Recommended Posts