• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

fwrite(): Write of 1578 bytes failed with errno=9 Bad file descriptor in

Version
V4.0.6
PHP version
PHP 8.0.10
Database driver
MariaDB
Database version
10-6-11
Web browser
firefox (latest)

schultz-it-solutions

Chevereto Member
Hey all,
i am pretty sure this is a configuration issue on my side, but I seem to be unable to find the nessessary hints in the forums or documentation. So I hope somebody can point me to the correct solution...

Setting:
I have a chevereto4 test installation and am trying to get it to work, before I can migrate my actual instance.
Windows Server, Apache http, PHP 8.0.10, MariaDB 10.6.11
Installation in a subdirectory of the domain.

During install, right after writing the database connection details, I get these errors (see errorlog below):
fwrite(): Write of 1578 bytes failed with errno=9 Bad file descriptor in ... Stream.php:247

thanks for your help
Ruediger Schultz



# PHP Fatal error: Uncaught Chevere\\Throwable\\Exceptions\\ErrorException: fwrite(): Write of 1578 bytes failed with errno=9 Bad file descriptor in [CHEVERETO-ROOT]gallery4\\app\\vendor\\nyholm\\psr7\\src\\Stream.php:247
# Stack trace:
# #0 [internal function]: Chevere\\ThrowableHandler\\errorAsException()
# #1 [CHEVERETO-ROOT]gallery4\\app\\vendor\\nyholm\\psr7\\src\\Stream.php(247): fwrite()
# #2 [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php(42): Nyholm\\Psr7\\Stream->write()
# #3 [CHEVERETO-ROOT]gallery4\\app\\legacy\\load\\register-handlers.php(50): Chevere\\Writer\\StreamWriter->write()
# #4 [internal function]: {closure}()
# #5 {main}
# Next Chevere\\Throwable\\Exceptions\\RuntimeException: Unable to write provided string in [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php:44
# Stack trace:
# #0 [CHEVERETO-ROOT]gallery4\\app\\legacy\\load\\register-handlers.php(50): Chevere\\Writer\\StreamWriter->write()
# #1 [internal function]: {closure}()
# #2 {main}
# thrown in [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php on line 44
# PHP Fatal error: Uncaught Chevere\\Throwable\\Exceptions\\ErrorExc
# eption: fwrite(): Write of 1744 bytes failed with errno=9 Bad file descriptor in [CHEVERETO-ROOT]gallery4\\app\\vendor\\nyholm\\psr7\\src\\Stream.php:247
# Stack trace:
# #0 [internal function]: Chevere\\ThrowableHandler\\errorAsException()
# #1 [CHEVERETO-ROOT]gallery4\\app\\vendor\\nyholm\\psr7\\src\\Stream.php(247): fwrite()
# #2 [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php(42): Nyholm\\Psr7\\Stream->write()
# #3 [CHEVERETO-ROOT]gallery4\\app\\legacy\\load\\register-handlers.php(50): Chevere\\Writer\\StreamWriter->write()
# #4 [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\throwable-handler\\src\\functions.php(149): {closure}()
# #5 [internal function]: Chevere\\ThrowableHandler\\shutdownErrorAsException()
# #6 {main}
# Next Chevere\\Throwable\\Exceptions\\RuntimeException: Unable to write provided string in [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php:44
# Stack trace:
# #0 [CHEVERETO-ROOT]gallery4\\app\\legacy\\load\\register-handlers.php(50): Chevere\\Writer\\StreamWriter->write()
# #1 [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\throwable-handler\\src\\functions.php(149): {closure}()
# #2 [internal function]: Chevere\\ThrowableHandler\\shutdownErrorAsException()
# #3 {main}
# thrown in [CHEVERETO-ROOT]gallery4\\app\\vendor\\chevere\\chevere\\src\\Writer\\StreamWriter.php on line 44
 
I finally got some time to dig (really, really) deep into this issue - and I belief I found the underlying cause. It indeed is an issue connected with WINDOWS, however I still think Chevereto should address it (eventually).

In ".../app/src/Legacy/functions.php" : line 960
the constant "PATH_PUBLIC" is defined: define('PATH_PUBLIC', dirname(DIR, 3) . '/');

On WINDOWS, this constant will have "BackSlashes" as directory_separators, on LINUX there will be "ForwardSlashes".



My "adhoc" solution was to use the "forward_slash" function of "/app/src/Legacy/G/functions.php"

In ".../app/src/Legacy/functions.php"
insert after line 40:

use function Chevereto\Legacy\G\forward_slash;

change line 961 (previously line 960) to:
define('PATH_PUBLIC', forward_slash(dirname(DIR, 3) ) . '/');


hope this helps others as well

kind regards
Ruediger Schultz
 
Back
Top