Problem/Motivation
I'm getting an API error when clearing the image style cache for the cfstream:// stream.
Drupal\cloudflare_stream\Service\CloudflareStreamApi (getDetails): API connection error. Error details are as follows:
Array
(
[0] => Array
(
[code] => 10003
[message] => Not Found: The requested resource or operation was not found.
)
)
-
The module uses WRITE_VISIBLE as the stream wrapper type:
https://git.drupalcode.org/project/cloudflare_stream/-/blob/3.0.0-beta2/...WRITE_VISIBLE is typically intended for local stream wrappers that are writable and readable. For remote-only streams, this doesn't seem appropriate and leads to unexpected behavior during cache flushes.
-
For comparison, the Remote Stream Wrapper module uses a more restrictive type:
https://git.drupalcode.org/project/remote_stream_wrapper/-/blob/2.1.1/sr...This value makes more sense for Cloudflare Stream, as it prevents write operations against local paths.
-
When we try to clear the image style caches for the cfstream:// stream, we send an incorrect Cloudflare Stream API request and receive an error.
Related core code:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/image...This results in a 10003: Not Found Cloudflare API error.
Steps to reproduce
- Install and configure the Cloudflare Stream module.
- Open the Image Styles page: /admin/config/media/image-styles.
- Click Flush for any image style.
- Check the Drupal logs.
Proposed resolution
Consider changing the stream wrapper type to match the behavior of Remote Stream Wrapper (or another read-only remote type), as this seems to prevent Drupal from assuming writable local resources during image style cache operations.
Please let me know what you think or if you need additional information.
Issue fork cloudflare_stream-3567573
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
furamag commentedComment #4
tim-dielsComment #5
tim-dielsThank you very much for the report and the fix!
Comment #7
tim-diels