Skip to content

Generating an asset in a private container programmatically on a regular queue worker requires a cache clear #14576

@robdekort

Description

@robdekort

Bug description

I've found something interesting that I can't wrap my head around and I suspect might be an issue somewhere.

  • I have a site running Redis and a regular queue worker.
  • I can generate social images on a queue from my SEO addon. This works fine, after generating they appear in the asset container (public).
  • I can generate PDF reports from a feature I added to this site specifically, also on a queue. Works, but after generating they don't appear in the asset container (private).
  • I have to clear the cache in order to see the generated assets.
  • Both jobs have no cache clear command in them, they use $container->makeAsset()->save() to generate the asset, which should handle caching a.f.a.i.k.
  • When I run without Redis (sync) or when I use Horizon, I don't need to clear the cache in order to see the file appear.
  • When I use a public container instead of a private one, I also don't need to clear the cache in order to see the file appear.

How to reproduce

A lots of steps. Happy to share the repo or demo the behavior.

Environment

Environment
Laravel Version: 13.6.0
PHP Version: 8.4.20
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Livewire
Livewire: v4.2.4

Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.15.0 PRO

Statamic Addons
marcorieser/statamic-livewire: 5.3.1
studio1902/statamic-peak-commands: 10.6.0
studio1902/statamic-peak-seo: 11.2.0
studio1902/statamic-peak-tools: 9.0.3

Installation

Starter Kit using via CLI

Additional details

With this filesystem it doesn't work:

'reports' => [
    'driver' => 'local',
    'root' => storage_path('reports'),
    'visibility' => 'private',
    'serve' => false,
    'throw' => false,
    'report' => false,
],

With this, it does:

'reports' => [
    'driver' => 'local',
    'root' => public_path('reports'),
    'url' => '/reports',
    'visibility' => 'public',
    'throw' => false,
    'report' => false,
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions