InvalidArgumentExceptionUrlBuilder must be passed a string domain

Getting this error after switching to Imgix from Glide in MEDIA_LIBRARY_IMAGE_SERVICE.
17 Replies
ifox
ifox3y ago
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 Glide
devtutorum
devtutorumOP3y ago
I'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.
ifox
ifox3y ago
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.
devtutorum
devtutorumOP3y ago
In theory this should be correct?
ifox
ifox3y ago
copy from a working setup:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"POST",
"PUT",
"DELETE",
"GET"
],
"AllowedOrigins": [
"https://<redacted-domain.tld>"
],
"ExposeHeaders": []
}
]
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"POST",
"PUT",
"DELETE",
"GET"
],
"AllowedOrigins": [
"https://<redacted-domain.tld>"
],
"ExposeHeaders": []
}
]
did you allow your AWS IAM credentials provided to the Laravel app to upload to the bucket?
devtutorum
devtutorumOP3y ago
Yes have created user with the policy: AmazonS3FullAccess that cors no change, checked on a live server and docker ddev environment
devtutorum
devtutorumOP3y ago
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.
ifox
ifox3y ago
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
devtutorum
devtutorumOP3y ago
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
ifox
ifox3y ago
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
ifox
ifox3y ago
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…
ifox
ifox3y ago
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?
devtutorum
devtutorumOP3y ago
This is the network tab image wise
devtutorum
devtutorumOP3y ago
so it apparently posts but the image never gets there so it cant get it back
ifox
ifox3y ago
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
devtutorum
devtutorumOP3y ago
Is it correct that its trying to get the data back off a imgix.net subdomain or should it be s3 url?
ifox
ifox3y ago
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
Want results from more Discord servers?
Add your server