Missing configuration file in SimpleSAML\Error\CriticalConfigurationError::fromException()

3,287 views
Skip to first unread message

ljt...@gmail.com

unread,
Mar 5, 2018, 12:11:05 PM3/5/18
to SimpleSAMLphp
What are you trying to do?

I'm trying to upgrade to v1.15.4.

What have you done?

Describe here the steps you have taken:
  • What does your setup look like (e.g. number of servers, virtual hosts and/or domains; load balancers / TLS offloaders; version(s) of SimpleSAMLphp installed; how you configured SimpleSAMLphp --IdP? SP? proxy?; what other software are you using; etc)?
    • At this point, I'm running it locally on my MacOS High Serierra
  • What documentation are you following if you are following any apart from the official?
    • I'm using composer require simpelsamlphp/simplesamlphp
    • However, my current setting was:
      • The config, metadata, and cert folders are inside the drupalsites/simplesamlphp folder.
      • The simplesamlphp is installed is inside the vendor/simplesamlphp folder and created symlinks to ../simplesamlphp/config, ../simplesamlphp/cert, ../simplesamlphp/metadata
    • However, my new version installation file structure are:
      • composer require simplesamlphp/simplesamlphp
      • created symlinks to ../../simplesamlphp/config, ../../simplesamlphp/cert, ../../simplesamlphp/metadata
  • Are you using any third-party software (e.g. a Drupal plugin)?
    • I'm running drupal 8
  • How are you testing your setup?
    • I tried accessing the site https://www.dd:8443 works but...
    • I tried to go into https://www.dd:8443/simplesaml/ then it errors out
      • Fatal error: Cannot redeclare ah_db_current_host() (previously declared in /Users/charlie/Sites/drupalsites/simplesamlphp/config/config.php:942) in /Users/charlie/Sites/drupalsites/simplesamlphp/config/config.php on line 942
    • Line 942 refers to this function:
      • function ah_db_current_host($db_cluster_id) {
        require_once("/usr/share/php/Net/DNS2_wrapper.php");
        try {
        $resolver = new Net_DNS2_Resolver(array('nameservers' => array('127.0.0.1', 'dns-master')));
        $response = $resolver->query("cluster-{$db_cluster_id}.mysql", 'CNAME');
        $cached_id = $response->answer[0]->cname;
        }
        catch (Net_DNS2_Exception $e) {
        $cached_id = "";
        }
        return $cached_id;
        }
  • What did you do to debug your problem?
    • I typed: drush ws --uri=site1 and it shows the error:
    • 120932  05/Mar 10:28  php       error     SimpleSAML\Error\CriticalConfigurationError: The configuration (config/config.php) is invalid: Missing configuration file in SimpleSAML\Error\CriticalConfigurationError::fromException()

  • etc
Any help is much appreciated.

ljt...@gmail.com

unread,
Mar 5, 2018, 2:38:33 PM3/5/18
to SimpleSAMLphp
I'm getting this now.

Configuration error

SimpleSAMLphp appears to be misconfigured. 

If you report this error, please also report this tracking number which makes it possible to locate your session in the logs available to the system administrator:

10d3f0269c

Debug information

The debug information below may be of interest to the administrator / help desk:

SimpleSAML\Error\CriticalConfigurationError: The configuration is invalid: The configuration (config/config.php) is invalid: Missing configuration file

Backtrace:
1 www/_include.php:98 (require_once)
0 www/index.php:3 (N/A)

ljt...@gmail.com

unread,
Mar 5, 2018, 2:44:56 PM3/5/18
to SimpleSAMLphp
This is showing in the log:

[05-Mar-2018 19:39:25 UTC] SimpleSAMLphp ERR [8136a8ee85] SimpleSAML\Error\CriticalConfigurationError: The configuration is invalid: The configuration (config/config.php) is invalid: Missing configuration file request_id="v-e98eec48-20ac-11e8-92ca-22000aeb13a5"


