rules – Cannot create user, email: invalid!! while trying to create a user

Here is a rule that fires when civicrm contact is created. It works off Tag, ie the webform adds a Tag to the Contact. Rules then runs off that event. Note this rule also auto logs the person in but you should be able to get some clues from this. You need civicrm_entity module.

    { "rules_self_create_user_account_and_login" : {
    "LABEL" : "Create User Account",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "civicrm", "rules" ],
    "ON" : { "civicrm_entity_tag_create" : [] },
    "IF" : [
      { "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ] } },
      { "data_is" : {
          "data" : [ "civicrm-entity-tag:entity-table" ],
          "value" : "civicrm_contact"
        }
      },
      { "data_is" : { "data" : [ "civicrm-entity-tag:tag-id" ], "value" : "525" } }
    ],
    "DO" : [
      { "civicrm_entity_action_create_user" : {
          "USING" : {
            "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ],
            "is_active" : "1",
            "notify" : "1",
            "signin" : "1",
            "username_format" : "email"
          },
          "PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
        }
      },
      { "redirect" : { "url" : "civicrm/user?reset=1" } }
    ]
  }
}