CSV import error: cannot serialize or unserialize PDO

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)
vikram
Posts: 22
Joined: 16 Jul 2015, 06:38
Location: India
Contact:

CSV import error: cannot serialize or unserialize PDO

Post by vikram » 22 Aug 2015, 09:01

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

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: CSV import error: cannot serialize or unserialize PDO

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

vikram
Posts: 22
Joined: 16 Jul 2015, 06:38
Location: India
Contact:

Re: CSV import error: cannot serialize or unserialize PDO

Post 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

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: CSV import error: cannot serialize or unserialize PDO

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

vikram
Posts: 22
Joined: 16 Jul 2015, 06:38
Location: India
Contact:

Re: CSV import error: cannot serialize or unserialize PDO

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

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: CSV import error: cannot serialize or unserialize PDO

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

vikram
Posts: 22
Joined: 16 Jul 2015, 06:38
Location: India
Contact:

Re: CSV import error: cannot serialize or unserialize PDO

Post by vikram » 22 Aug 2015, 16:37

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.

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: CSV import error: cannot serialize or unserialize PDO

Post by aimeos » 22 Aug 2015, 17:18

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 :-)

vikram
Posts: 22
Joined: 16 Jul 2015, 06:38
Location: India
Contact:

Re: CSV import error: cannot serialize or unserialize PDO

Post by vikram » 23 Aug 2015, 04:20

It is nice to see so rapid feature addition being done. :)

Post Reply