Setup upgrade Error, Invalid Document Element ‘resource’: The attribute ‘title’ is required but missing Magento 2

When we run php bin/magento setup:upgrade command through the command line, Sometimes error will throw like, Invalid Document Element ‘resource’: The attribute ‘title’ is required but missing.

This issue coming to Magento 2.2.* version when you run upgrade command.
This issue is related to acl.xml file. You missing the title attribute to <resource> tag. You must declare all the resource tag in acl.xml file with title attribute except all the resource tag which start with id=”Magento_Backend::”.

Check error code,

<resource id=”Rbj_CustomForm::rbj”> this tag with title attribute is missing, So you must set tag with title=”title name”.

Right code,

Run   Setup upgrade command and your error will be wiped out.

 

How to Create customer and add new address programmatically in magento 2?

To creating customer and customer address programmatically in Magento 2 using below code snippet. Just Pass $customerInfo array to a block function .

Given below code checks, Customer is existed or not using email id. If the customer is new, Add a new customer and add given address to the same customer otherwise display already exist customer message.

In Block file, Pass customer required data from above $customerInfo array,

Run indexer command to see a customer in the admin panel,