twill icon indicating copy to clipboard operation
twill copied to clipboard

Error retrieving credentials from the instance profile metadata service

Open joao-jlcm opened this issue 4 years ago • 6 comments

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

  1. 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
  1. 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

joao-jlcm avatar Mar 19 '22 02:03 joao-jlcm

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.

plexus77 avatar Mar 21 '22 06:03 plexus77

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

haringsrob avatar Mar 21 '22 07:03 haringsrob

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.

plexus77 avatar Mar 21 '22 07:03 plexus77

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

plexus77 avatar Mar 22 '22 00:03 plexus77

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.

joao-jlcm avatar Mar 22 '22 02:03 joao-jlcm

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.

haringsrob avatar Mar 22 '22 06:03 haringsrob

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!)

room34 avatar Dec 01 '22 20:12 room34

Hi @room34, definitely. In Twill 3 (currently in beta), the local setup is the default to avoid this confusion on the first install.

ifox avatar Dec 01 '22 20:12 ifox

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 !

MarienMupenda avatar Jan 11 '23 11:01 MarienMupenda

Closing this issue. In Twill 3 the default is all local setup.

haringsrob avatar Jan 11 '23 13:01 haringsrob