Page 2 of 2

Re: v3.0.2.0 ocmod install error

Posted: Sun Feb 18, 2018 8:37 am
by infocondens
again !
Can't install any Ocmod extension. :(

PHP Warning: move_uploaded_file(): Unable to move '/home/sites/calorifere-radiatoare.ro/tmp/phpXCJD7V' to '/home/sites/calorifere-radiatoare.ro/storage/marketplace/JgZbiX8GbS.tmp' in /home/sites/calorifere-radiatoare.ro/public_html/admin/controller/marketplace/installer.php on line 143

Also, long-term error: PHP Warning: unlink(/home/sites/calorifere-radiatoare.ro/storage/cache/cache.catalog.language.1518825806): No such file or directory in /home/sites/calorifere-radiatoare.ro/public_html/system/library/cache/file.php on line 44

Re: v3.0.2.0 ocmod install error

Posted: Sun Feb 18, 2018 11:00 pm
by straightlight
Replace your admin/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php and also your catalog/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php. Clear your OC cache from your admin - > dashboard - > blue icon (both cache) and from your admin - > extensions - > modifications - > refresh button and see if that resolves the issue regarding the persistent catalog.language error message you have.

As for your tmp folder, ensure to have write access from your root FTP domain where the tmp folder is located by setting the CHMOD setting to 0755 recursively. If the issue persists afterwards, contact your host regarding this folder.

Re: v3.0.2.0 ocmod install error

Posted: Sun Feb 18, 2018 11:48 pm
by infocondens
straightlight wrote:
Sun Feb 18, 2018 11:00 pm
Replace your admin/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php and also your catalog/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php
ok, I replaced the language files.. I hope I will not get that unlink error anymore.
As for your tmp folder, ensure to have write access from your root FTP domain where the tmp folder is located by setting the CHMOD setting to 0755 recursively. If the issue persists afterwards, contact your host regarding this folder.
is all set to 0755.. but still get that error when Installing an extension..

Maybe my installer.php has an error, after many modifications ?

Code: Select all

  <?php
class ControllerMarketplaceInstaller extends Controller {
	public function index() {
		$this->load->language('marketplace/installer');
		$this->document->setTitle($this->language->get('heading_title'));
		
		$data['breadcrumbs'] = array();
		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
		);
		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('marketplace/installer', 'user_token=' . $this->session->data['user_token'])
		);
		$data['user_token'] = $this->session->data['user_token'];
		
		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');
		
		$this->response->setOutput($this->load->view('marketplace/installer', $data));
	}
	public function history() {
		$this->load->language('marketplace/installer');
		
		if (isset($this->request->get['page'])) {
			$page = $this->request->get['page'];
		} else {
			$page = 1;
		}
					
		$data['histories'] = array();
		
		$this->load->model('setting/extension');
		
		$results = $this->model_setting_extension->getExtensionInstalls(($page - 1) * 10, 10);
		
		foreach ($results as $result) {
			$data['histories'][] = array(
				'extension_install_id' => $result['extension_install_id'],
				'filename'             => $result['filename'],
				'date_added'           => date($this->language->get('date_format_short'), strtotime($result['date_added']))
			);
		}
		
		$history_total = $this->model_setting_extension->getTotalExtensionInstalls();
		$pagination = new Pagination();
		$pagination->total = $history_total;
		$pagination->page = $page;
		$pagination->limit = 10;
		$pagination->url = $this->url->link('marketplace/installer/history', 'user_token=' . $this->session->data['user_token'] . '&page={page}');
		$data['pagination'] = $pagination->render();
		$data['results'] = sprintf($this->language->get('text_pagination'), ($history_total) ? (($page - 1) * 10) + 1 : 0, ((($page - 1) * 10) > ($history_total - 10)) ? $history_total : ((($page - 1) * 10) + 10), $history_total, ceil($history_total / 10));
				
		$this->response->setOutput($this->load->view('marketplace/installer_history', $data));
	}	
		
	public function upload() {
		$this->load->language('marketplace/installer');
		$json = array();
		// Check user has permission
		if (!$this->user->hasPermission('modify', 'marketplace/installer')) {
			$json['error'] = $this->language->get('error_permission');
		}
		// Check if there is a install zip already there
		$files = glob(DIR_STORAGE . 'marketplace/*.tmp');
		if (is_resource($files)) {
foreach ($files as $file) {
			if (is_file($file) && (filectime($file) < (time() - 5))) {
				unlink($file);
			}
			
			if (is_file($file)) {
				$json['error'] = $this->language->get('error_install');
				
				break;
			}
		}
	}
		// Check for any install directories
		$directories = glob(DIR_STORAGE . 'marketplace/tmp-*');
		
if (is_resource($directories)) {
foreach ($directories as $directory) {
			if (is_dir($directory) && (filectime($directory) < (time() - 5))) {
				// Get a list of files ready to upload
				$files = array();
	
				$path = array($directory);
	
				while (count($path) != 0) {
					$next = array_shift($path);
	
					// We have to use scandir function because glob will not pick up dot files.
					foreach (array_diff(scandir($next), array('.', '..')) as $file) {
						$file = $next . '/' . $file;
	
						if (is_dir($file)) {
							$path[] = $file;
						}
	
						$files[] = $file;
					}
				}
	
				rsort($files);
	
				foreach ($files as $file) {
					if (is_file($file)) {
						unlink($file);
					} elseif (is_dir($file)) {
						rmdir($file);
					}
				}
	
				rmdir($directory);
			}
			
			if (is_dir($directory)) {
				$json['error'] = $this->language->get('error_install');
				
				break;
			}		
		}
	}
		
		if (isset($this->request->files['file']['name'])) {
			if (substr($this->request->files['file']['name'], -10) != '.ocmod.zip') {
				$json['error'] = $this->language->get('error_filetype');
			}
			if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
				$json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
			}
		} else {
			$json['error'] = $this->language->get('error_upload');
		}
		if (!$json) {
			$this->session->data['install'] = token(10);
			
			$file = DIR_STORAGE . 'marketplace/' . $this->session->data['install'] . '.tmp';
			
			move_uploaded_file($this->request->files['file']['tmp_name'], $file);
			if (is_file($file)) {
				$this->load->model('setting/extension');
				
				$extension_install_id = $this->model_setting_extension->addExtensionInstall($this->request->files['file']['name']);
				
				$json['text'] = $this->language->get('text_install');
				$json['next'] = str_replace('&amp;', '&', $this->url->link('marketplace/install/install', 'user_token=' . $this->session->data['user_token'] . '&extension_install_id=' . $extension_install_id));
			} else {
				$json['error'] = $this->language->get('error_file');
			}
		}
		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}
}
Line 143 is in this section:

