Error: Invalid value of UK provided for the countryId field. Error File: vendor\magento\module-customer\Model\ResourceModel\AddressRepository.php Error line: 133 Code is: $customer = $this->customerRepository->getById($customer->getId()); $cattrValue = $customer->getCustomAttribute('username'); $customer->setCustomAttribute('username', $customerData['web_username']); $customer->setFirstname($customerData['first_name']); $customer->setLastname($customerData['last_name']); $this->customerRepository->save($customer, $hashedPassword);