Gatsby-source-wordpress-experimental: Media with non-URL-safe characters cannot be fetched

Created on 20 Aug 2020  路  4Comments  路  Source: gatsbyjs/gatsby-source-wordpress-experimental

I am unable to compile when I have media with non-URL-safe characters in them.

The graphql node contains the correct URL (@ formatted as %40): https://xxxxxxxxxxxxxx.com/filename1234-something-245%402x.png

But the processed URL seems to have doubly URL-encoded the string, causing a 404 (% reencoded to %25): https://xxxxxxxxxxxxxx.com/wp-content/uploads/2020/08/filename1234-something-245%25402x.png

Media item link: https://xxxxxxxxxxxxxx.com/filename1234-something-2452x
Edit link: https://xxxxxxxxxxxxxx.com/wp-admin/upload.php?item=72
File url: https://xxxxxxxxxxxxxx.com/filename1234-something-245%402x.png

ERROR

failed to process https://xxxxxxxxxxxxxx.com/wp-content/uploads/2020/08/filename1234-something-245%25402x.png
HTTPError: Response code 404 (Not Found)

address before stable release missing data

Most helpful comment

@TylerBarnes The filename is actually [email protected] which gets encoded to filename1234-something-245%402x.png, and that URL works and can be used to fetch the image from the server.

The filename it is trying to process though - filename1234-something-245%25402x.png (notice the extra %25 added in the filename) does not exist. Other than that I only obscured the domain name and change the first part of the filename to filename1234-something-

I have gotten around this by re-uploading all my images without the offending @ symbol in the filename (because this is a new site so we still have that luxury) and that took care of the issue. It's a bad idea to use filenames like those anyway.

I hope that answers your question? Thanks for trying to help!

All 4 comments

Hi @stephan-swiftcom , thanks for opening this issue. Is https://xxxxxxxxxxxxxx.com/wp-content/uploads/2020/08/filename1234-something-245%25402x.png an accurate representation of one of the url's causing this issue?

@TylerBarnes The filename is actually [email protected] which gets encoded to filename1234-something-245%402x.png, and that URL works and can be used to fetch the image from the server.

The filename it is trying to process though - filename1234-something-245%25402x.png (notice the extra %25 added in the filename) does not exist. Other than that I only obscured the domain name and change the first part of the filename to filename1234-something-

I have gotten around this by re-uploading all my images without the offending @ symbol in the filename (because this is a new site so we still have that luxury) and that took care of the issue. It's a bad idea to use filenames like those anyway.

I hope that answers your question? Thanks for trying to help!

@stephan-swiftcom , I shipped a fix for this last night! 馃槃

https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/issues/184

Update to [email protected]

Cheers!

@TylerBarnes Fantastic! thanks for all the great work 馃憤

Was this page helpful?
0 / 5 - 0 ratings