Undefined array key "result"
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- PHP
- Star
- 808
- Fork
- 341
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của parse-community/parse-php-sdk
-
bounty:$20 type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
parse-community/parse-php-sdk#516 · 5 bình luận ·
-
"unauthorized: master key is required" error on aggregate ParseQuery despite the master key is setĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
parse-community/parse-php-sdk#466 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
parse-community/parse-php-sdk#465 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
parse-community/parse-php-sdk#457 · 1 bình luận ·
-
parse query for phpĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
parse-community/parse-php-sdk#456 · 1 bình luận ·
Tất cả issue của parse-community/parse-php-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Awaiting Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WordPress/two-factor#1008 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày