Undefined array key "result"
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Start at Parse/ParseCloud.php line 39 and trace the response returned by ParseClient::_request for the reported ParseCloud::run calls. Reproduce with Parse PHP SDK 2.3.2, PHP 8.2, and Parse Server 7.0.0; done means the warning no longer occurs while failed requests still report their errors.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server and the Parse PHP SDK.
Issue Description
PHP throws the following warning whenever I use Parse server:
2024-06-04 17:49:24 NOTICE: PHP message: PHP Warning: Undefined array key "result" in /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php on line 39
It's not fatal, but I feel like it should be a pretty simple fix to avoid. Seems to be possibly related to #517.
Steps to reproduce
Simplified version of my code:
$httpClient = \Parse\ParseClient::getHttpClient();
$httpClient->setup();
$response = $httpClient->send($fileUrl);
\Parse\ParseCloud::run("coreSavingSourceData", ["sourceId" => $source->getObjectId()], true);
\Parse\ParseCloud::run("sendImportDataToParsers", [
"sourceId" => $source->getObjectId(),
"locationId" => $source->get("location")->getObjectId(),
...
], true);
foreach ($sourceData as $type => $parseObjects) {
foreach (array_chunk($parseObjects, BATCH) as $chunk) {
$source->fetch(true);
if (!$source->get("isUploadCancelled")) {
try {
\Parse\ParseObject::saveAll($chunk, true, BATCH);
} catch (\Parse\ParseAggregateException $e) {
$errors = array_map(fn($er) => $er["error"], $e->getErrors());
error_log(print_r($errors, true));
}
} else {
throw new \Error("Upload cancelled");
}
}
}
$source->set("dataoneCount", count($sourceData["dataone"]));
$source->set("datatwoCount", count($sourceData["datatwo"]));
$source->save(true);
Environment
Parse PHP SDK
- SDK version:
2.3.2 - PHP version:
8.2
Server
- Parse Server version:
7.0.0 - Operating system:
php:8.2-fpmDocker container - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local (Docker)
Database
- System (MongoDB or Postgres):
mongo:6Docker container - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Local (Docker)
Logs
2024-06-04 16:23:28 [04-Jun-2024 20:23:28] NOTICE: fpm is running, pid 8
2024-06-04 16:23:28 [04-Jun-2024 20:23:28] NOTICE: ready to handle connections
2024-06-04 17:41:42 NOTICE: PHP message: PHP Warning: Undefined array key "result" in /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php on line 39
2024-06-04 17:51:20 NOTICE: PHP message: PHP Fatal error: Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseObject.php(561): Parse\ParseClient::_request('GET', 'classes/Source/...', NULL, NULL, true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(285): Parse\ParseObject->fetch(true)
2024-06-04 17:51:20 #2 /code/src/Import/ciscoconfig.php(666): PROJECT\Import\baseImporter->saveDataInParse(Array)
2024-06-04 17:51:20 #3 /code/src/Import/baseImporter.php(56): PROJECT\Import\ciscoconfig->import()
2024-06-04 17:51:20 #4 /code/src/Controllers/ImportController.php(49): PROJECT\Import\baseImporter->__construct(Array, Object(Pimple\Container))
2024-06-04 17:51:20 #5 /code/index.php(29): PROJECT\Controllers\ImportController->processRequest()
2024-06-04 17:51:20 #6 {main}
2024-06-04 17:51:20 thrown in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php on line 610
2024-06-04 17:51:20 127.0.0.1 - 04/Jun/2024:21:41:41 +0000 "POST /index.php" 200
2024-06-04 17:51:20 NOTICE: PHP message: Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseObject.php(561): Parse\ParseClient::_request('GET', 'classes/Source/...', NULL, NULL, true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(285): Parse\ParseObject->fetch(true)
2024-06-04 17:51:20 #2 /code/src/Import/ciscoconfig.php(666): PROJECT\Import\baseImporter->saveDataInParse(Array)
2024-06-04 17:51:20 #3 /code/src/Import/baseImporter.php(56): PROJECT\Import\ciscoconfig->import()
2024-06-04 17:51:20 #4 /code/src/Controllers/ImportController.php(49): PROJECT\Import\baseImporter->__construct(Array, Object(Pimple\Container))
2024-06-04 17:51:20 #5 /code/index.php(29): PROJECT\Controllers\ImportController->processRequest()
2024-06-04 17:51:20 #6 {main}
2024-06-04 17:51:20 thrown
2024-06-04 17:51:20 NOTICE: PHP message: PHP Fatal error: Uncaught Parse\ParseException: Object not found. in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php:610
2024-06-04 17:51:20 Stack trace:
2024-06-04 17:51:20 #0 /code/vendor/parse/php-sdk/src/Parse/ParseCloud.php(31): Parse\ParseClient::_request('POST', 'functions/impor...', NULL, '{"sourceId":"Ue...', true)
2024-06-04 17:51:20 #1 /code/src/Import/baseImporter.php(314): Parse\ParseCloud::run('importFailed', Array, true)
2024-06-04 17:51:20 #2 [internal function]: PROJECT\Import\baseImporter->triggerFailedImport('Ue4GHlTWVm')
2024-06-04 17:51:20 #3 {main}
2024-06-04 17:51:20 thrown in /code/vendor/parse/php-sdk/src/Parse/ParseClient.php on line 610
- Langage dominant
- PHP
- Étoiles
- 808
- Forks
- 341
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de parse-community/parse-php-sdk
-
bounty:$20 type:bug
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
parse-community/parse-php-sdk#516 · 5 commentaires · 1 réaction ·
-
"unauthorized: master key is required" error on aggregate ParseQuery despite the master key is setOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
parse-community/parse-php-sdk#466 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
parse-community/parse-php-sdk#465 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
parse-community/parse-php-sdk#457 · 1 commentaire ·
-
parse query for phpOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
parse-community/parse-php-sdk#456 · 1 commentaire ·
Toutes les issues de parse-community/parse-php-sdk
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
domain/crm-after-sales Platform(Default) priority/high
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
kind/bug status/to verify
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
PHP-CS-Fixer/PHP-CS-Fixer#9867 ·
Les mainteneurs répondent en général sous 1 jour
-
sync-en
Difficulté 1/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 2 jours
-
sync-en
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 2 jours