On Monday, March 5, 2018 at 11:11:05 AM UTC-6, Chong Lor wrote:

Peter Schober

unread,
Mar 5, 2018, 3:08:59 PM3/5/18
to SimpleSAMLphp
* ljt...@gmail.com <ljt...@gmail.com> [2018-03-05 20:38]:
> If you report this error, please also report this tracking number which
> makes it possible to locate your session in the logs available to the
> system administrator:

Note that you are the administrator, noone else has any use for a
"tracking number" specific to your server.

> SimpleSAML\Error\CriticalConfigurationError: The configuration is invalid:
> The configuration (config/config.php) is invalid: Missing configuration file

That seems pretty clear to me. Either config.php is missing or other
config file it depends on?

-peter

Chong Lor

unread,
Mar 5, 2018, 3:29:21 PM3/5/18
to SimpleSAMLphp
I got rid of the previous error...now, I got this error the HTTP ERROR 500 when loading mysite.mainsite.com/simplesaml. In the log it showed:

[05-Mar-2018 20:14:39 UTC] PHP Fatal error:  Cannot redeclare ah_db_current_host() (previously declared in /mnt/www/html/mainsitetest/simplesamlphp/config/config.php:942) in /mnt/www/html/mainsitetest/simplesamlphp/config/config.php on line 942 request_id="v-d562913e-20b1-11e8-a3da-22000aeb13a5"


--
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 a topic in the Google Groups "SimpleSAMLphp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simplesamlphp/5mEG9pQbjPM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simplesamlphp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Schober

unread,
Mar 5, 2018, 3:40:01 PM3/5/18
to SimpleSAMLphp
* Chong Lor <ljt...@gmail.com> [2018-03-05 21:29]:
> [05-Mar-2018 20:14:39 UTC] PHP Fatal error: Cannot redeclare
> ah_db_current_host() (previously declared in
> /mnt/www/html/mainsitetest/simplesamlphp/config/config.php:942) in

There is no such thing (ah_db_current_host) in the default config.php:
https://github.com/simplesamlphp/simplesamlphp/blob/master/config-templates/config.php
so you must have added that.
-peter

Chong Lor

unread,
Mar 5, 2018, 3:52:10 PM3/5/18
to SimpleSAMLphp
I'm following these two documentation.


We're using Acquia's cloud for hosting. The same config works fine with previous version v1.14.17. All I did was composer require simplesamlphp/simplesamlphp but I had to remove drupal/simplesamlphp_auth and require simplesamlphp/simplesamlphp first and then add drupal/simpesamlphp_auth back.

-peter

Chong Lor

unread,
Mar 6, 2018, 11:47:10 AM3/6/18
to SimpleSAMLphp
Looks like the issue comes from the Acquia snippet, https://gist.github.com/acquialibrary/8059715. If I commented out this whole snippet, I'm able to load the https://example.prod.acquia-sites.com/simplesaml page. I just can't the default-sp authentication sources yet.

Chong Lor

unread,
Mar 20, 2018, 1:11:36 PM3/20/18
to SimpleSAMLphp
I'm getting this error now.

SimpleSAML_Error_Error: UNHANDLEDEXCEPTION

Backtrace:
1 www/_include.php:45 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: Exception: [ARRAY]: The option 'Format' is not a valid string value.
Backtrace:
8 lib/SimpleSAML/Configuration.php:698 (SimpleSAML_Configuration::getString)
7 modules/saml/lib/Message.php:452 (sspmod_saml_Message::buildAuthnRequest)
6 modules/saml/lib/Auth/Source/SP.php:191 (sspmod_saml_Auth_Source_SP::startSSO2)
5 modules/saml/lib/Auth/Source/SP.php:336 (sspmod_saml_Auth_Source_SP::startSSO)
4 modules/saml/lib/Auth/Source/SP.php:431 (sspmod_saml_Auth_Source_SP::authenticate)
3 lib/SimpleSAML/Auth/Source.php:193 (SimpleSAML_Auth_Source::initLogin)
2 lib/SimpleSAML/Auth/Simple.php:161 (SimpleSAML\Auth\Simple::login)
1 modules/core/www/authenticate.php:36 (require)
0 www/module.php:135 (N/A)

