I'm importing a relatively simple csv into a custom content type I named "Press."

I'm getting an error called "Missing bundle property on entity of type node" from the Feed Logs.

The import file (CSV) has two rows: headers and a single record.

A new node is created, but the importing of the data fails and so an orphan node of sorts is created without a title or any data.

Here is the error listed in the Feeds log:

Missing bundle property on entity of type node.
Original item
array (
  'id' => '100',
  'title' => 'People on the Move',
  'url' => 'http://www.chicagobusiness.com/section/people-on-the-move',
  'date' => '27-Oct-11',
  'publisher' => 'Crain\'s Chicago',
)
Entity
stdClass::__set_state(array(
   'uid' => '1',
   'status' => 1,
   'promote' => 1,
   'sticky' => 0,
   'created' => 1325712133,
   'revision' => false,
   'comment' => 2,
   'menu' =>
  array (
    'link_title' => '',
    'mlid' => 0,
    'plid' => 0,
    'menu_name' => 'main-menu',
    'weight' => 0,
    'options' =>
    array (
    ),
    'module' => 'menu',
    'expanded' => 0,
    'hidden' => 0,
    'has_children' => 0,
    'customized' => 0,
    'parent_depth_limit' => 8,
  ),
   'log' => 'Replaced by FeedsNodeProcessor',
   'feeds_item' =>
  stdClass::__set_state(array(
     'entity_id' => '100',
     'entity_type' => 'node',
     'id' => 'press_csv',
     'feed_nid' => 0,
     'imported' => 1325712133,
     'hash' => 'a05d52969a6588e09cf28009b2648252',
     'url' => 'http://www.chicagobusiness.com/section/people-on-the-move',
     'guid' => '',
  )),
   'title' => 'People on the Move',
   'field_publication' =>
  array (
    'und' =>
    array (
      0 =>
      array (
        'value' => 'Crain\'s Chicago',
        'format' => 'plain_text',
      ),
    ),
  ),
   'field_published_date' =>
  array (
    'und' =>
    array (
      0 =>
      array (
        'timezone' => 'UTC',
        'offset' => 0,
        'date' =>
        FeedsDateTime::__set_state(array(
           'granularity' =>
          array (
            0 => 'year',
            1 => 'month',
            2 => 'day',
            3 => 'zone',
          ),
           '_serialized_time' => NULL,
           '_serialized_timezone' => NULL,
           'date' => '2011-10-27 00:00:00',
           'timezone_type' => 3,
           'timezone' => 'America/Chicago',
        )),
        'value' => '2011-10-27 00:00:00',
      ),
    ),
  ),
))

Comments

Status:Active» Postponed (maintainer needs more info)

If you are creating a custom entity you should check with your entity first.

Sorry, I don't know what you mean by "check with entity, first".

This is just a custom content type in Drupal 7.

Are you setting a unique field for your importer? does this happen when importing new data or updating?

Suggestion: The error you're posting I'd say raises in common.inc "entity_extract_ids" function, you can place a dpm(debug_backtrace()) and see what's the execution flow to track this error.

I'm having the same issue when importing OG nodes. Too tired now to debug, but I'll do this tomorrow.

Problem solved, that was because of a hook_entity_insert() which was using the passed $entity and then used that entity with a field_get_items() although the entity did not have an id. D'oh.

Status:Postponed (maintainer needs more info)» Closed (works as designed)

Status:Closed (works as designed)» Postponed (maintainer needs more info)

Please don't close the issue - My issue is not the same as the original poster (@wrburgess). Let's give him a chance to give more details.

If its not the same, then please make a new issue and reference this one.

Thanks.

I see the same error as well when importing with HTTP Fetcher . I have a Bitnami stack on my pc and get the same errror. When I run the same Fetcher at my host provider, I do not. Possibly related to Bitnami's php configuration? My error.log does not reporting anything.

Another note. I'm running 7.10 Drupal with Bitnami, but Drupal 7.09 with my hoster.

@emackn: In fact it IS the same issue, but the issue was raised in a precise case for me, which I describe here to help. The issue seems to happen for several people in different scenarios, but I guess describing how I could debug it in my case helps. So this definitely belongs here.

Just posting a follow up about my bug report above. I reinstalled the module and reconfigured my feed and that fixed my problem.

#12 fixed the issue for me too.

Hello, I have the same error. whatever i change the info of row that cause the error, it has the error.
At last, i change the SKU and it work, anybody has the same problem, just try this. I hope this help some one.

Version:7.x-2.0-alpha4» 7.x-2.x-dev

So I don't understand how it was fixed? (Feeds 7.2-dev 2012-May-12)
Post #5 seems good
I have fields nodeid with values (600,601,602) guid with values (1,2,3,4) tried also to add column with values entity_id (1,2,3) and entity_type with values (node, node ...)

But it still gets: Missing bundle property on entity of type node! May anyone comment this?

