-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font Library: first time install fails if fonts upload directory isn't created. #59023
Comments
I remember that this issue was fixed in #55893, but maybe not all scenarios were covered, or maybe a regression occurred at some point. |
I started looking into how other directories in For the For Haven't found how the plugin and theme directories are created yet, but I suspect that happens during the initial WordPress install. |
This is proving very tricky to replicate. Generally, when a font is uploaded, the fonts directory should be created automatically, if needed
I was able to replicate this error a few times, where only the first font upload fails, by deleting both the fonts directory and the upload directory for the current month and year (e.g. The error seems to be triggered here, within the |
So far I am unable to reproduce this issue with the given pointers. Since this is an issue with creating directories, what are the file permissions for the The only thing I noticed is that I can re-install the same font over and over again even though it's already installed: Screen.Recording.2024-02-23.at.13.44.48.movIs this on anyone's radar? |
FWIW, as I'm not sure this is the best way to reproduce this issue, I was seeing a similar issue consistently in Playground when testing out the Font Library. Here are the steps I was following:
As of beta 2 (and beta 3), these issues seem to be consistently resolved in Playground. Here is an example instance. I'm wondering if these two errors are related, then maybe this issue has been fixed by something else between beta 1 and beta 2? |
Noting that I ran into this issue again while testing #58839. One way of replicating this might be changing the fonts directory with a filter to a path that hasn't been used before. |
Thanks for testing @kjnanda ! I don't think we can be sure this is fixed, as it's happening very intermittently. I encountered the error again just yesterday. |
I was working on peterwilsoncc/fonts-to-uploads over the weekend and hit this a couple of times too (using Chassis/Chassis on Vagrant/VirtualBox) but am having the same trouble as others: I'm unable to consistently reproduce it. I agree it's likely a race condition on |
To avoid the risk of font files being created in multiple locations, I think this will need to be resolved as part of WordPress/wordpress-develop#6259 Is it possible it's hapopening due to parallel requests during uploads? |
@matiasbenedetto @peterwilsoncc I'm in the process of clearing the Milestone for the WP 6.5 release and I came across this one. Are you able to advise on the status? From what I can see, the last comment references a Core PR which has subsequently been closed due to the decision around the Fonts upload location. If it's resolved or no longer relevant we can remove from the Editor Board. Thanks in advance. |
Speaking with @creativecoder away from Github, my understanding is that this issue remains even if the directory is I updated the Issue title to reflect that. |
Here's how I've been able to reproduce this today, (using wordpress-develop trunk) Add a filter to specify a fonts directory that you've never used before for uploading files. // Append an arbitrary value to the font directory name
function alter_wp_fonts_dir( $defaults ) {
$append_dir = 'a';
$defaults['path'] = $defaults['path'] . $append_dir;
$defaults['url'] = $defaults['url'] . $append_dir;
return $defaults;
}
add_filter( 'font_dir', 'alter_wp_fonts_dir' ); Check more than one font in the font library and install it. One of them will fail, but the rest should succeed. Checking only one seems to succeed without error. To replicate again, change the One hint is that |
Being able to replicate this issue most of the time locally, I can now confirm that it's caused by a race condition that happens when
The requests are in a race to execute the |
I've opened a PR with minimal changes needed to work around the issue, for now, until we can fix the underlying problem in |
@creativecoder Nice work figuring this out, Grant. Thank you! |
@creativecoder did you already open a trac ticket to explore improving |
Test coverage added and merged in #60221 |
Reproduction Report
First attempt i got this error but second attempt installed successfully.
trac ticket: https://core.trac.wordpress.org/ticket/60528
Environment
Originally posted by @huzaifaalmesbah in #58997 (comment)
The text was updated successfully, but these errors were encountered: