Unable to create the "logs" directory

467 views
Skip to first unread message

Steve Schram

unread,
May 31, 2024, 8:55:00 AM5/31/24
to SimpleSAMLphp
I am in the process of updating our SimpleSAMLphp-based app to use version 2, and currently at the stage of migrating to Twig templates. After discovering that the `usenewui` config param needs to be added and set to `true`, I started seeing this exception:

SimpleSAML\Error\Error: UNHANDLEDEXCEPTION<br>Backtrace:
      1 www/_include.php:17 (SimpleSAML_exception_handler)
      0 [builtin] (N/A)
      Caused by: RuntimeException: Unable to create the "logs" directory (vendor/simplesamlphp/simplesamlphp//log/).
      Backtrace:
      5 vendor/symfony/http-kernel/Kernel.php:686 (Symfony\Component\HttpKernel\Kernel::buildContainer)
      4 vendor/symfony/http-kernel/Kernel.php:593 (Symfony\Component\HttpKernel\Kernel::initializeContainer)
      3 vendor/symfony/http-kernel/Kernel.php:136 (Symfony\Component\HttpKernel\Kernel::boot)
      2 vendor/symfony/http-kernel/Kernel.php:196 (Symfony\Component\HttpKernel\Kernel::handle)
      1 lib/SimpleSAML/Module.php:198 (SimpleSAML\Module::process)
      0 www/module.php:10 (N/A)


Manually creating the `log` directory bypasses this problem, but it makes me wonder why this is necessary. It's also worth noting that nothing appears to be writing to that directory. We are installing SimpleSAMLphp using composer and and running inside a Docker container, with the image build executed as root. Thus, the vendor folder and contents are all owned by root. Should I just create the `log` directory in our Dockerfile or is there a way to disable the code that creates the `log directory?

Thanks!

Steve

Tim van Dijen

unread,
Jun 3, 2024, 3:04:12 AM6/3/24
to SimpleSAMLphp
Hi Steve,

I think in a later version we default to the system default tempdir to bypass this exception.
It's the Symfony framework that requires a writable directory, even if it's not used.

- Tim

Op vrijdag 31 mei 2024 om 14:55:00 UTC+2 schreef Steve Schram:

Steve Schram

unread,
Jun 5, 2024, 3:14:51 AM6/5/24
to simple...@googlegroups.com
Thanks, Tim! I'll make a note to try removing the manual creation of this directory after we get to the latest version.

Steve

--
This is a mailing list for users of SimpleSAMLphp, not a support service. If you are willing to buy commercial support, please take a look here:
 
https://simplesamlphp.org/support
 
Before sending your question, make sure it is related to SimpleSAMLphp, and not your web server's configuration or any other third-party software. This mailing list cannot help with software that uses SimpleSAMLphp, only regarding SimpleSAMLphp itself.
 
Make sure to read the documentation:
 
https://simplesamlphp.org/docs/stable/
 
If you have an issue with SimpleSAMLphp that you cannot resolve and reading the documentation doesn't help, you are more than welcome to ask here for help. Subscribe to the list and send an email with your question. However, you will be expected to comply with some minimum, common sense standards in your questions. Please read this carefully:
 
http://catb.org/~esr/faqs/smart-questions.html
---
You received this message because you are subscribed to the Google Groups "SimpleSAMLphp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplesamlph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simplesamlphp/4cd21367-b99b-47ef-b6a6-e818a362390cn%40googlegroups.com.

Steve Schram

unread,
Jun 17, 2024, 4:49:13 AM6/17/24
to SimpleSAMLphp
Starting to work with version 2.2.2 now, and I continue to see the same error. I've changed config to add `'cachedir' => '/var/cache/simplesamlphp'` and remove `'tempdir' => '/tmp/simplesaml'` but that only changes the text of the error message from "Unable to create the "logs" directory" to "Unable to create the "cache" directory". I'm not opposed to making appropriate changes to our Dockerfile, but it is surprising to me that we're doing anything unusual that would cause this issue. I also realize that this might fall under normal website configuration, and as such, it's not really an issue for this mailing list. Just so I have better understanding, though, is this new to SimpleSAMLphp 2.x because Symfony was added, or is there something else in play that brings about this new configuration issue? Where could this or should this live in the SimpleSAMLphp documentation? (It might be as easy as linking here: https://symfony.com/doc/current/setup/file_permissions.html.)

Thanks again

Steve

Reply all
Reply to author
Forward
0 new messages