I attempted to create a shared folder on a raspberry pi using the instructions found here. On running the command "sudo smbpasswd -a pi" to create a user and add a password, I got an error "Failed to add entry for user pi". Changing the user name to something else or trying different passwords did not make the error go away.
While I did not confirm this, I suspect the same error shows up in Ubuntu as well. However the solution there was not super clear.