{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35/events","html_url":"https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35","id":118176921,"number":35,"title":"AUTH_DOMAIN not being set","user":{"login":"dmytton","id":117833,"avatar_url":"https://avatars.githubusercontent.com/u/117833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmytton","html_url":"https://github.com/dmytton","followers_url":"https://api.github.com/users/dmytton/followers","following_url":"https://api.github.com/users/dmytton/following{/other_user}","gists_url":"https://api.github.com/users/dmytton/gists{/gist_id}","starred_url":"https://api.github.com/users/dmytton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmytton/subscriptions","organizations_url":"https://api.github.com/users/dmytton/orgs","repos_url":"https://api.github.com/users/dmytton/repos","events_url":"https://api.github.com/users/dmytton/events{/privacy}","received_events_url":"https://api.github.com/users/dmytton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-21T07:08:49Z","updated_at":"2015-12-01T12:51:25Z","closed_at":null,"body":"The environment variable https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/blob/master/python_vm_runtime/google/appengine/api/users.py#L116 is not being set on a Google Apps App Engine project. This is causing authentication to fail:\r\n\r\n```\r\nTraceback (most recent call last):\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/middlewares.py\\\", line 283, in ErrorLoggingWrapper\r\n\\n\r\nreturn app(wsgi_env, start_response)\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/middlewares.py\\\", line 271, in LogRequestWrapper\\n\r\nreturn app(wsgi_env, StartResponseWrapper)\\n\r\nFile \\\"/home\r\n/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py\\\", line 454, in __call__\\n\r\nreturn self.GetUserAppAndServe(script, env, start_response)\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/ext/vmrun\r\ntime/meta_app.py\\\", line 549, in GetUserAppAndServe\\n\r\napp, mod_file = self.GetUserApp(script)\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py\\\", line 410, in GetUserApp\\n\r\napp = _AppFrom27StyleScript(script)\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/ext/vmruntime/meta_app.py\\\", line 270, in _AppFrom27StyleScript\\n\r\napp, filename, err = wsgi.LoadObject(script)\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/runtime/wsgi.py\\\", line 85, in LoadObject\\n\r\nobj = __import__(path[0])\\n\r\nFile \\\"/home/vmagent/app/search.py\\\", line 14, in <module>\\n\r\nfrom users import *\\n File \\\"/home/vmagent/app/users.py\\\", line 12, in <module>\\n\r\nuser = users.get_current_user()\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/api/users.py\\\", line 301, in get_current_user\\n\r\nreturn User()\\n\r\nFile \\\"/home/vmagent/python_vm_runtime/google/appengine/api/users.py\\\", line 117, in __init__\\n\r\nassert _auth_domain\\nAssertionError\\n\r\n```\r\n\r\nThis is noted in https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime#caveats that the login handler is not supported but the handler is being invoked and an error is being thrown.\r\n\r\nI was able to solve this by changing https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/blob/master/python_vm_runtime/google/appengine/api/users.py#L116 to hard code my Apps domain as the `AUTH_DOMAIN`. I was then able to bundle this as a custom runtime as part of the Managed VM. It just seems like a bug in the runtime, not correctly setting the `AUTH_DOMAIN`.\r\n\r\nSee also Google Enterprise support case 07656056 where I reported this on 14th October but with no fix so far."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/comments/160958842","html_url":"https://github.com/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35#issuecomment-160958842","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/appengine-python-vm-runtime/issues/35","id":160958842,"user":{"login":"dmytton","id":117833,"avatar_url":"https://avatars.githubusercontent.com/u/117833?v=3","gravatar_id":"","url":"https://api.github.com/users/dmytton","html_url":"https://github.com/dmytton","followers_url":"https://api.github.com/users/dmytton/followers","following_url":"https://api.github.com/users/dmytton/following{/other_user}","gists_url":"https://api.github.com/users/dmytton/gists{/gist_id}","starred_url":"https://api.github.com/users/dmytton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmytton/subscriptions","organizations_url":"https://api.github.com/users/dmytton/orgs","repos_url":"https://api.github.com/users/dmytton/repos","events_url":"https://api.github.com/users/dmytton/events{/privacy}","received_events_url":"https://api.github.com/users/dmytton/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T12:51:25Z","updated_at":"2015-12-01T12:51:25Z","body":"I reverted to the standard MVM runtime and it's working as expected now, so looks like this was fixed at some point."}}