Code: Select all

move_uploaded_file($this->request->files['file']['tmp_name'], $file);
			if (is_file($file)) {
				$this->load->model('setting/extension');
Aparently there is my error ?

Re: v3.0.2.0 ocmod install error

Posted: Sun Feb 18, 2018 11:50 pm
by straightlight
is all set to 0755.. but still get that error when Installing an extension..
Your server may require FTP to upload. On the marketplace, download the FTP extension for v3.x releases and specify the public_html/ in the admin's installed extension form page at the server path text box. See if that rectifies the issue. Although, if the issue still persists afterwards, contact your host.

There is nothing wrong with the installer itself when the server configuration is properly set for their users.

Re: v3.0.2.0 ocmod install error

Posted: Sun Feb 18, 2018 11:58 pm
by infocondens
straightlight wrote:
Sun Feb 18, 2018 11:50 pm
Your server may require FTP to upload.
maybe.. but I already have 3 or 4 OCMod Extensions installed -with the builtin Installler.
But at some point something went wrong.
On the marketplace, download the FTP extension for v3.x releases and specify the public_html/ in the admin's installed extension form page at the server path text box.
I don't know which ftp extension.. didn't find it at quick search.

Re: v3.0.2.0 ocmod install error

Posted: Mon Feb 19, 2018 12:06 am
by straightlight
If the relative extension can no longer be found, regarding your tmp folder and that the error message persists after trying to set recursive settings on your tmp folder, contact your host.

Re: v3.0.2.0 ocmod install error

Posted: Mon Feb 19, 2018 4:42 am
by infocondens
straightlight wrote:
Mon Feb 19, 2018 12:06 am
If the relative extension can no longer be found, regarding your tmp folder and that the error message persists after trying to set recursive settings on your tmp folder, contact your host.
"Install file could not be found!". The installation process runs 50% and than this error. No pop-message.

In the Error log:PHP Warning: move_uploaded_file(): Unable to move '/home/sites/calorifere-radiatoare.ro/tmp/phpXCJD7V' to '/home/sites/calorifere-radiatoare.ro/storage/marketplace/JgZbiX8GbS.tmp' in /home/sites/calorifere-radiatoare.ro/public_html/admin/controller/marketplace/installer.php on line 143

Now I switched the Admin language to English and get these errors:
"PHP Notice: Undefined index: ro-ro in /home/sites/calorifere-radiatoare.ro/public_html/vqmod/vqcache/vq2-catalog_controller_startup_startup.php on line 109"

LE: the Frontpage won't load anymore ! Because of the vqmod error.
Maybe it's because of the language files that I modified ?

Re: v3.0.2.0 ocmod install error

Posted: Mon Feb 19, 2018 4:53 am
by infocondens
straightlight wrote:
Sun Feb 18, 2018 11:00 pm
Replace your admin/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php and also your catalog/model/localisation/language.php file with this file from Github: https://github.com/opencart/opencart/bl ... nguage.php.
I replaced back the old language file from catalog/ and now the site is back online.
I left the modified language file only in Admin. Hope I did no mess.

I'm in the same situation: can't install any OCMod extension.
It's SUnday, I wrote to the hosting company... tomorrow they we'll reply it's certain not from the hosting or the server ! ::)

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 2:56 am
by infocondens
infocondens wrote:
Mon Feb 19, 2018 4:53 am
I wrote to the hosting company...
ok, they made some changes regarding the tmp folder.. but no success for me ! Still not able to Install any OCMOD extension.

The installation process breaks at 50%.
After that, if I refresh the Install page, the extension is in the list (the last one in row). I have to delete it manually from that list.
But it's not really installed.

I cleared every possible cache. :)

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 4:37 am
by straightlight
What is the ZIP filename you are uploading?

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 5:00 am
by infocondens
autocomplete-city-county-zip-romania-default.ocmod.zip

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 5:41 am
by straightlight
Ensure your storage folder is located outside of your public_html folder. See these instructions: viewtopic.php?f=202&t=201745#p713479

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 6:00 am
by infocondens
straightlight wrote:
Tue Feb 20, 2018 5:41 am
Ensure your storage folder is located outside of your public_html folder.
yes, it is
See these instructions: viewtopic.php?f=202&t=201745#p713479
config files were ok, I modified htacces -but still no positive results.
Install file could not be found! .. and breaks at 50% of the installation process.
And still no error in the Log.

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 6:07 am
by straightlight
See if this extension will help you resolve the issue: https://www.opencart.com/index.php?rout ... n_id=18892 . While the posted solution is for v2.x releases, you can also use the Template Switcher extension for compatibility.

