Handle incorrect env_id

Change-Id: I87a7464ce82c317e9603ed42f4b9031346178c25
Closes-Bug: 1227154
Merge "Handle incorrect env_id" into release-0.4