- Status changed to Needs review
almost 2 years ago 10:28am 17 January 2023 - Status changed to Needs work
almost 2 years ago 8:07pm 2 March 2023 - 🇺🇸United States smustgrave
As a bug this will need a test case to show the error.
- 🇺🇦Ukraine rollins
Patch #7 resolved bug for 9.5.7 core version.
thank you @iperiba92 - ivnish Kazakhstan
I had the same problem. I updated translations again here /admin/reports/translations and the problem is gone
Thank you for patch #7!
I started getting this error recently, preventing module installation. The patch allowed me to install again as normal without fatal errors.
- 🇸🇮Slovenia joco_sp
In our case it happened on core 9.5.10. The temporary folder was not configured correctly. After adding
$settings['file_temp_path'] = 'tmp';
the problem went away.
So, it's worth checking if your tmp folder is correctly configured and if it has the correct permissions before applying a patch. - 🇩🇪Germany Anybody Porta Westfalica
- 🇧🇪Belgium flyke
For me the solution was:
- visit /admin/config/media/file-system
- make sure a translations folder is set up there, like: 'sites/default/files/translations'.
- Save the pageNow it is fixed, if I enable another module, or drush pmu and then drush en my module again, all works good.
I should note that when I visited /admin/config/media/file-system, a translations folder was already set up there.
But the actual folder that is set up there was missing on my local dev environment.
By saving that page without making any changes, Drupal created the translations folder for me. - 🇨🇦Canada mahde Vancouver
I faced this issue after upgrading from Drupal 9.5.11 to Drupal 10.1.5.
The translations directory exists and the permissions are fine.
The temporary directory is configured correctly.
It works only after applying the patch! - 🇲🇦Morocco h_kac
I faced this issue with drupal 9.3.22 when we upgraded from PHP 7.3 to php 8.1. The comment #21 worked for me. I just saved the page without making any changes and the error was gone. When I do "drush locale-update" no more error are shown.
- 🇫🇷France mupsi
Upgrading from 9.5.11 to 10.1.7, I had the same issue. What fixed it for me was a mix of #21 🐛 PoStreamReader::readLine() throws an error on module install Needs work and other things:
- visiting /admin/config/media/file-system
- making sure a translations folder is set up there, like: 'sites/default/files/translations'.
- saving the form
- running
drush locale:check
thendrush locale:umpdate
- finally, in /admin/reports/status, clicking on the run cron button, I get an error message saying that it failed. I clicked again and now it's working
Hope that helps. No patch was needed for me.
- 🇪🇸Spain rcodina Barcelona
Patch on #7 works for me on Drupal 10.1.7. In my case, the error showed up while performing a "drush deploy" in local DDEV environment. So I think it's important to show the error message but avoid interrupting the configuration import process only due to translations import failures.
- 🇦🇷Argentina matiasmiranda Yerba Buena
The patch works, but I don't think it's the correct approach here, we're simply ignoring an error and/or misconfiguration issue.
In my opinion this should be fixed by configuring correctly the file-system options and directory permissions. - 🇬🇧United Kingdom joachim
Agree with #28 -- this is not the right fix.
The right fix would be for the problem to produce a warning that tells users that they need to configure the temp folder.
- 🇧🇬Bulgaria pfrenssen Sofia
Yeah this is not a bug, but a configuration error on the user's behalf. I hit this on a CI environment because the translations folder was missing.
I guess we can improve the error message.
- 🇪🇸Spain rcodina Barcelona
In my case this error blocks the deploy pipeline when installing new modules. I agree it's a server miss configuration, but it's not enough reason to block the deployment. So, apart from improving the error message, we should keep changes from current patch.
- 🇳🇱Netherlands groendijk
Came across this issue and used the patch. Not because translation directory wasn't configured properly but just because it couldn't download with a drush locale:update:
ddev drush locale:update > [error] Unable to download translation file https://ftp.drupal.org/files/translations/all/admin_toolbar/admin_toolbar-3.5.1.nl.po. > [warning] filesize(): stat failed for //admin_toolbar-3.5.1.nl.po locale.bulk.inc:203 > [warning] fopen(translations://admin_toolbar-3.5.1.nl.po): Failed to open stream: "Drupal\locale\StreamWrapper\TranslationsStream::stream_open" call failed PoStreamReader.php:154 > [error] TypeError: fgets(): Argument #1 ($stream) must be of type resource, bool given in fgets() (line 248 of /var/www/html/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php) #0 /var/www/html/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php(248): fgets(false)...
Patch saved my day. Rather have a broken translation than trying to figure out why it's unable to download translation. Agree with #34.