Solution 1:

First, make sure that your VM instance can communicate with metadata server and can read the project-wide sshKeys value. To verify this, connect to your VM and run the following command:

curl http://metadata.google.internal/computeMetadata/v1/project/attributes/sshKeys -H "Metadata-Flavor: Google"

The output of the command should be SSH keys that you've added to the metadata of your project. If the command can not communicate with metadata, that means your internal firewall blocks the traffic between your VM and metadata server.

If the communication is successful and you can read the value of sshKeys, then you should verify that account manager daemon is running. In Ubuntu 14.04, the daemon script is located at:

/usr/share/google/google_daemon/manage_accounts.py

Use the following command to verify its running status:

sudo ps aux | grep manage_accounts.py