-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
code: 206 error: cannot modify user ... #1729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The session token I see in that log appears invalid. It does not start with |
That's a good lead I want to follow up on. |
If you had not turned on enable revocable sessions, and if the user has persisted this login for more than a year... is that possible in this case?... |
No, the user is 1-2 weeks old at most. It is an anonymous user. |
+1 on this issue. Unfortunately for us it is slightly different The session token does begin with an 'r' Any attempt to update these users fails with a 206 error code. |
Oh one more thing to add. Just before calling the save method to update the user record I added the following: console.log('Current User record is ' + JSON.stringify(Parse.User.current())); Unfortunately the result was null. So basically it looks like the 'current' user is null and hence why the save fails. |
OK I resolved the issue by change our code from aUserRecord.save({lastLogin:new Date()}); to aUserRecord.save({lastLogin:new Date()}, { sessionToken: aUserRecord.get("sessionToken") }) |
+1 Same issue here.
|
Try passing in the sessionToken into the Save call. aUserRecord.save({lastLogin:new Date()}, { sessionToken: aUserRecord.get("sessionToken") }) |
I only had to do it for User. My guess is because of the ACL on that collection restricts it so that only that user can update their own record.Hope that makes sense. Sent from my BlackBerry - the most secure mobile device From:[email protected]:May 12, 2016 9:33 PMTo:[email protected]:[email protected]:[email protected]; [email protected]:Re: [ParsePlatform/parse-server] code: 206 error: cannot modify user ... (#1729) @araskin Yeah, that works, but I'd like to not have to do that on every function. See issue #1773 —You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub |
Hi again, What we're trying to do is the operation Things to note:
We may have thousands of users in this state and we're worried that they would loose their data if we switch them to the new server. Help, please! |
@gfosco can you refer to my last comment here please. I think this is a bug or at least an undocumented change in behaviour. |
You have until January 2017 before api.parse.com shuts down, so there is no need to worry about your users losing their data. I'd suggest moving to revocable sessions by following the migration guide here: https://parse.com/tutorials/session-migration-tutorial There has been some progress in implementing non-revocable sessions in Parse Server here: #1749. I'm going to close this issue so we can consolidate all discussion of non-revocable sessions on that PR. |
@drew-gross Tx for this. I know you closed this issue but I have a specific question regarding what you wrote here. (Also regarding my worries 😄 - we're upgrading our apps to move out of using api.parse.com these days, ahead of Jan 17, so I am worried about these current users) |
My suggestion if you want to migrate quickly is to go through the revocable session migration guide and then migrate after that. If you want to go even faster, you could try applying the patch in #1749 to your own Parse Server, or even help implement non-revocable sessions in Parse Server. |
@araskin your code is not working, i just passed the |
@cinder92 Thats because lastLogin is a custom field which I added using the parse-dashboard. My guess is you have not added this field. |
Still fails |
Well, if you are sure the req.user is the User object you want, you could force save using master key in cloud code. A little hacky, but this is what worked for me. await user.save(null, { useMasterKey: true }); |
Hi,
We're seeing today code 206 error saying "cannot modify user" . This happens for a specific existing user entry. With new user records we see no issues and we're checking if other users have the same issue.
We're using iOS SDK 1.12.0 and parse-server 2.2.7.
The below is taken from parse-server log - request to modify user that gets the error (the log is obfuscated for ip and other app details).
Dror
The text was updated successfully, but these errors were encountered: