Undefined array key "result"
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- PHP
- Sterne
- 808
- Forks
- 341
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus parse-community/parse-php-sdk
-
bounty:$20 type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
parse-community/parse-php-sdk#516 · 5 Kommentare · 1 Reaktion ·
-
"unauthorized: master key is required" error on aggregate ParseQuery despite the master key is setOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
parse-community/parse-php-sdk#466 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
parse-community/parse-php-sdk#465 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
parse-community/parse-php-sdk#457 · 1 Kommentar ·
-
parse query for phpOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
parse-community/parse-php-sdk#456 · 1 Kommentar ·
Alle Issues in parse-community/parse-php-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Awaiting Triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
WordPress/two-factor#1008 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag