About 8 hours ago I noticed a new user can't register. My them breaks and I get this error:
EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 731 of /home4/growtogi/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).
.
I have a first and last name field, along with a few location fields, captcha, and legal (terms of use) fields on the register page.
I've disabled everyone of them and I still get the error.
2 days ago I could register new users. Since then I added deleted one node content type and added another. I've not added any user fields. I added a quiz module, but since have disabled and uninstalled.
I really don't know where to turn. It would be really really really really nice if an error gave more information - like which field it is looking at to determine where the issue is? Which field it is claiming is being given the wrong value or format. Certainly the code must know?
I've cleared cache, ran update, looked in user database to see if there were any null or wrongly formatted fields, etc.
It appears there must be an issue with either my username field or my email field. I stripped away everything else and those were the only 2 left, still can't register. I have a rule firing when a new user registers to create a new node for that user. I also disabled that rule. Here is the only thing I get in my error logs. See attached photo (long photo of logs) showing the first instance of not being able to register new user back about 48 hours to the last time I registered new user: (marked by red dot)

| Comment | File | Size | Author |
|---|---|---|---|
| log.png | 2.69 MB | IWasBornToWin |
Comments
Comment #1
IWasBornToWin commentedI just dug a little deeper and found this in the variable column of my watchdog table:
a:6:{s:5:"%type";s:30:"EntityMetadataWrapperException";s:8:"!message";s:79:"Invalid data value given. Be sure it matches the required data type and format.";s:9:"%function";s:26:"EntityDrupalWrapper->set()";s:5:"%file";s:80:"/home4/growtogi/public_html/sites/all/modules/entity/includes/entity.wrapper.inc";s:5:"%line";i:731;s:14:"severity_level";i:3;}
although, it doesn't tell me anything different than the other message.
Comment #2
IWasBornToWin commentedall of the watchdog records who user id of 0 but i suspect that's for anonymous user? I also noticed the user table does not automatically increment the uid when creating a new user. At first I thought that may be the issue because it was trying to duplicate a uid, but I have another site also running drupal 7 and looked at the user table there - same way, does not have auto increment loaded.
Comment #3
IWasBornToWin commentedI found the culprit. I have a rule which reacts on a new user referral and it has something to do with that rule. Just wonder if there is any particular reason why your error can't identify this rather than let us spend hours, a couple days in my case, searching and looking?
I'm about to ask rules the same question. But I suspect someone from these three modules will pass the buck to the other. All I know is I was locked out of registering new users and given a very generic message as to why - frustrating. Hope this helps someone else.
I will wait to mark this as solved in hopes I can get an answer on why your code can't reveal which field, entity, value, etc. when stopping the rest of code from running (which I do appreciate, better than breaking). Thanks
Comment #4
sharif.tanveer commentedI hope you have got the answer already. I am still disabling the 'referral' module. You can use invite module to produce referral link; bit weird though. But the most difficult problem is, I had the same rules as well, and now I can not use 'that' rule. I have to now grant all the points manually!! A pain indeed. & I found lots of bugs in the Userpoint modules too. Requested to solve them, yet no response....
I appreciate that you been active all this long.
Comment #5
IWasBornToWin commentedAs per your post here - http://drupal.org/node/1671606. I am successfully using the referral module and userpoints. But I am monitoring referral module now, due to discussion in your post.
Comment #6
alexander allen commentedHi IWasBornToWin,
As a developer, the error message is more than self-explanatory to me. The
EntityDrupalWrapper::set()method is barfing because it has been passed a invalid value.According to the Entity API documentation , set() calls
$this->validate($value)before doing anything else, which in turn callsentity_property_verify_data_type(). That last function makes sure that if you pass an integer toEntityDrupalWrapper::set(), it really is an integer, or that if it is a string, that it really is a string. This is done as a safety feature, so the exception that Entity API is throwing really "works as designed" - because it's telling you "you're trying to do something with Entities that is not safe". Meaning, the problem is either custom code or contributed code passing the wrong parameters toEntityDrupalWrapper::set().Either way, I would not be able to replicate this issue without a database dump of your site, or maybe a full callstack of the error. At this point my best recommendation for you would be to contact any of the companies listed in the Drupal Marketplace: https://drupal.org/drupal-services. With your permission, they will be able to log in to your server and troubleshoot your issue with the particular Drupal configuration you have there.
In the meantime, I am marking this issue as "work as intended". If a developer working on your site confirms that this is strictly an Entity API issue, please feel free to reopen as a bug report.
Thank you!
Comment #7
IWasBornToWin commentedIf I remember the issue was the referral module. Thanks for replying.