Node_save fails silently I am trying to programmatically update a node with a value from another entity. When I call node_save, the function just "stops". There is nothing in watchdog or in my php_logs that would indicate that any issue was encountered.

$node = node_load($base_node-&gt;nid, FALSE, TRUE);

$node-&gt;field_product[LANGUAGE_NONE][] = array('product_id' =&gt; $entity-&gt;product_id-&gt;value());

dpm('This text prints.');

node_save($node);

dpm('This text does not print.'); //This line is never executed.


I have tried a variety of methods for saving the node including using entitymetadatawrappers on $node. So far, nothing I have tried has gotten me anywhere. 

Thanks!

Edit:

A few more details on what I have tried/am trying to do.

This field is a product reference field that I am adding a reference to. 

There is nothing at all in the php logs or the watchdog logs.

I am trying to do this as a part of custom rules action. I was originally using the add item to list action, but only one item was being added to the list (usually there will be 4-5). As a test, I tried to update and save the node manually (thus the code above).

I should have specified that part, but got a bit wrapped up in my own solution. Either way, it seems pretty odd to me.

Edit Part 2: 

I have confirmed that the structure for field_product is correct. I am also doing checks to make sure that I am not referencing a non-existent field, etc. 

I wasn't originally using dpms for debugging, it just seemed like the simplest way to communicate my issue. Originally I was doing some further processing on my data that was not being done. Since that further logic isn't pertinent to the problem, I added a dpm as an example. There were no errors in the following logic and it wasn't dependent on the node save.
The field structure you are using for your entity reference field is not correct. See entityreference_field_schema().

The correct column name is target_id, not product_id, so it should be like this:

$node = node_load($base_node-&gt;nid, FALSE, TRUE);

$node-&gt;field_product[LANGUAGE_NONE][]['target_id'] = $entity-&gt;product_id-&gt;value();

node_save($node);


This assumes you are using an entity wrapper to access the $entity object but not for accessing the $node object.

[edit]

Regarding your dpm() not firing, it is quite possible it is firing but you aren't seeing the output. This can happen depending on where you are calling it from.

A good alternative in these cases could be dd() or watchdog() since their output will be visible regardless of where you call it from.