ljt...@gmail.com

unread,
Apr 18, 2018, 9:51:55 AM4/18/18
to SimpleSAMLphp
This is block of code that SimpleSAML_Error is complaining about.

function SimpleSAML_exception_handler($exception)
{
SimpleSAML\Module::callHooks('exception_handler', $exception);

if ($exception instanceof SimpleSAML_Error_Error) {
$exception->show();
} elseif ($exception instanceof Exception) {
$e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception);
$e->show();
} else {
if (class_exists('Error') && $exception instanceof Error) {
$code = $exception->getCode();
$errno = ($code > 0) ? $code : E_ERROR;
$errstr = $exception->getMessage();
$errfile = $exception->getFile();
$errline = $exception->getLine();
SimpleSAML_error_handler($errno, $errstr, $errfile, $errline);
}
}
}

I don't see any abnormal about this block of code. Any suggestion is appreciated.

ljt...@gmail.com

unread,
Apr 18, 2018, 10:20:02 AM4/18/18
to SimpleSAMLphp
I put a die("Exception: ".$exception); after the SimpleSAML\Module::callHooks('exception_handler', $exception); line and it shows the following:


Exception: SimpleSAML_Error_UnserializableException: [ARRAY]: The option 'Format' is not a valid string value. in /mnt/www/html/mysiteDev/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php:197 Stack trace: #0 /mnt/www/html/mysiteDev/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php(284): unserialize('a:19:{s:8:"Erro...') #1 /mnt/www/html/mysiteDev/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php(393): SimpleSAML_Auth_State::loadState('_9bd826697adbc0...', 'SimpleSAML_Auth...') #2 /mnt/www/html/mysiteDev/vendor/simplesamlphp/simplesamlphp/modules/core/www/authenticate.php(23): SimpleSAML_Auth_State::loadExceptionState() #3 /mnt/www/html/mysiteDev/vendor/simplesamlphp/simplesamlphp/www/module.php(135): require('/mnt/www/html/e...') #4 {main}

chish...@gmail.com

unread,
Jul 9, 2018, 4:54:01 PM7/9/18
to SimpleSAMLphp
Hi Chong, 

Have you got any luck of this?
I got the exact same error as you got.
Any suggestion is appreciated.

Lu
To unsubscribe from this group and all its topics, send an email to simplesamlph...@googlegroups.com.

adamde...@gmail.com

unread,
Mar 4, 2020, 1:23:10 PM3/4/20
to SimpleSAMLphp
Might this help?

Copy the default "config.php" file from "config-templates" into the "config" folder.

This got rid of the missing config file for me.

Tsegaselassie Tadesse

unread,
Aug 26, 2020, 10:58:46 AM8/26/20
to SimpleSAMLphp

If you're using Apache check your Virtual Host configuration. Make sure the SetEnv SIMPLESAMLPHP_CONFIG_DIR is pointed to the exact folder where your config.php file is.

I had a similar issue just now and the above fixed it for me.

Tim van Dijen

unread,
Aug 30, 2020, 7:48:47 AM8/30/20
to SimpleSAMLphp
Hi Chong,

You should check your ' saml:NameIDPolicy' in the default-sp authsource.. It's probably a string, where at some point we started requiring an array.

Also note that 1.15.4 is extremely old and has several know security issues.. Please be adviced to use the latest stable (v1.18.7)

- Tim

Op dinsdag 20 maart 2018 om 18:11:36 UTC+1 schreef Chong Lor:
To unsubscribe from this group and all its topics, send an email to simplesamlph...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages