Page 1 of 1

CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 09:01
by vikram
Hi,

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

Code: Select all

Execution 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 all

controller.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 all

1,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

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 09:54
by aimeos
vikram wrote:I am trying to run CSV import task. But I get the following error:

Code: Select all

Execution 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 all

controller.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 all

controller.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.

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 10:18
by vikram
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

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 10:27
by aimeos
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.

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 12:48
by vikram
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.

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 13:13
by aimeos
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 all

if( !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.

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 16:37
by vikram
Thanks Admin.. And you are right.
I over looked the fact that the container type default value is directory.
Now the csv import is working great.

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 22 Aug 2015, 17:18
by aimeos
vikram wrote:Now the csv import is working great.
Cool!
The next minor release of the TYPO3 extension (2.3.1) will contain the product stock importer and will log statistics during the import :-)

Re: CSV import error: cannot serialize or unserialize PDO

Posted: 23 Aug 2015, 04:20
by vikram
It is nice to see so rapid feature addition being done. :)