cms
cms copied to clipboard
GCP bucket upload image failed
Bug description
I am trying to use GCP Bucket to connect to my asset. I was able to implement it, Currently it able to Upload folder, Delete Folder and Delete Pictures but It not uploading picture, When I tried to Upload the image it says it uploaded but it never upload to my gcs bucket or control panel. The preview URI is also Error Not Found When I try uploading which a local driver it works out but not with GCS Buckets.
How to reproduce
When I tried to Upload the image it says it uploaded but it never upload to my gcs bucket or control panel. The preview URI is also Error Not Found When I try uploading which a local driver it works out but not with GCS Buckets.
Here is my filesystem setup I tried with and without the storage api uri
This is my Image.yaml
Logs
No response
Environment
Environment
Application Name: Laravel
Laravel Version: 9.52.16
PHP Version: 8.3.0
Composer Version: 2.6.6
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: pgsql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 0
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.42.1 PRO
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response
Like I mentioned in discord, does it work if you try S3 or Digital Ocean's Spaces?
We only use GCP for storage - does this mean that 1) it only works with S3 or Digital Ocean Spaces or 2) Just has not been verified and tested to work on GCP? Some clarity would be helpful if possible.
I tested on S3 it worked
Right, so Statamic uses Laravel's filesystem stuff for this and since it works for S3 (and I know it works for DO Spaces because we use that), then it's something about your GCS configuration that is causing an issue.
I was able to Fixed that issue it now uploaded to asset but the preview image cant be loaded it the img src is from thumbnail but my asset is store in GCS is there a way to make the src directly connected from cloud storage?
Right now only SVG uses cloud storage when previewing other types are not
Sounds like a permission issue on your bucket, those images need to be public
Everything thing is public, the gcs config and my bucket image
Anything in your Laravel log file?
No, Laravel log file is fine
It the thumbnail is not being created created it keep showing broken image is there a way to replace that thumbnail with other url?
Everything thing is public, the gcs config and my bucket image
if the images were uploaded BEFORE the bucket was made public (I've made this mistake before), the images will still be private. Can you view the images from their url in a private browser?
Everything thing is public, the gcs config and my bucket image
if the images were uploaded BEFORE the bucket was made public (I've made this mistake before), the images will still be private. Can you view the images from their url in a private browser?
I tried to open and incognito mode the image opens up for example https://storage.googleapis.com/statamic/image-1-1705428337.jpg but it still showing broken image for thumbnail
Is there a possible way for me to set thumbnail to storage cloud? because I see for my SVG file the thumbnail to set to storage cloud
but my other file type are not
I think I mess up all the thumbnails up I try to look at local disk for asset those images were not showing too, Anyway to fix thumbnails?
@slin1233 Are you still running into issues with the thumbnails? Can you try running php please glide:clear to see if that helps with the thumbnails?
I'm going to close this issue now. The last activity is from mid-January & it's more of a discussion (we only use issues for bugs).
If you need any further help, please open a GitHub Discussion, thanks!