Skip to content
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

"unauthorized: master key is required" error on aggregate ParseQuery despite the master key is set #466

Open
dueldanov opened this issue Sep 4, 2020 · 0 comments

Comments

@dueldanov
Copy link

Issue Description

I get "unauthorized: master key is required" error when I try to do aggregate ParseQuery as below.

ParseClient::initialize('appId', null, 'masterKey');
ParseClient::setServerURL('https://example.com', 'mountPath');

$pipeline = [
    'group' => [
        'userAttached' => $userId,
        'total' => [ '$sum' => 1]
    ]
];

$query = new ParseQuery("Financials");
$query->equalTo("company_id", $companyId);
$query->equalTo("type", "income");

try {
    $resultSum = $query->aggregate($pipeline);
    print_r($resultSum);
} catch (ParseException $ex) {
    echo $ex->getMessage();
}

As you can see master key is already set, can't find what may be the issue.

Environment Details

  • Your PHP Version: 7.2.24-0ubuntu0.18.04.6
  • Your Parse PHP SDK Version: 1.5.1
  • Your Operating System: Ubuntu 18.04.2 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant