Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#1799 by vikram
22 Aug 2015, 09:01
Hi,

I am trying to run CSV import task. But I get the following error:

Code: Select allExecution of task "Aimeos Shop scheduler (aimeos)" failed with the following message: You cannot serialize or unserialize PDO instances.


I only need to update the stock value. My config below:

Code: Select allcontroller.jobs.product.import.csv.location =  /var/www/html/typo3cms/aimeos_720/fileadmin/aimeos/csv/stockupdate.csv
controller.jobs.product.import.csv.mapping {
  item {
    0 = product.code
  }
  product {
   1 = product.property.stocklevel
  }
}


My csv:

Code: Select all1,10
2,5
3,0
7,10
8,33


Btw, If I set wrong path to the csv file the task completes successfully. Perhaps some error message related to missing file should be added.

regards
Vikram
#1800 by aimeos
22 Aug 2015, 09:54
vikram wrote:I am trying to run CSV import task. But I get the following error:
Code: Select allExecution of task "Aimeos Shop scheduler (aimeos)" failed with the following message: You cannot serialize or unserialize PDO instances.


That seems to be an error that hides the real one. We will have a look if we can get around this.

vikram wrote:I only need to update the stock value. My config below:
Code: Select allcontroller.jobs.product.import.csv.location =  /var/www/html/typo3cms/aimeos_720/fileadmin/aimeos/csv/stockupdate.csv
controller.jobs.product.import.csv.mapping {
  item {
    0 = product.code
  }
  product {
   1 = product.property.stocklevel
  }
}


Sorry, there was a copy/paste error in the documentation. The correct configuration is:
Code: Select allcontroller.jobs.product.import.csv.mapping {
  item {
    0 = product.code
  }
  stock {
    1 = product.stock.stocklevel
  }
}


vikram wrote:Btw, If I set wrong path to the csv file the task completes successfully. Perhaps some error message related to missing file should be added.


That's difficult because the cronjob should not fail if no file is available. We will add a log message instead about the number of lines that have been imported.
#1801 by vikram
22 Aug 2015, 10:18
Sorry I did not look at the Typo3 log. This seems to be reason of the above error perhaps:

[scheduler]: Task failed to execute successfully. Class: Aimeos\Aimeos\Scheduler\Task\Typo6, UID: 2. Class "Controller_Common_Product_Import_Csv_Processor_Stock_Default" not found
#1802 by aimeos
22 Aug 2015, 10:27
vikram wrote:[scheduler]: Task failed to execute successfully. Class: Aimeos\Aimeos\Scheduler\Task\Typo6, UID: 2. Class "Controller_Common_Product_Import_Csv_Processor_Stock_Default" not found


The stock importer is new and has been added only two weeks ago, so it's not in the TYPO3 2.3 release but only in the master branch. You have to checkout the TYPO3 and Core master to be able to use it.
#1803 by vikram
22 Aug 2015, 12:48
I got the latest code.
I have this error now:

Code: Select all[scheduler]: Task failed to execute successfully. Class: Aimeos\Aimeos\Scheduler\Task\Typo6, UID: 2. PHP Warning: mkdir(): File exists in /var/www/html/typo3cms/aimeos_720/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Container/Directory.php line 48 (msg#4.0.1)


I have given full permission to the setup. Even root. Still the error shows up.
Why does the setup needs to create dir any way? just wondering.
#1804 by aimeos
22 Aug 2015, 13:13
vikram wrote:
Code: Select all[scheduler]: Task failed to execute successfully. Class: Aimeos\Aimeos\Scheduler\Task\Typo6, UID: 2. PHP Warning: mkdir(): File exists in /var/www/html/typo3cms/aimeos_720/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Container/Directory.php line 48 (msg#4.0.1)


I have given full permission to the setup. Even root. Still the error shows up.
Why does the setup needs to create dir any way? just wondering.


The code that is executed is:
Code: Select allif( !is_dir( realpath( $resourcepath ) ) && mkdir( $resourcepath, $perm, true ) === false ) {
    throw new MW_Container_Exception( sprintf( 'Unable to create directory "%1$s"', $resourcepath ) );
}


Did you've configured a file name instead of the directory the file is stored? The job controller expects a directory with one or more files to import and it will try to create that directory if it doesn't exist yet.