EntityMetaDataWrapper exception when calling commerce_cart_product_add() In brief, I'm trying to create and order and add a line-item as part of a form submission callback. Here's the sauce:

if (!commerce_cart_order_session_exists()) 
{
    $order = commerce_cart_order_new();
    $order-&gt;log = t("Created by $product_type checkout page.");
    commerce_cart_order_session_save($order-&gt;order_id);
} else 
{
    $order = commerce_order_load($form_state['order']-&gt;order_id);
}
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$sku = get_sku($product_type, $adj_age);    
commerce_cart_product_add($uid = 0, $sku = 2, $quantity = 1, $display_uri = NULL, $combine = FALSE);    


I'm getting the following error:

EntityMetadataWrapperException: Missing data values. in EntityMetadataWrapper-&gt;value() (line 83 of /srv/www/mtairy.toomodernmedia.com/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).


In some very similar case I was getting the same error message, but in the commerce_cart_product_add function definition where the metadatawrapper was being called. 

If I comment out the commerce_cart_product_add() line I can instantiate an order object. Not sure what I'm doing wrong here.
You are using commerce_cart_product_add wrong.

You can pretty much replace your entire code with:

$product_id = ...; // You need to product id, from somewhere, you can get it from the SKU
commerce_cart_product_add_by_id($product_id);