Error retrieving credentials from the instance profile metadata service
Description
Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) (View: /var/www/html/vendor/area17/twill/views/layouts/dashboard.blade.php)
Steps to reproduce
- Install Laravel / Twill:
curl -s "https://laravel.build/example-app" | bash
cd example-app
./vendor/bin/sail up
sail composer require area17/twill:"^2.0"
sail artisan twill:install
- Login as admin
Expected result
Dashboard should open.
Actual result
Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) (View: /var/www/html/vendor/area17/twill/views/layouts/dashboard.blade.php)
Versions
Twill: 2.8.0-beta.2 Laravel: v9.5.1 PHP: 8.1.3 Database: MySQL 8.0.28-1.2.7-server
The issue above seems to be related to AWS and S3, even after swapping my media library to using the local storage the issue persists.
Turns out regardless of your media library configuration you will still need to set up AWS and S3, this fixed the issue for me.
The media library does not need aws nor s3 to work locally.
@joaocagnoni make sure you have at least this in your .env if working with local storage:
FILE_LIBRARY_ENDPOINT_TYPE=local
MEDIA_LIBRARY_ENDPOINT_TYPE=local
MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide
I tried that setup but was still receiving the error until I set Laravel’s aws configuration in the .env file.
Perhaps I missed the FILE_LIBRARY_ENDPOINT and had only set the media library endpoint… will try this tomorrow. Thanks for the information.
Thanks @haringsrob for the heads up with the FILE_LIBRARY_ENDPOINT_TYPE, that worked well... might be good to update the docs so that this is mentioned here https://twill.io/docs/getting-started/installation.html#setting-up-the-media-library
Thank you @haringsrob, it worked. I agree with @plexus77, the docs should be updated with this env variable as all other new users may be in the same situation.
This is all updated in the 3.x docs where this is the default now :). Will see if I can add it to current docs as well.
Hi… brand new user here. I was getting this error trying to set up Twill under Valet on my Mac. Adding MEDIA_LIBRARY_ENDPOINT_TYPE=local (etc.) to my .env file indeed solved the problem, and I do see now that the documentation mentions it.
But since I got stuck on the error message in the immediate prior section ("Accessing the admin console"), I didn't even bother to read on. It may be useful to add a prominent callout right there in the documentation indicating that a local setup is likely to get this error without making the necessary .env changes, or maybe even move that section below "Setting up the media library," to avoid confusion. (Thanks!)
Hi @room34, definitely. In Twill 3 (currently in beta), the local setup is the default to avoid this confusion on the first install.
The media library does not need aws nor s3 to work locally.
@joaocagnoni make sure you have at least this in your .env if working with local storage:
FILE_LIBRARY_ENDPOINT_TYPE=local MEDIA_LIBRARY_ENDPOINT_TYPE=local MEDIA_LIBRARY_IMAGE_SERVICE=A17\Twill\Services\MediaLibrary\Glide
This works for me !
Closing this issue. In Twill 3 the default is all local setup.