- Issue created by @pablovos
- π¨π¦Canada liquidcms
Removed the D10 from the title as i am getting this issue with D9.5.
I am trying to set up S3FS storage to use for private files. It seemed to be almost working except trying to read the uploaded file and i get a WSOD with the error posted here. The top of the stack trace appears to be related to S3Fs; but further down i see related to imce. Which is not related to anything i am doing as imce is not involved (this is simply a file field). But, if i try to disable IMCE the site crashes:
drush pmu imce: Base route not available for route entity.imce_profile.edit_form
and on the site:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "imce_profile" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
- πΊπΈUnited States cmlara
Quoting myself from π¬ Can't get S3FS installed correctly Fixed
S3fs does 'relative path resolution' converting "private://." to "private://" because this is what a normal filesystem when working with paths. Drupal Core is a bit 'dumb' in this regard as it doesn't currently do this, though I belive this is something that may be re-considered in the future.
Before sa-core-2023-005 it may have been arguable that S3FS module should not be resolving "scheme://." to "scheme://" however after sa-core-2023-005 public disclosure I believe it indicates we are correct in resolving the path to reduce long term risk.
With that said even the method of changing to "scheme://.a_file_name.txt" would be a 'hack' in my opinion and IMCE really should not be depending upon the root scheme:// to determine URL's. The fact that URL resolution is a part of the hook_file_download() is another indicator raising the question is the imce_hook_file_download() possibly open to de-coupling.
I suspect the fact IMCE does "scheme://." is because they have already encountered this fault at one time in the past or during initial development trying to do "private://" where Drupal Core itself threw the same exception.
IMCE did work on this partly in https://www.drupal.org/project/imce/issues/3320228 β however they ended up doing so only for the browser not the IMCE class, though its the same root portion of code that was initially called out as being of concern.
- Status changed to Fixed
over 1 year ago 9:38pm 4 August 2023 Committed a patch to 3.x that uses a normal path to detect the root url.
Automatically closed - issue fixed for 2 weeks with no activity.