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.
        )
)
  1. 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.

  2. 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.

  3. 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

  1. Install and configure the Cloudflare Stream module.
  2. Open the Image Styles page: /admin/config/media/image-styles.
  3. Click Flush for any image style.
  4. 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.

Command icon 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

furamag created an issue. See original summary.

furamag’s picture

Status: Active » Needs review
tim-diels’s picture

Assigned: furamag » Unassigned
tim-diels’s picture

Status: Needs review » Reviewed & tested by the community

Thank you very much for the report and the fix!

  • tim-diels committed c61f08ab on 3.0.x authored by furamag
    fix: #3567573 Incorrect Stream Wrapper type causes Image Style flush...
tim-diels’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.