jakeFeldman / strapi-provider-upload-azure-storage

Strapi Provider Upload Azure Storage
MIT License
75 stars 42 forks source link

Version bump #53

Closed PboAtawiz closed 2 years ago

PboAtawiz commented 2 years ago

ok

phripley commented 2 years ago

@PboAtawiz I'm just trying to follow along here as someone using strapi + azure storage. What's is going on with this? Not able to follow this conversation at all. Was something deleted?

phripley commented 2 years ago

@PboAtawiz I'm guessing it's related to this:

https://github.com/jakeFeldman/strapi-provider-upload-azure-storage/issues/52

jakeFeldman commented 2 years ago

Doesn't look there was any conversation regarding this PR. If someone has the bandwidth to upgrade azure storage that would be great!

PboAtawiz commented 2 years ago

Hi, sorry about the notification. It's been a while since I used GitHub. I meant to make a PR on my own fork but VScode redirected me to your repo and I didn't check carefully. Anyway yes I'm having trouble with azure storage and I can't upload files anymore.

phripley commented 2 years ago

@PboAtawiz it's still working for me on latest version of Strapi 3.

Do you want to post the redacted version of your plugins.js file along with error and environment details?

I'm thinking this should be as a new issue, not as part of this pull request.

PboAtawiz commented 2 years ago

Hi @phripley, thanks for the attention your are willing to put into my issue. To give some context, it happened overnight, I don't know exactly when because when possible I like to use already uploaded images. but it can't be more than a few weeks. I Have been able to reproduce this error with a fresh v3 strapi app and a fresh v4 strapi app Here is my plugins.js : module.exports = ({ env }) => ({ upload: { provider: "azure-storage", providerOptions: { account: env("AZ_STORAGE_NAME"), accountKey: env("AZ_STORAGE_KEY"), serviceBaseURL: env("AZ_STORAGE_BASE_URL"), containerName: env("AZ_STORAGE_CONTAINER_NAME"), defaultPath: "assets", maxConcurrent: 10, }, }, }); Here is the error : error Error: <!DOCTYPE html><html><head><title>UnsupportedHttpVerb</title></head><body><h1>The resource doesn't support specified Http Verb.</h1><p><ul><li>HttpStatusCode: 405</li><li>ErrorCode: UnsupportedHttpVerb</li><li>RequestId : 2d45649e-801e-002d-4154-dae150000000</li><li>TimeStamp : 2022-10-07T13:52:33.3654136Z</li></ul></p></body></html> at new RestError (C:\Atawiz\Site_Vitrine\website-cms\node_modules\@azure\ms-rest-js\dist\msRest.node.js:2480:28) at C:\Atawiz\Site_Vitrine\website-cms\node_modules\@azure\ms-rest-js\dist\msRest.node.js:3687:37 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:95:5) [2022-10-07T13:52:31.496Z] error Error: Internal Server Error at convertToStrapiError (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\errors.js:38:26) at Object.upload (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\config\functions\bootstrap.js:35:11) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Object.uploadFileAndPersist (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\services\Upload.js:154:5) at async Promise.all (index 0) at async Object.upload (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\services\Upload.js:140:12) at async uploadFiles (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\controllers\upload\admin.js:187:27) at async Object.upload (C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-plugin-upload\controllers\Upload.js:65:5) at async C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi\lib\middlewares\router\utils\routerChecker.js:79:22 at async C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi-utils\lib\policy.js:68:5 at async C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi\lib\middlewares\parser\index.js:48:23 at async C:\Atawiz\Site_Vitrine\website-cms\node_modules\strapi\lib\middlewares\xss\index.js:26:9 [2022-10-07T13:52:31.497Z] debug POST /upload (404 ms) 500

The strapi app is deployed in a Linux environment in an Azure Vitural MAchine and the error also happens when I launch Strapi locally on my windows environment.

I hope I was understandable, English is not my first language.

phripley commented 2 years ago

@PboAtawiz first thing I would check would be if there are any issues with Azure Storage or Front Door/CDN in your region: https://status.azure.com/

Uploads were broken for about 12 hours for us a few weeks ago. That status page was reporting that there were issues with FrontDoor at that time... we don't use FrontDoor but apparently when FrontDoor is down so is CDN.

For us it was working in our locals but not in Azure. We had a real firedrill on our hands trying to figure out what was wrong with our code/configs when the issue was really in Azure!

Also, are you able to write to storage outside of Strapi?

phripley commented 2 years ago

@PboAtawiz Another thought, tho I don't think this could be the issue based on the error is that you have a lot of commas in your config that don't seem to belong. Isn't it the case that you should not have a comma after the last element?

10, }, }, });

vs

10}}});

PboAtawiz commented 2 years ago

Thank you for the advice. As for the commas it's just a styling thing, no impact