Closed snehaa closed 2 years ago
@snehaa What settings do you have for "Use Microsoft Azure Storage for all media uploads on this site." and "Keep local files after uploading them to Azure Storage."?
Does your production environment have multiple servers/nodes, if so do they share a mounted filesystem?
These are my settings
Does your production environment have multiple servers/nodes, if so do they share a mounted filesystem? Yes it is a multi server/node environment, we do not have a common mounted filesystem. Ideally I do not want to store any images on nodes and only use Azure storage.
Source image must be on local server initially for the thumbnails/crops to be generated by wp_generate_attachment_metadata before they are offloaded and files are then deleted. This can be a multi-thread process across your nodes. Without a shared filesystem, it maybe trying to offload and image which may not be on current node.
Hi @rickalee Thanks for the quick response, so basically we need to have a shared filesystem between servers, and wp-uploads should be added to the shared filesystem for the upload to work properly?
@snehaa Correct. A mounted shared drive between servers that includes wp-content/uploads/*
So it's possible to mount a shared drive on an Azure app service? Or do you use an IaaS setup? Best regards.
You could do something similar to this.
https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux
Hi, Everything was working fine on my local machine installation, once I moved to hosted servers, started seeing some issues.
Started seeing error
Microsoft Azure Storage requires direct filesystem access in order to work.
as references in issue 83 and no uploads were working, Had to add following config in wp-config for the error to disappear and uploads to workStarted getting this error in log
PHP Warning: array_flip() expects parameter 1 to be array, object given in /var/www/wp-content/plugins/windows-azure-storage/includes/class-windows-azure-rest-api-client.php on line 1172, referer: http://static.developer.stg.walmart.com/wp-admin/upload.php
As suggested in Issue 27 disabling/ deleting the plugin and reinstalling did not work and the error still persists.Plugin has started adding a random prefix and extension to the image file uploaded. eg: 5f3daf1699120-5f3daf1699122ico-forum@2x.png.png the file name was ico-forum@2x.png
I feel the 2nd and 3rd issues are related, but unable to debug, as I am new to php and wordpress.
Env variables: Wordpress: 5.3.0 Windows-azure-storage-plugin: 4.3.1 PHP: 7.2.33