roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Bug: Files with german umlauts not found on production #1398

Closed jakobmeusburger closed 2 years ago

jakobmeusburger commented 2 years ago

Terms

Description

What's wrong?

I migrated a Bedrock project from a non-Trellis environment to a Trellis environment. This worked pretty well, but uploads that contain german umlauts (like Ä, Ö, Ü) can't be found, but the URL is correct and the file is in the corresponding location.

What have you tried?

I tried to rename the files with the phoenix media rename plugin, but this didn't work. It fails with the message: Can't find original file in the folder. Tried to rename /srv/www/WEBSITE/releases/20220627124229/web/app/uploads/2020/11/exämpl.jpg, even if the file is located at exactly this location.

What insights have you gained?

I first thought it was an error with the Nginx config, but this can't be the case if even the plugin fails with the absolute server path, not using the URL. So it's maybe an error with PHP?

Temporary workarounds

Delete all files containing umlauts, rename them, upload them again and link them to the correct posts/sites/...

Steps To Reproduce

  1. Deploy a trellis project.
  2. Upload a file containing umlauts.

Expected Behavior

Files should be loaded.

Actual Behavior

Files aren't loaded / can't be accessed.

Relevant Log Output

No response

Versions

Trellis 1.14.0, Bedrock: Unknown (no CHANGELOG.md), OS: Ubuntu 20.04

jakobmeusburger commented 2 years ago

I found out, that it hasn't something to do with Trellis itself. The issue happened when downloading the files via ftp from the old server. My ftp client somehow formatted the umlauts. They looked the same but weren't the same, as the binary safe comparison of the the used and the should be umlauts revealed. I fixed it by renaming all files to use the correct umlauts. It's kind of weird though that it worked in the development environment with the same files and configuration.