Feeds Log:

array (
  'guid' => '1',
  'title' => 'My node title',
  'body' => 'My body text',
  'published' => '1',
  'nodeid' => '600',
  'type' => 'mycontent_type',
  'entity_id' => '600',
  'comment' => '1',
  'entity_type' => 'node',
  'status' => '1',
  'category' => 'category 1',
  'userid' => '1',

I'm getting this in a CSV with nearly 9,000 lines, of which just 15 fail to work with a node reference by GUID. I'll see if I can spot what is unusual about those 15 lines.

Hmm... it seems that just one node failed to be created fully, resulting in a broken node with no title. The 15 failure lines were merely repeats of that item, which feeds would have updated instead of creating new nodes for.

For some reason the GUID appearing in the feeds_item table in the database was truncated, and so not the same as the GUID in the CSV file.

I can't see anything unusual or odd about the failing CSV line :(

Running 7.x-2.0-alpha6 and ran into this. Reduced my HTTP Fetched CSV file to one item, and began removing fields.
Got down to 2 fields, "GUID" and "title". My GUID was 163 and when I changed it to 164 (confirming there was no conflict) it worked. I looked for node/163 but it doesn't exist (at least currently). This error was persistent both when I used CRON to run periodic import as well as when I was running it manually.

Maybe this helps shed some light.

Had a similar problem. #12 fixed the issue for me too.

Title:Missing bundle property on entity of type node when importing CSVEntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids()
Status:Postponed (maintainer needs more info)» Active

In a feature module, I'm installing and importing a feed in a hook_install() function. Installing the feed source works. However, I'm getting EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7650 of /srv/www/includes/common.inc). during the import. If I import the feed via the /import ui, it works without any exception.

I'm using the stand-alone form and adding the feed items to a CType with a machine name of "news". Here's my code:

<?php
function my_news_install() {
 
// Set feed source url
  // Code from drupal.org/node/1115714#comment-4382624
 
$source = feeds_source('news_feed_importer');
 
$source->addConfig(array(
   
'FeedsHTTPFetcher' => array(
     
'source' => '<feed_url>',
    ),
  ));
 
$source->save();
 
// Import items from feed source
  // Code from "Trigger Import Programmatically" section of drupal.org/node/622700
 
while (FEEDS_BATCH_COMPLETE != feeds_source('news_feed_importer', 0)->import());
}
?>

This error occurs for each item in the feed, but this is the Feeds log output from just one item.

<?php
Entity
stdClass
::__set_state(array(
  
'type' => NULL,
  
'changed' => 1359635177,
  
'created' => 1359635177,
  
'language' => 'und',
  
'status' => 1,
  
'promote' => 1,
  
'sticky' => 0,
  
'uid' => 0,
  
'revision' => false,
  
'menu' =>
  array (
   
'link_title' => '',
   
'mlid' => 0,
   
'plid' => 0,
   
'menu_name' => 'main-menu',
   
'weight' => 0,
   
'options' =>
    array (
    ),
   
'module' => 'menu',
   
'expanded' => 0,
   
'hidden' => 0,
   
'has_children' => 0,
   
'customized' => 0,
   
'parent_depth_limit' => 8,
  ),
  
'log' => 'Created by FeedsNodeProcessor',
  
'feeds_item' =>
 
stdClass::__set_state(array(
    
'entity_id' => 0,
    
'entity_type' => 'node',
    
'id' => 'news_feed_importer',
    
'feed_nid' => 0,
    
'imported' => 1359635177,
    
'hash' => '60d516fc6821cf8c7c8238ea2b6f0482',
    
'url' => '',
    
'guid' => '',
  )),
))
?>

I need to investigate this more. It may be a case of my news CType being created after the hook_install() is run. Does anybody else successfully run an import from hook_install()?

Component:Feeds Import» Code

I was doing something similar to dkingofpa:

<?php
$source
= feeds_source('{feed_name}');
$source->addConfig(array(
 
'FeedsHTTPFetcher' => array(
   
'source' => '{feed_url}',
  ),
));
$source->save();
// Try to reload source.
$source = feeds_source('lemelson_center_events');
$source->import();
?>

I found that my features-managed processor wasn't getting populated with the correct config. It was missing the bundle and the mappings.

Turns out that both `FeedsConfigurable::instance()` and `FeedsSource::instance()` use PHP static variables so clearing the drupal_static() cache wasn't emptying them.

My workaround for the time being is to schedule the feed import and then use drush to call cron. Oddly, I have to move back the `job_schedule` next time and invoke cron twice before the nodes are imported:

<?php
...
$source->save();
$source->schedule();
db_query("UPDATE {job_schedule} SET next = :next WHERE type = :type", array(
 
':next' => time() - 1000,
 
':type' => $source->id,
));
drush_invoke_process('', 'cron', array(), array());
drush_invoke_process('', 'cron', array(), array());
?>