An internal server error occurs when executing a GraphQL query to retrieve data for a specific page. The error is related to the image validation process for an SVG image. The error is traced back to the Statamic\Imaging\ImageGenerator::validateImage() function.
How to reproduce
GraphQL Query:
query Page {
entry(collection: "pages", site: "english", slug: "about-us") {
... on Entry_Pages_Default {
title
slug
url
website_components {
... on Set_WebsiteComponents_TopBanner {
type
banner_link_title
banner_link_is_external
banner_link_url
banner_text_title
banner_text_description
banner_media_image {
responsive {
label
asset {
permalink
url
}
}
}
}
... on Set_WebsiteComponents_AboutCompanySection {
type
about_company_link_is_external
about_company_link_title
about_company_link_url
about_company_text_description
about_company_text_title
}
... on Set_WebsiteComponents_CompanyMessage {
our_message_title
our_message_description
id
type
our_message_image {
responsive {
label
asset {
permalink
url
}
}
}
}
... on Set_WebsiteComponents_CompanyVision {
our_message_title
our_message_description
id
type
our_message_image {
responsive {
label
asset {
permalink
url
}
}
}
}
... on Set_WebsiteComponents_CompanyGoalsSection {
our_goals_title
all_goals {
... on Set_WebsiteComponents_AllGoals_NewGoal {
goal_title
goal_description
id
type
goal_image {
responsive {
label
minWidth
widthUnit
ratio
placeholder
}
}
}
}
id
type
}
}
seo_title
seo_keywords
seo_image {
url
permalink
}
seo_description
}
}
}
Execute the provided GraphQL query to fetch the data for the specified page.
Observe the response and note the internal server error.
Review the debug message indicating an issue with the SVG image validation.
Error Details:
Debug Message: Image [uploads/pages/about-us/value-1.svg] does not actually appear to be a valid image.
Message: Internal server error
Error Category: Internal
Logs
- Statamic\\Imaging\\ImageGenerator::validateImage() at /vendor/statamic/cms/src/Imaging/ImageGenerator.php:255
- Statamic\\Imaging\\ImageGenerator::generate() at /vendor/statamic/cms/src/Imaging/ImageGenerator.php:167
- Statamic\\Imaging\\ImageGenerator::doGenerateByAsset() at /vendor/statamic/cms/src/Imaging/ImageGenerator.php:150
- Illuminate\\Cache\\Repository::rememberForever() at /vendor/laravel/framework/src/Illuminate/Cache/Repository.php:437
- Statamic\\Imaging\\ImageGenerator::generateByAsset() at /vendor/statamic/cms/src/Imaging/ImageGenerator.php:148
- Spatie\\ResponsiveImages\\Breakpoint::Spatie\\ResponsiveImages\\{closure}() at /vendor/spatie/statamic-responsive-images/src/Breakpoint.php:268
- Spatie\\Blink\\Blink::once() at /vendor/spatie/blink/src/Blink.php:306
- Statamic\\Support\\Blink::__call() at /vendor/statamic/cms/src/Support/Blink.php:18
- Illuminate\\Support\\Facades\\Facade::__callStatic() at /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:355
- Spatie\\ResponsiveImages\\Breakpoint::placeholder() at /vendor/spatie/statamic-responsive-images/src/Breakpoint.php:255
- Spatie\\ResponsiveImages\\Breakpoint::placeholderSrc() at /vendor/spatie/statamic-responsive-images/src/Breakpoint.php:289
- Spatie\\ResponsiveImages\\Source::Spatie\\ResponsiveImages\\{closure}() at /vendor/spatie/statamic-responsive-images/src/Source.php:69
- Illuminate\\Support\\Collection::when() at /vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php:34
- Spatie\\ResponsiveImages\\Source::getSrcSet() at /vendor/spatie/statamic-responsive-images/src/Source.php:68
- Spatie\\ResponsiveImages\\Source::toArray() at /vendor/spatie/statamic-responsive-images/src/Source.php:134
- Spatie\\ResponsiveImages\\Breakpoint::toGql() at /vendor/spatie/statamic-responsive-images/src/Source.php:123
- Spatie\\ResponsiveImages\\Breakpoint::Spatie\\ResponsiveImages\\{closure}() at /vendor/spatie/statamic-responsive-images/src/Breakpoint.php:232
- array_map() at /vendor/laravel/framework/src/Illuminate/Collections/Arr.php:600
- Illuminate\\Support\\Arr::map() at /vendor/laravel/framework/src/Illuminate/Collections/Collection.php:777
- Illuminate\\Support\\Collection::map() at /vendor/spatie/statamic-responsive-images/src/Breakpoint.php:231
- Spatie\\ResponsiveImages\\GraphQL\\ResponsiveField::Spatie\\ResponsiveImages\\GraphQL\\{closure}() at /vendor/spatie/statamic-responsive-images/src/GraphQL/ResponsiveField.php:49
- array_map() at /vendor/laravel/framework/src/Illuminate/Collections/Arr.php:600
- Illuminate\\Support\\Arr::map() at /vendor/laravel/framework/src/Illuminate/Collections/Collection.php:777
- Illuminate\\Support\\Collection::map() at /vendor/spatie/statamic-responsive-images/src/GraphQL/ResponsiveField.php:48
- Rebing\\GraphQL\\Support\\Field::Rebing\\GraphQL\\Support\\{closure}() at /vendor/rebing/graphql-laravel/src/Support/Field.php:251
- Rebing\\GraphQL\\Support\\Field::Rebing\\GraphQL\\Support\\{closure}() at /vendor/rebing/graphql-laravel/src/Support/Field.php:164
- Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}() at /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144
- Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}() at /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119
- Rebing\\GraphQL\\Support\\Field::Rebing\\GraphQL\\Support\\{closure}() at /vendor/rebing/graphql-laravel/src/Support/Field.php:163
- GraphQL\\Executor\\ReferenceExecutor::resolveFieldValueOrError() at /vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php:623
Bug description
An internal server error occurs when executing a GraphQL query to retrieve data for a specific page. The error is related to the image validation process for an SVG image. The error is traced back to the Statamic\Imaging\ImageGenerator::validateImage() function.
How to reproduce
GraphQL Query:
query Page { entry(collection: "pages", site: "english", slug: "about-us") { ... on Entry_Pages_Default { title slug url website_components { ... on Set_WebsiteComponents_TopBanner { type banner_link_title banner_link_is_external banner_link_url banner_text_title banner_text_description banner_media_image { responsive { label asset { permalink url } } } } ... on Set_WebsiteComponents_AboutCompanySection { type about_company_link_is_external about_company_link_title about_company_link_url about_company_text_description about_company_text_title } ... on Set_WebsiteComponents_CompanyMessage { our_message_title our_message_description id type our_message_image { responsive { label asset { permalink url } } } } ... on Set_WebsiteComponents_CompanyVision { our_message_title our_message_description id type our_message_image { responsive { label asset { permalink url } } } } ... on Set_WebsiteComponents_CompanyGoalsSection { our_goals_title all_goals { ... on Set_WebsiteComponents_AllGoals_NewGoal { goal_title goal_description id type goal_image { responsive { label minWidth widthUnit ratio placeholder } } } } id type } } seo_title seo_keywords seo_image { url permalink } seo_description } } }
Error Details:
Debug Message: Image [uploads/pages/about-us/value-1.svg] does not actually appear to be a valid image. Message: Internal server error Error Category: Internal
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
regex (default)
Additional details
No response