The reason you're seeing "Could not find domain \"mydomain.appspot.com\"." is that the "domain-" prefix refers to all accounts within a Google Apps for Business domain, not appengine domain names. For example, if you were using Google Apps for your company, fakecompany.com, and you wanted to grant read access for a bucket for all accounts under fakecompany.com, you could specify "domain-fakecompany.com" to refer to all such accounts.
I'm guessing mydomain.appspot.com is an appengine domain name and not a Google Apps for Business domain, which would cause that sort of error.
Updates: There was another misunderstanding that is worth pointing out. A service account does not necessarily have permission to insert new objects into buckets that you own. Make sure that it either has explicit WRITE or better permission on a bucket, or, if you're using the default bucket ACL, that it is at least an "editor" on your project.
Finally, make sure that your bucket names and object names are present and not null when inserting objects. This is a surprisingly easy problem to have, and the error message provided doesn't always make this very clear.