Re: v3.0.2.0 ocmod install error

Posted: Tue Feb 20, 2018 7:50 am
by infocondens
straightlight wrote:
Tue Feb 20, 2018 6:07 am
See if this extension will help you resolve the issue: https://www.opencart.com/index.php?rout ... n_id=18892 . While the posted solution is for v2.x releases
I couldn't install the QuickFix, because I can not install any xml file with the Installer, even if it's a ocmod.xml file.
Error message: Invalid file type!
Can I upload the localcopy.ocmod.xml file thru ftp somewhere ? Where ?
you can also use the Template Switcher extension for compatibility.
I managed to install the Template Switcher via ftp upload. The extension is now active, but didn't help me for the moment.

Re: v3.0.2.0 ocmod install error

Posted: Sun Mar 11, 2018 2:43 am
by plantsales
Ok same problem on 3.0.2.0, done all the above

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
<b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b>
<b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b> 
etc....

error log

Code: Select all

2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/language/ru-ru/extension/liveopencart/liveprice.php,/catalog/language/ru-ru/extension/liveopencart/liveprice.php): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js,/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig,/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226

2018-03-10 18:12:05 - PHP Warning:  unlink(/admin/view/stylesheet/bootstrap.css): Permission denied in /admin/controller/common/developer.php on line 94

2018-03-10 18:15:36 - PHP Notice:  Undefined index: user_token in /catalog/controller/simple_blog/article.php on line 13
2018-03-10 18:15:36 - PHP Notice:  Undefined index: user_token in /catalog/controller/simple_blog/article.php on line 25
doesn't make a difference if storage is here or there

simpler problem when I try to clear the SASS Cache
any ideas

Re: v3.0.2.0 ocmod install error

Posted: Sun Mar 11, 2018 3:11 am
by straightlight
plantsales wrote:
Sun Mar 11, 2018 2:43 am
Ok same problem on 3.0.2.0, done all the above

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
<b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b>
<b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b>Warning</b>: mkdir(): Permission denied in <b>/system/storage/modification/admin/controller/marketplace/install.php</b> on line <b>220</b><b> 
etc....

