InvalidArgumentExceptionUrlBuilder must be passed a string domain
Getting this error after switching to Imgix from Glide in MEDIA_LIBRARY_IMAGE_SERVICE.
17 Replies
this error happens when you're using Imgix but missing
IMGIX_SOURCE_HOST
so I assume your configuration is cached and your app hasn't fully switched to GlideI've pushed on with setting up Imgix with S3 but not really getting anywhere in terms of the upload from Twill coming through to the dashboard etc. The source host is set and the path reflects that. If uploaded via Imgix the path displays properly in Twill. So just issues with uploading from Twill via Imgix into S3.
Uploads don't go through imgix, they go to S3 directly. Your S3 bucket needs to be configured to authorize post requests from your domain using cors configuration.
In theory this should be correct?
copy from a working setup:
did you allow your AWS IAM credentials provided to the Laravel app to upload to the bucket?
Yes have created user with the policy: AmazonS3FullAccess
that cors no change, checked on a live server and docker ddev environment
To follow up on this, seems like Images are coming from Imgix url but videos (files) are coming from local url with the AWS S3 env variables setup, I am able however to upload items using Laravel genuine functions without Twill with code like in screenshot so AWS connects it appears by elimination permissions should be fine.
You can't make this conclusion unfortunately because twill is doing direct uploads from the frontend, not from the Laravel app
so the request goes from your browser to S3, not from your server to S3
as for video file the default rendering service is rendering a raw url on the storage, so it's normal that you're getting an S3 url
Does it mean that when i have a frontend page setup and upload a file and then it goes through the controller it is not the same as Twill upload from frontend and operations somewhere in twill controllers pushes it out? Sorry im a bit confused
Twill upload doesnt go through a Laravel controller
The request is going to S3 directly, check your network tab
in your example above the file is sent to your Laravel app and then the Laravel app writes it on s3
Medium
Fine Uploader S3: Upload Directly to Amazon S3 from your Browser
There’s quite a bit of detail in this post, and I encourage you to read it all. If you require support in the future and it is clear that you have not taken the time to read this post, you will…
but you don't need to read and know all this, pasting for context and if you're curious. What error are you getting during the upload to S3?
This is the network tab image wise
so it apparently posts but the image never gets there so it cant get it back
None of those request is going to s3
There should be:
- 1 request to your app to get a signature
- 1 request to AWS to store the file
- 1 request to your app to store the upload metadata in db
Is it correct that its trying to get the data back off a imgix.net subdomain or should it be s3 url?
that depends on your image rendering service
If you're using imgix, you should get back an Imgix url (for images, not files)
If you're not using imgix, the url should be on your app domain