{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/574","repository_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/574/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/574/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-Android/issues/574","id":201437846,"number":574,"title":"Code 200: bad or missing username","user":{"login":"alexblack","id":148930,"avatar_url":"https://avatars.githubusercontent.com/u/148930?v=3","gravatar_id":"","url":"https://api.github.com/users/alexblack","html_url":"https://github.com/alexblack","followers_url":"https://api.github.com/users/alexblack/followers","following_url":"https://api.github.com/users/alexblack/following{/other_user}","gists_url":"https://api.github.com/users/alexblack/gists{/gist_id}","starred_url":"https://api.github.com/users/alexblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexblack/subscriptions","organizations_url":"https://api.github.com/users/alexblack/orgs","repos_url":"https://api.github.com/users/alexblack/repos","events_url":"https://api.github.com/users/alexblack/events{/privacy}","received_events_url":"https://api.github.com/users/alexblack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-17T23:36:33Z","updated_at":"2017-01-18T01:03:26Z","closed_at":null,"body":"Parse Android SDK version: 1.13.1\r\nParse server version: 2.2.23\r\nRepo showing the problem: https://github.com/alexblack/parse-user-test\r\n\r\nRepro steps:\r\n\r\n1. Turn on airplane mode\r\n2. Init parse, attempt (but fail) to save the user\r\n3. Turn off airplane mode\r\n4. Save the user\r\n\r\nResult: \"Bad or missing username\".  Expected result: user saves.\r\n\r\n(Note: if I then restart the app, with airplane mode off, and repeat step 2, the user saves just fine)\r\n\r\nCode for step 2:\r\n\r\n```\r\n    Parse.initialize(new Parse.Configuration.Builder(this)\r\n      .applicationId(BuildConfig.PARSE_APP_ID)\r\n      .clientKey(BuildConfig.PARSE_CLIENT_KEY)\r\n      .server(BuildConfig.PARSE_URL)\r\n      .build()\r\n    );\r\n    ParseUser.enableAutomaticUser();\r\n    final ParseUser user = ParseUser.getCurrentUser();\r\n    user.saveInBackground().continueWithTask(new Continuation<Void, Task<Void>>() {\r\n      @Override\r\n      public Task<Void> then(Task<Void> task) throws Exception {\r\n        if (task.isFaulted()) Log.e(TAG, \"Exception\", task.getError());\r\n        return null;\r\n      }\r\n    });\r\n```\r\n\r\nCode for step 4:\r\n\r\n```\r\n    final ParseUser user = ParseUser.getCurrentUser();\r\n    user.saveInBackground()\r\n```\r\n\r\nStack trace:\r\n\r\n```\r\n01-17 15:31:28.032 5226-5226/com.example.test.parseusertest E/MainActivity: Failed to save\r\ncom.parse.ParseRequest$ParseRequestException: bad or missing username\r\nat com.parse.ParseRequest.newPermanentException(ParseRequest.java:270)\r\nat com.parse.ParseRESTCommand.onResponseAsync(ParseRESTCommand.java:301)\r\nat com.parse.ParseRESTUserCommand.onResponseAsync(ParseRESTUserCommand.java:126)\r\nat com.parse.ParseRequest$3.then(ParseRequest.java:137)\r\nat com.parse.ParseRequest$3.then(ParseRequest.java:133)\r\nat bolts.Task$15.run(Task.java:917)\r\nat bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)\r\nat bolts.Task.completeAfterTask(Task.java:908)\r\nat bolts.Task.continueWithTask(Task.java:715)\r\nat bolts.Task.continueWithTask(Task.java:726)\r\nat bolts.Task$13.then(Task.java:818)\r\nat bolts.Task$13.then(Task.java:806)\r\nat bolts.Task$15.run(Task.java:917)\r\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\r\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\r\nat java.lang.Thread.run(Thread.java:818)\r\n```\r\n\r\nLogs from parse-server:\r\n\r\n```\r\n2017-01-17T23:31:27.929972+00:00 app[web.1]: verbose: REQUEST for [POST] /parse/users: {} method=POST, url=/parse/users, host=removed, connection=close, x-parse-revocable-session=1, x-parse-os-version=6.0, x-parse-app-build-version=1, x-parse-client-key=removed, x-parse-client-version=a1.13.1, x-parse-app-display-version=1.0, x-parse-installation-id=e789df42-c611-4710-accc-250830d6f8c6, user-agent=Parse Android SDK 1.13.1 (com.example.test.parseusertest/1) API Level 23, x-parse-application-id=removed, content-type=application/json, accept-encoding=gzip, x-request-id=bbc0ba4d-9609-450f-9dc4-48cbd114a6a4, x-forwarded-for=69.172.186.177, x-forwarded-proto=http, x-forwarded-port=80, via=1.1 vegur, connect-time=0, x-request-start=1484695887924, total-route-time=0, content-length=2,\r\n2017-01-17T23:31:27.933219+00:00 app[web.1]: error: Error generating response. ParseError { code: 200, message: 'bad or missing username' } code=200, message=bad or missing username\r\n2017-01-17T23:31:28.096502+00:00 app[web.1]: Error: Code 200: bad or missing username\r\n2017-01-17T23:31:28.096505+00:00 app[web.1]:     at /app/index.js:104:11\r\n2017-01-17T23:31:28.096506+00:00 app[web.1]:     at Layer.handle_error (/app/node_modules/express/lib/router/layer.js:71:5)\r\n2017-01-17T23:31:28.096507+00:00 app[web.1]:     at trim_prefix (/app/node_modules/express/lib/router/index.js:310:13)\r\n2017-01-17T23:31:28.096508+00:00 app[web.1]:     at /app/node_modules/express/lib/router/index.js:280:7\r\n2017-01-17T23:31:28.096509+00:00 app[web.1]:     at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12)\r\n2017-01-17T23:31:28.096510+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/index.js:271:10)\r\n2017-01-17T23:31:28.096511+00:00 app[web.1]:     at Immediate.<anonymous> (/app/node_modules/express/lib/application.js:232:9)\r\n2017-01-17T23:31:28.096511+00:00 app[web.1]:     at Immediate.<anonymous> (/app/node_modules/express/lib/router/index.js:618:15)\r\n2017-01-17T23:31:28.096512+00:00 app[web.1]:     at Immediate.wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:183:28)\r\n2017-01-17T23:31:28.096513+00:00 app[web.1]:     at runCallback (timers.js:639:20)\r\n```\r\n\r\nVerbose logs from parse-server after restarting the app and trying again from the top with airplane mode off:\r\n\r\n```\r\n2017-01-18T00:11:57.949508+00:00 app[web.1]: verbose: REQUEST for [POST] /parse/users: {\r\n2017-01-18T00:11:57.949525+00:00 app[web.1]:   \"authData\": {\r\n2017-01-18T00:11:57.949526+00:00 app[web.1]:     \"anonymous\": {\r\n2017-01-18T00:11:57.949527+00:00 app[web.1]:       \"id\": \"dbdb591c-49d6-4eb9-a09a-d500d95b9fb8\"\r\n2017-01-18T00:11:57.949528+00:00 app[web.1]:     }\r\n2017-01-18T00:11:57.949529+00:00 app[web.1]:   }\r\n2017-01-18T00:11:57.949531+00:00 app[web.1]: } method=POST, url=/parse/users, host=removed, connection=close, x-parse-os-version=6.0, x-parse-app-build-version=1, x-parse-client-key=removed, x-parse-client-version=a1.13.1, x-parse-app-display-version=1.0, x-parse-installation-id=854d9406-d43b-4c09-b288-8870ba518251, user-agent=Parse Android SDK 1.13.1 (com.example.test.parseusertest/1) API Level 23, x-parse-application-id=removed, content-type=application/json, accept-encoding=gzip, x-request-id=b77ebf42-978a-4329-addd-554abb7e5ade, x-forwarded-for=69.172.186.177, x-forwarded-proto=http, x-forwarded-port=80, via=1.1 vegur, connect-time=0, x-request-start=1484698317931, total-route-time=0, content-length=72, id=dbdb591c-49d6-4eb9-a09a-d500d95b9fb8\r\n2017-01-18T00:11:58.200463+00:00 app[web.1]: verbose: RESPONSE from [POST] /parse/users: {\r\n2017-01-18T00:11:58.200481+00:00 app[web.1]:   \"status\": 201,\r\n2017-01-18T00:11:58.200482+00:00 app[web.1]:   \"response\": {\r\n2017-01-18T00:11:58.200483+00:00 app[web.1]:     \"objectId\": \"DCGEgpLTdX\",\r\n2017-01-18T00:11:58.200483+00:00 app[web.1]:     \"createdAt\": \"2017-01-18T00:11:57.949Z\",\r\n2017-01-18T00:11:58.200484+00:00 app[web.1]:     \"username\": \"QBeGRW4737xpht6kDWwAFQf82\",\r\n2017-01-18T00:11:58.200485+00:00 app[web.1]:     \"sessionToken\": \"r:0cab421bfe7108cb23f6fd7f98577aa3\"\r\n2017-01-18T00:11:58.200485+00:00 app[web.1]:   },\r\n2017-01-18T00:11:58.200486+00:00 app[web.1]:   \"location\": \"http://host/parse/users/DCGEgpLTdX\"\r\n2017-01-18T00:11:58.200488+00:00 app[web.1]: } status=201, objectId=DCGEgpLTdX, createdAt=2017-01-18T00:11:57.949Z, username=QBeGRW4737xpht6kDWwAFQf82, sessionToken=r:0cab421bfe7108cb23f6fd7f98577aa3, location=http://host/parse/users/DCGEgpLTdX\r\n```"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/comments/273351242","html_url":"https://github.com/ParsePlatform/Parse-SDK-Android/issues/574#issuecomment-273351242","issue_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-Android/issues/574","id":273351242,"user":{"login":"alexblack","id":148930,"avatar_url":"https://avatars.githubusercontent.com/u/148930?v=3","gravatar_id":"","url":"https://api.github.com/users/alexblack","html_url":"https://github.com/alexblack","followers_url":"https://api.github.com/users/alexblack/followers","following_url":"https://api.github.com/users/alexblack/following{/other_user}","gists_url":"https://api.github.com/users/alexblack/gists{/gist_id}","starred_url":"https://api.github.com/users/alexblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexblack/subscriptions","organizations_url":"https://api.github.com/users/alexblack/orgs","repos_url":"https://api.github.com/users/alexblack/repos","events_url":"https://api.github.com/users/alexblack/events{/privacy}","received_events_url":"https://api.github.com/users/alexblack/received_events","type":"User","site_admin":false},"created_at":"2017-01-18T01:03:26Z","updated_at":"2017-01-18T01:03:26Z","body":"The difference between the `save` call that works (after restart) and the one that fails, is that when it works, `ParseObject.operationSetQueue` has one object in it, representing the auth data, and later it has two, that one and an empty one.\r\n\r\nAfter the initial save fails, `ParseObject.operationSetQueue` is modified, with an empty `ParseOperationSet` appended, which means no values are sent to Parse on the next save."}}
{"actor":{"display_login":"alexblack"}}