In the Reports/DBlog from time to time I'm getting the following Messages:

Failed to insert item into amazon table: Message = SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1, query= INSERT INTO {amazon_music} (asin, label, numberofdiscs, studio, artist) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4_0, :db_insert_placeholder_4_1) fields=Array()

Failed to insert item into amazon table: Message = SQLSTATE[HY000]: General error: 1364 Field 'ean' doesn't have a default value, query= INSERT INTO {amazon_book} (asin, publicationdate) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1) fields=Array()

Is this a bug or am I doing something wrong?

Comments

rfay’s picture

Have you done an update and not run update.php?

What database are you using? Mariadb? Mysql? Postgres?

It seems odd that this hasn't been reported before, but could be a problem with just the music table.

Could you please report what ASIN this was trying to use?

rfay’s picture

Status: Active » Postponed (maintainer needs more info)

Just tested with asin B0000058HT (and a number of others) and I don't see this error when creating a node or when running cron. I have amazon_media enabled.

I'll need a complete step-by-step to look at this.

smitty’s picture

>Have you done an update and not run update.php?
No.

>What database are you using? Mariadb? Mysql? Postgres?
Mysql

>Could you please report what ASIN this was trying to use?
No. I'm just seeing these messages in the reports (approximately once a day).
I don't have any clue where they come from and what they do mean.

rsjaffe’s picture

I'm getting the same error messages. They're coming in pairs every 10th time the module updates Amazon items.

Here's a typical message:

Failed to insert item into amazon table: Message = SQLSTATE[HY000]: General error: 1364 Field 'ean' doesn't have a default value, query= INSERT INTO {amazon_book} (asin, isbn, numberofpages, publicationdate) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3) fields=
Array
(
)

rfay’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Fixed

Amazon seems not to always provide the EAN, but the schema has it as required.

Committed http://drupalcode.org/project/amazon.git/commitdiff/3400aa9 -

Please try the latest dev when it updates (every 12 hours) and you *must run update.php*

Please run update.php after you update to latest dev

This also adds a debug message which will help us understand what ASIN was causing the problem.

rsjaffe’s picture

Drupal won't let me change to the development version--it states "amazon module already installed" when I try to install the development version. Is there a manual patch I could apply to include the debugging? I'm pretty comfortable with PHP programming.

Thanks

PS--Are the debug messages in the watchdog calls in the amazon_http_request function?

rfay’s picture

@rsjaffe, you wouldn't *install* Amazon module if it was already installed... You would just update the code and then run update.php.

Can you say more about what you're trying to do?

rsjaffe’s picture

OK--I was using the "Module" page, the "install new module" link, with the assumption that that would allow a move from the release to development version. How do I do a forced update? Do I delete the old module on the server and unzip the new one in its place, then run update.php?

rfay’s picture

Whenever you update a module, you run update.php, as in visiting http://example.com/update.php

You can also do it with

drush updatedb

But I'm betting you're not using drush yet.

The big picture is explained in http://drupal.org/upgrade

rsjaffe’s picture

Can't get drush to work on my site--using a shared server. I was able to install the development version of the module. Stay tuned for results... Should be available in 12 hours or so.

rsjaffe’s picture

Hah! Since I changed to the development version, the errors stopped. I'll post again if the error shows up.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.