API returns 500 "General Error" when trying to upload an image that is larger than the `chunk_size`
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 32/100
Piste de recherche
Commencez par ApiConfig::DEFAULT_CHUNK_SIZE et le flux d’upload dans UploadTrait.php, ApiClient.php et BaseApiClient.php, en particulier le traitement des réponses autour de BaseApiClient.php:417. Reproduisez un upload supérieur à 20 MB avec la taille de chunk par défaut, puis vérifiez que les uploads fragmentés se terminent sans General Error et restent conformes au comportement documenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- PHP
- Étoiles
- 402
- Forks
- 151
- Merge moyen
- 37 min
- PR mergées (30 j)
- 2
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
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 cloudinary/cloudinary_php
-
Update access mode method not available in SDKPeut-être à nouveau libre @aleksandar-cloudinary l’a pris il y a 1632 jours, et aucune pull request n’est ouverte. Ouverte
cloudinary/cloudinary_php#358 · 10 commentaires · 1 personne assignée ·
-
Noticeably reduced performance with version 2Peut-être à nouveau libre @const-cloudinary l’a pris il y a 2095 jours, et aucune pull request n’est ouverte. Ouverte
cloudinary/cloudinary_php#244 · 11 commentaires · 1 réaction · 1 personne assignée ·
Toutes les issues de cloudinary/cloudinary_php
Issues similaires
-
Old /download.php attachment links: redirect drops the subfolder, nginx.example.conf returns 404OuverteBug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Moins d'une heure Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
0. Needs triage 35-feedback bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
wpgenius/stackfolio#22 ·
-
Import-loop editor checks fail on non-English sites: selectors assume English wp-admin labelsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Automattic/static-site-importer#3024 ·
Les mainteneurs répondent en général sous 1 jour