- Newest
- Most votes
- Most comments
This issue appears to be related to session state and load balancing in your multi-replica EKS deployment. When you have multiple replicas running Laravel Filament, the signed URL generation and subsequent download request may be handled by different pods, causing the 404 error.
Even though you've enabled stickiness at the ALB level, there are a few potential issues:
-
Stickiness limitations: ALB stickiness takes precedence over weighted routing, but it doesn't automatically redirect traffic when a target becomes unavailable. If the pod that generated the signed URL is different from the one handling the download request, this can cause the 404 error.
-
Session storage: Laravel's default session storage is file-based, which isn't shared between pods. When running multiple replicas, each pod has its own session storage, so session data (including information about generated signed URLs) isn't available across all pods.
To resolve this issue, consider these approaches:
-
Use a shared session driver: Configure Laravel to use Redis or database sessions instead of file sessions to ensure session data is shared across all pods.
-
Implement a centralized storage for temporary files: Store the generated export files in a shared location like Amazon S3 instead of local storage.
-
Adjust stickiness settings: You could reduce the stickiness duration to a shorter period, though this might not fully resolve the issue.
-
Implement application-level handling: Modify your application to handle connection failures or implement a retry mechanism.
The fact that it works with a single replica but fails with multiple replicas strongly suggests this is a session state or file storage issue rather than a network connectivity problem.
Sources
ALB to automatically redirect traffic | AWS re:Post
answered 9 months ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago

The SESSION_DRIVER=database in the Laravel application.