Hello,
I’ve a problem using Digital Ocean and spaces on Laravel 10. I filled my .env like this:
DO_SPACES_KEY=*************
DO_SPACES_SECRET=********************
DO_SPACES_ENDPOINT=fra1.digitaloceanspaces.com
DO_SPACES_REGION=FRA1
DO_SPACES_BUCKET=****************
All the keys are working because my colleagues are using the same as me, and we even tried to generate new one.
My config/filesystems.php :
'spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
],
I got this error:
Disk named spaces
cannot be accessed
Do you have an idea how can I fix it please ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey @enr9! 👋
The error
"Disk named spaces cannot be accessed"
could be caused by a couple of different issues.Your
config/filesystems.php
configuration looks good, but make sure that the'spaces'
disk is set as the default or explicitly used in your code. Check yourconfig/filesystems.php
file for the default disk setting:If you’re not using
'spaces'
as the default, make sure you are specifying the'spaces'
disk when working with files in your code:On another note, double-check your bucket name in your
.env
file:It should exactly match the name of your Spaces bucket in DigitalOcean. Sometimes, small typos or extra spaces can cause issues.
For
DO_SPACES_ENDPOINT
, it’s best to use the HTTPS endpoint to ensure secure connections:If you don’t have the
https://
prefix it might cause weird problems.Also sometimes, changes to the
.env
file or configuration files might not take effect due to caching. Clear your configuration cache using:Let me know if the problem persists!
- Bobby