Description
Hello
I am getting error 206 after new Facebook user is saved and reason seems to be nil sessionToken.
I am facing this for Apple sign in also randomly. This is probably getting fixed by #6416. Don't know whether Facebook issue will also be fixed.
I have one old account created on Heroku Parse server which works fine ie i am able to save attributes after login.
I was running server v3.9.0. tried upgrading till 4.0.2 but still failing.
I am updating PFUser object post login locally in iOS client using Swift. Not using cloud code for this.
Also failing on back4app v3.9.0. Sign in with Apple also failing on back4app but works randomly.
Works on local setup consistently. Local server installed using bootstrap.sh script.
I have seen some issued dated 2016 fixing this error but server code seems to have changed lot so cannot view the same code referred in #952
using FBSDKCoreKit 5.15.1, FBSDKLoginKit 5.15.1
Steps to reproduce
on iOS, Try login using a facebook account that is not yet created on Parse.
Running iOS 13.3.1
Expected Results
After successful login, should be able to save other attributes in PFUser.current() object
Actual Outcome
The login is successful but saving any attributes fails with error 206 "cannot modify user xxxxx"
Fails on back4app also. v3.9.0
Both Apple and Facebook new user registration and update work fine in local environment.
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : 3.9.0 to 4.0.2 (Local 3.10.0)
- Operating System: heroku-18 (Local MacOS 10.15.3)
- Hardware: heroku-18 (Local MacOS 10.15.3)
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Both as mentioned above
-
Database
- MongoDB version: mLab 3.6.12 (Local 4.2.3)
- Storage engine: mLab
- Hardware: mLab
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): both
Logs/Trace
Mar 15 02:51:40 yovl app/web.1 error: Parse error: Cannot modify user kc30Xbk1wA. {"code":206,"stack":"Error: Cannot modify user kc30Xbk1wA.\n at RestWrite.runDatabaseOperation (/app/node_modules/parse-server/lib/RestWrite.js:1170:11)\n at /app/node_modules/parse-server/lib/RestWrite.js:127:17\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"}
package.json used for deployment to Heroku
{
"name": "parse-server-example",
"version": "1.4.0",
"description": "Based on example Parse API server using the parse-server module",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ashish-naik/parse-server.git"
},
"license": "MIT",
"dependencies": {
"express": "4.17.1",
"parse-server": "4.1.0",
"underscore":"*",
"parse": "2.11.0"
},
"scripts": {
"start": "node index.js"
},
"engines": {
"node": ">= 8",
"npm": ">= 5.7.1"
}
}
auth section in index.js
auth: {
facebook: {
appIds: process.env.FACEBOOK_APP_ID
},
apple: {
client_id: process.env.IOS_BUNDLE_ID
}
},
Activity
henrytkirk commentedon Mar 22, 2020
I'm having a similar issue too - perhaps related:
If I login with Facebook successfully, then logout and try Sign-in with Apple using the same email associated with Facebook, I get a 500 returned - internal server error.
dplewis commentedon Mar 22, 2020
@henrytkirk Can you open a new issue and fill out the template. Any logs or sample code would help.
dplewis commentedon Mar 22, 2020
@ashish-naik Can you try facebook login on the backend with masterKey: true?
ashish-naik commentedon Mar 22, 2020
I am not using cloud code for login. Call from swift code.
dplewis commentedon Mar 22, 2020
I wanted you to try it and see if that would fix this
If login is successful does your current user have a sessionToken? To change a user you need to have permission to do so.
ashish-naik commentedon Mar 23, 2020
I will try. May take some time due to workplace priorities.
Yes sessionToken is nil after successful login.
ashish-naik commentedon Mar 25, 2020
@dplewis I tried below. Not good with cloud code so hope code is not wrong.
Cloud function
ios Code
Server log
if i run code for a registered user without master key, i get sessionToken printed in logs.
But i am getting undefined for sessionToken for user.sessionToken or user.getsessionToken.
Not sure to fetch access token.
Moreover, in Xcode i get PFUser.current as nil.
Does above help?
ashish-naik commentedon Mar 29, 2020
@dplewis Did you get a chance to look at my code?
Hope you are safe and doing well in this difficult times.
dplewis commentedon Mar 29, 2020
I can look into it, can you open a similar post in the iOS SDK?
ashish-naik commentedon Mar 30, 2020
Created parse-community/Parse-SDK-iOS-OSX#1492
ashish-naik commentedon Apr 9, 2020
@dplewis I had opened 1477 post awhile back for Sign in with Apple. The symptoms are same as Facebook login issue that i created for you to look at. I have added some details of investigation there but realized it is marked closed. Can you please have a look? Should i remove the details from there and repost here?
ashish-naik commentedon Apr 11, 2020
@dplewis did you get a chance to check? Although you asked me to open this issue in iOS SDK repo (which i did, linked above), i think this has to do with server.
I am stuck at this since many days. Really appreciate if you could take a look.
Today i tested on local server on my Mac with same config as Heroku ie
npm v 6.13.7
node v 9.4.0
parse server 4.2.0
it worked on local but didnt on Heroku. I noticed that this.storage['authprovider'] is undefined in createSessionTokenIfNeeded to createSessionToken() isnt called.
50 remaining items