-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
'unauthorized' error using 2.0.8 #407
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
what's version of your mongo server? |
I use heroku mongolab addon with sandbox plan : http://docs.mongolab.com/ops/#version-mgmt |
Have you tried initialising Parse with the JS key? |
Hm. You shouldn't have to use a JS key, as long as you don't create your parse server instance with one as option. Check your DB and look at the documents in your Schema collection. Is there anything strange under metadata.find property? |
Where is this code running (cloud code or a separate node script) ? Was Parse initialized, was the serverURL set? If it's in cloud code, you should remove the require on Parse, as it is already a global. |
I have the same problem. And it is solved (at least for me) by including This is indicated here https://github.com/ParsePlatform/parse-server in the last paragraph under *Not Supported *
But as far as i know this is not a solution at all. Since some Queries do not require the use of MasterKey. Also, i was not able to Fetch the user even with a master key. The only way to retrieve the User was to query Parse.User with an ObjectId constraint. |
@davodesign84 no js key my Parse server config : //# app.js
// express@4.13.4
ParseServer = require('parse-server').ParseServer;
app.use(PARSE_MOUNT, new ParseServer({ // mount on '/1'
databaseURI: DATABASE_URI,
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: 'id',
masterKey: 'mkey'
})); I ran these in node server , not parse cloud. //# app.js
// this is my initialization
Parse = require ('parse/node');
Parse.initialize("id","");
Parse.serverURL = PARSE_SERVER_URL;
// do request and then get unauthorized when query.
Parse = require ('parse/node'); // parse js sdk @1.6.14
var obj = new Parse.Object('GameScore');
obj.set('score',1337);
obj.save().then(function(obj) {
console.log(obj.toJSON());
var query = new Parse.Query('GameScore');
query.get(obj.id).then(function(objAgain) {
console.log(objAgain.toJSON());
}, function(err) {console.log(err); });
}, function(err) { console.log(err); }); Another thing. I don't know is this related.
The request went to '/' to do requests. |
the following info maybe useful but strange too :
there should be two router log showing two request reaches |
@RadianSmile i have a question about using parse server version How did you update to the latest build 2.0.8 ? It was pointed out to me to change the version here: |
@polo2244 It seems that you mistaken project version as module version. You should look at You should read the package.json as:
|
@RadianSmile there should be a "table/collection" in MongoLab's data browser called schema. You'll find objects representing your other classes you produced. Basically you can set class permissions and such there including query permissions. Dig around a little and make sure you don't have anything weird in there. If you have a new app, with all class permissions open it'll basically be a bunch of empty objects. From the rest of this thread it seems this is probably not the culprit but check just to be sure. If something is funny there it will probably pop out at you. |
@RadianSmile What |
Make sure you use latest version of parse sdk. |
I am performing this but its not working
It prints the console log but it fails to change the object which have been triggered this afterSave(). Help needed ASAP. |
You should not save the same object as triggered the aftersave as that will create an infinite loop. You main problem is that the firat parameter in the save method is attributes, not options. Use |
"null" added but still not working. Its giving this error: it gives error status=201 |
I haven't tried but I would imagine that saving the same object that triggered the afterSave (as you do above) would create an infinite loop. If you need to add something to an object, do it in beforeSave instead. |
But I used to do change the same object in the afterSave in my previous parse cloud. But right now the parse server is running in heroku and its creating this problem. |
@RadianSmile Do you still get the unauthorized error with version 2.1.3? |
@mahabubakram If you're having an issue with the latest version, please open your own issue and provide as much detail as possible, including code. Thanks. |
@simonbengtsson I am currently not able to test it. I would try latest version recently and tell if any problems. Thanks! |
Hi all, I'm having the same issue. I'm set up and this curl returns all my users:
But this query gets
|
I keep getting this |
I run
Parse server @2.0.8
then happened a strange thing :
I ran the sample code in node :
then my server log showed :
that means it could create object , but not able to query.
that's so wired. So I test it with
parse-server@2.0.0
then this code runs smoothly :
Please check! Thanks.
The text was updated successfully, but these errors were encountered: