API returns 500 "General Error" when trying to upload an image that is larger than the `chunk_size`
還沒有人認領這個 Issue。
評估
研究方向
從 ApiConfig::DEFAULT_CHUNK_SIZE 以及 UploadTrait.php、ApiClient.php 和 BaseApiClient.php 中的上傳流程著手,尤其關注 BaseApiClient.php:417 附近的回應處理。使用預設 chunk 大小重現一次大於 20 MB 的上傳,然後驗證分塊上傳能夠在沒有 General Error 的情況下完成,並且與文件所描述的行為保持一致。
由索引模型根據 Issue 內容生成。
描述
I noticed, that the API returned a "General Error" when I tried to upload an image that is larger than 20 MB.
After some research I found a matching issue in the cloudinary_android-Repo: https://github.com/cloudinary/cloudinary_android/issues/148.
After reading the docs (https://cloudinary.com/documentation/upload_images#chunked_asset_upload), I set the chunk_size to a value that is larger than 20 MB (e. g. 30000000) when calling the upload-function.
That fixed my problem. However, the Chunked asset upload feature doesn't seem to work.
Issue Type (Can be multiple)
- Behaviour - Functions aren’t working as expected (such as generate URL)
- Documentation - Inconsistency between the docs and behaviour
Steps to reproduce
Try to upload a file larger than 20 MB (or the \Cloudinary\Configuration\ApiConfig::DEFAULT_CHUNK_SIZE respectively).
Error screenshots or Stack Trace (if applicable)
Message: "Cloudinary\Api\Exception\GeneralError: General Error in .../vendor/cloudinary/cloudinary_php/src/Api/BaseApiClient.php:417
Stack trace:
#0 .../vendor/cloudinary/cloudinary_php/src/Api/BaseApiClient.php(337): Cloudinary\Api\BaseApiClient->handleApiResponse(Object(GuzzleHttp\Psr7\Response))
#1 .../vendor/guzzlehttp/promises/src/Promise.php(209): Cloudinary\Api\BaseApiClient->Cloudinary\Api{closure}(Object(GuzzleHttp\Psr7\Response))
#2 .../vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 .../vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#4 .../vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(159): GuzzleHttp\Promise\TaskQueue->run()
#5 .../vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(185): GuzzleHttp\Handler\CurlMultiHandler->tick()
#6 .../vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#7 .../vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#8 .../vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#9 .../vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#10 .../vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#11 .../vendor/cloudinary/cloudinary_php/src/Api/ApiClient.php(348): GuzzleHttp\Promise\Promise->wait()
#12 .../vendor/cloudinary/cloudinary_php/src/Api/ApiClient.php(282): Cloudinary\Api\ApiClient->postLargeFileAsync('image/upload', Object(GuzzleHttp\Psr7\Stream), Array, Array)
#13 .../vendor/cloudinary/cloudinary_php/src/Api/Upload/UploadTrait.php(138): Cloudinary\Api\ApiClient->postFileAsync('image/upload', 'data:image/jpeg...', Array, Array)
#14 .../vendor/cloudinary/cloudinary_php/src/Api/Upload/UploadTrait.php(162): Cloudinary\Api\Upload\UploadApi->uploadAsync('data:image/jpeg...', Array)
#15 ...: Cloudinary\Api\Upload\UploadApi->upload('data:image/jpeg...', Array)
Operating System
- Linux
Environment and Frameworks (fill in the version numbers)
- PHP Cloudinary SDK version - 2.14.0
- PHP Version - 8.2.25
- Framework (Laravel, Symphony, etc) - 6.2.10
- 主要語言
- PHP
- 星號
- 402
- 分支
- 151
- 平均合併
- 37 分鐘
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cloudinary/cloudinary_php 的其他 Issue
-
Update access mode method not available in SDK可能重新可做 @aleksandar-cloudinary 於 1632 天前認領,目前沒有進行中的 PR。 未關閉
cloudinary/cloudinary_php#358 · 10 則留言 · 已指派 1 人 ·
-
Noticeably reduced performance with version 2可能重新可做 @const-cloudinary 於 2095 天前認領,目前沒有進行中的 PR。 未關閉
cloudinary/cloudinary_php#244 · 11 則留言 · 1 個 reaction · 已指派 1 人 ·
查看 cloudinary/cloudinary_php 的全部 Issue
相似的 Issue
-
Old /download.php attachment links: redirect drops the subfolder, nginx.example.conf returns 404未關閉Bug
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1 小時以內 新手友好度 82/100
維護者通常 1 天內回覆
-
0. Needs triage 35-feedback bug
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 72/100
wpgenius/stackfolio#22 ·
-
難度 2/5 1-3 小時 新手友好度 62/100
Automattic/static-site-importer#3024 ·
維護者通常 1 天內回覆