error log

Code: Select all

2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/language/ru-ru/extension/liveopencart/liveprice.php,/catalog/language/ru-ru/extension/liveopencart/liveprice.php): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js,/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-10 17:19:36 - PHP Warning:  rename(/system/storage/upload/tmp-4N1GSIyZ7x/upload/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig,/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig): No such file or directory in /system/storage/modification/admin/controller/marketplace/install.php on line 226

2018-03-10 18:12:05 - PHP Warning:  unlink(/admin/view/stylesheet/bootstrap.css): Permission denied in /admin/controller/common/developer.php on line 94

2018-03-10 18:15:36 - PHP Notice:  Undefined index: user_token in /catalog/controller/simple_blog/article.php on line 13
2018-03-10 18:15:36 - PHP Notice:  Undefined index: user_token in /catalog/controller/simple_blog/article.php on line 25
doesn't make a difference if storage is here or there

simpler problem when I try to clear the SASS Cache
any ideas
Your storage folder is still inside your public_html folder. Follow these instructions: viewtopic.php?f=202&t=201745#p713479

Re: v3.0.2.0 ocmod install error

Posted: Wed Mar 14, 2018 7:39 am
by plantsales
I have try it with the storage outside the public_html, but that does not help the situation
and change the file permissions to 777

Code: Select all

SyntaxError:  unexpected token 0 < in  JSON  at position 0
OK

2018-03-13 23:01:26 - PHP Warning:  mkdir(): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  mkdir(): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  mkdir(): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  mkdir(): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/catalog/model/extension/liveopencart/liveprice.php,/usr/www/users/zzzz/domain/tm/catalog/model/extension/liveopencart/liveprice.php): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  mkdir(): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/admin/language/en-gb/extension/module/liveprice.php,/usr/www/users/zzzz/domain/tm/admin/language/en-gb/extension/module/liveprice.php): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/admin/language/ru-ru/extension/module/liveprice.php,/usr/www/users/zzzz/domain/tm/admin/language/ru-ru/extension/module/liveprice.php): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/admin/view/template/extension/module/liveprice.twig,/usr/www/users/zzzz/domain/tm/admin/view/template/extension/module/liveprice.twig): Permission denied in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/catalog/language/en-gb/extension/liveopencart/liveprice.php,/usr/www/users/zzzz/domain/tm/catalog/language/en-gb/extension/liveopencart/liveprice.php): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/catalog/language/ru-ru/extension/liveopencart/liveprice.php,/usr/www/users/zzzz/domain/tm/catalog/language/ru-ru/extension/liveopencart/liveprice.php): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js,/usr/www/users/zzzz/domain/tm/catalog/view/theme/extension_liveopencart/live_price/liveopencart.live_price.js): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
2018-03-13 23:01:26 - PHP Warning:  mkdir(): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  mkdir(): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 220
2018-03-13 23:01:26 - PHP Warning:  rename(/usr/www/users/zzzz/tm/storage/upload/tmp-U3WsEm99tp/upload/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig,/usr/www/users/zzzz/domain/tm/catalog/view/theme/extension_liveopencart/live_price/theme/default/html.twig): No such file or directory in /usr/www/users/zzzz/tm/storage/modification/admin/controller/marketplace/install.php on line 226
Also this occour when you clear the SASS Ca

Code: Select all

SyntaxError:  unexpected token 0 < in  JSON  at position 0
OK

2018-03-13 23:22:46 - PHP Warning:  unlink(/usr/www/users/xxxx/domain/tm/admin/view/stylesheet/bootstrap.css): Permission denied in /usr/www/users/xxxx/domain/tm/admin/controller/common/developer.php on line 94
Where next?

Re: v3.0.2.0 ocmod install error

Posted: Wed Mar 14, 2018 6:16 pm
by straightlight
Contact your host. Permission issues.

Re: v3.0.2.0 ocmod install error

Posted: Wed Apr 22, 2020 1:16 am
by iDragonFly^
Hi,
try to do the following to fix it, i had this problem before and finally solved it ((OC 3.x)).
1- Go to your hosting Cpanel > PHP PEAR Packages > install the ZipArchive .
2- In your Cpanel too > go to Select PHP Version > Mark on "ZIP"
3- Clear your Modification Cache from admin backend.
4- While installing the extension If you see "The directory catalog/controller/product is not allowed to be written to" then install this extension:
Fix OC 3.x Extension Installer
https://www.opencart.com/index.php?rout ... n_id=33410

*i hope this will help.
Thanks