You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
metarefresh incompatible with SSP 2.5.0: Unsupported option "http" passed to "Symfony\Component\HttpClient\CurlHttpClient" #62
Thanks @msalle ! Would you be able to run a test with the suggested fix in #63 ?
You can install it by running bin/composer simplesamlphp/simplesamlphp-module-metarefresh#dev-bugfix/http-client
Thanks @msalle ! Would you be able to run a test with the suggested fix in #63 ? You can install it by running bin/composer simplesamlphp/simplesamlphp-module-metarefresh#dev-bugfix/http-client
./bin/metarefresh.php -s https://metadata.surfconext.nl/edugain-downstream-idp.xml
PHP Warning: Undefined array key 0 in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
PHP Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(126): preg_match()
#1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
#2 {main}
thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
The array has named indices of all the response headers, not 0 etc. (checked with a print_r).
We're getting there slowly. Can you give it another try with the updated PR?
not yet there...:
[root@ metarefresh]# ./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xml
PHP Fatal error: Uncaught Error: Call to a member function getStatusCode() on array in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:126
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
#1 {main}
thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 126
I experimented also a little with the commandline tool, which still produces a stacktrace, but only after succesfully downloading:
./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xml > edugain.php
PHP Warning: Undefined array key "entityid" in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 505
PHP Fatal error: Uncaught TypeError: addslashes(): Argument #1 ($string) must be of type string, null given in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php:509
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(509): addslashes()
#1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(124): SimpleSAML\Module\metarefresh\MetaLoader->dumpMetadataStdOut()
#2 {main}
thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php on line 509
If I bork the URL and get a 404 it looks like I more or less get the right stacktrace:
# ./bin/metarefresh.php -s http://metadata.surfconext.nl/edugain-downstream-idp.xm
PHP Fatal error: Uncaught Symfony\Component\HttpClient\Exception\ClientException: HTTP/2 404 returned for "https://metadata.surfconext.nl/edugain-downstream-idp.xm". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php:170
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(67): Symfony\Component\HttpClient\Response\CurlResponse->checkStatusCode()
#1 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(116): Symfony\Component\HttpClient\Response\CurlResponse->getHeaders()
#2 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
#3 {main}
thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php on line 170
although it probably should be caught?
And likewise for illegal hostname:
# ./bin/metarefresh.php -s http://metadata.surfconext.n/
PHP Fatal error: Uncaught Symfony\Component\HttpClient\Exception\TransportException: Could not resolve host: metadata.surfconext.n for "http://metadata.surfconext.n/". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CurlResponse.php:337
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(173): Symfony\Component\HttpClient\Response\CurlResponse::perform()
#1 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php(145): Symfony\Component\HttpClient\Response\CurlResponse::stream()
#2 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(54): Symfony\Component\HttpClient\Response\CurlResponse::initialize()
#3 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(115): Symfony\Component\HttpClient\Response\CurlResponse->getStatusCode()
#4 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
#5 {main}
Next Symfony\Component\HttpClient\Exception\TransportException: Could not resolve host: metadata.surfconext.n for "http://metadata.surfconext.n/". in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Chunk/ErrorChunk.php:55
Stack trace:
#0 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/CommonResponseTrait.php(146): Symfony\Component\HttpClient\Chunk\ErrorChunk->isFirst()
#1 /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Response/TransportResponseTrait.php(54): Symfony\Component\HttpClient\Response\CurlResponse::initialize()
#2 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/src/MetaLoader.php(115): Symfony\Component\HttpClient\Response\CurlResponse->getStatusCode()
#3 /project/srv/www/site/simplesamlphp-2.5.0-prod/modules/metarefresh/bin/metarefresh.php(120): SimpleSAML\Module\metarefresh\MetaLoader->loadSource()
#4 {main}
thrown in /project/srv/www/site/simplesamlphp-2.5.0-prod/vendor/symfony/http-client/Chunk/ErrorChunk.php on line 55
It's hard for me to test, because I've never used this module and I think I need to set it up before I can use it like that. The command-line gives me no output at all..
I think the exceptions from the HTTP-client should be caught now with my latest change.
Can you debug the contents of the metadata-array at line 509 for me? It's very strange that the entityid is not there...
Thanks @madsi1m ! But I'd much rather figure out where this difference is coming from. (and how this relates to the http-client update, because it seems unrelated).
With just #63 i get the list, with #64 it gets rid of the errors/warnings, it seems for some reason some IDPs are an array of single item [0] which then has everything inside which cause the issues, so i do a check.
I can confirm i do not have this list problem on SSP 2.4.4 but do on 2.5.0
I think #63 is ok. Looking for the metadata in the first element of a subarray in #64 seems a bit strange. I will have to try to replicate things to see why that is being put into a single entry sub-array in 2.5.x.
@restena-sw the latest state is now in dev-bugfix/http-client. Would you be able to run a few tests?
Also for the other people in this thread of course :)
Hmm... the error at hand has gone indeed. I still don't get metadata though, for a weird reason. When trying to execute metarefresh from admin UI, it returns with:
Error adding trust anchors from file: /export/hosting/filesender-test/.curl.ca
It's technically correct that this file does not exist. But it has never, and that was never a problem. I checked the prod instance with its 2.4.5 - that one doesn't have a .curl.ca either, but metarefresh works fine.
But the git blame says it's unchanged since four years. It's a short-circuit OR - maybe SSP had previously set some other condition so that the pertinent one was never evaluated?
Metadata-files were downloaded using file_get_contents() before. The Symfony HTTP-client was introduced in SSP 2.5, so that's why your old install worked.
Tagged v1.3.1 of this module and I will make sure that ends up in the full-tarball in the next bugfix-release of SimpleSAMLphp
Great, I presume you saw my last comment with the 3 points on AttributeAuthority? So I can assume the code with or without subarray is actually correct and you don't need further tests?
Activity
tvdijen commentedon Mar 15, 2026
Thanks @msalle ! Would you be able to run a test with the suggested fix in #63 ?
You can install it by running
bin/composer simplesamlphp/simplesamlphp-module-metarefresh#dev-bugfix/http-clientmsalle commentedon Mar 15, 2026
Thanks for the quick response!
With the #63 as patch I now get a new error:
tvdijen commentedon Mar 15, 2026
Try again? I've pushed a one-liner fix
msalle commentedon Mar 15, 2026
Now I get a stacktrace:
I'm just verifying if that's due to a patch I have on MetaLoader.php... No it's not, it's https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/src/MetaLoader.php#L126
msalle commentedon Mar 15, 2026
And more clearly from the commandline:
The array has named indices of all the response headers, not 0 etc. (checked with a
print_r).tvdijen commentedon Mar 15, 2026
We're getting there slowly. Can you give it another try with the updated PR?
msalle commentedon Mar 15, 2026
not yet there...:
tvdijen commentedon Mar 15, 2026
I think I got it this time.
msalle commentedon Mar 15, 2026
Yes! The metarefresh cronjob works fine now!
I experimented also a little with the commandline tool, which still produces a stacktrace, but only after succesfully downloading:
If I bork the URL and get a 404 it looks like I more or less get the right stacktrace:
although it probably should be caught?
And likewise for illegal hostname:
tvdijen commentedon Mar 15, 2026
It's hard for me to test, because I've never used this module and I think I need to set it up before I can use it like that. The command-line gives me no output at all..
I think the exceptions from the HTTP-client should be caught now with my latest change.
Can you debug the contents of the metadata-array at line 509 for me? It's very strange that the entityid is not there...
madsi1m commentedon Mar 15, 2026
#63 seems to fix things for me.
I had to also add this change #64 and now I can see a list of IDPs without errors/warnings.
also apply same fix in rest of the file to fix @msalle's issue simple…
tvdijen commentedon Mar 16, 2026
Thanks @madsi1m ! But I'd much rather figure out where this difference is coming from. (and how this relates to the http-client update, because it seems unrelated).
madsi1m commentedon Mar 16, 2026
With just #63 i get the list, with #64 it gets rid of the errors/warnings, it seems for some reason some IDPs are an array of single item [0] which then has everything inside which cause the issues, so i do a check.
I can confirm i do not have this list problem on SSP 2.4.4 but do on 2.5.0
14 remaining items
monkeyiq commentedon Mar 17, 2026
I think #63 is ok. Looking for the metadata in the first element of a subarray in #64 seems a bit strange. I will have to try to replicate things to see why that is being put into a single entry sub-array in 2.5.x.
monkeyiq commentedon Mar 18, 2026
An update to #64 is at #66
The scope of the issue seems to be only
attributeauthority-remotefor the test files I have been using.tvdijen commentedon Mar 18, 2026
@msalle Can you confirm or deny that the entities that have a strange array-format are ones that involve an AttributeAuthority ?
msalle commentedon Mar 18, 2026
Hi @tvdijen
I can confirm that:
md:AttributeAuthorityDescriptor.md:AttributeAuthorityDescriptortvdijen commentedon Mar 18, 2026
@restena-sw the latest state is now in
dev-bugfix/http-client. Would you be able to run a few tests?Also for the other people in this thread of course :)
restena-sw commentedon Mar 18, 2026
Hmm... the error at hand has gone indeed. I still don't get metadata though, for a weird reason. When trying to execute metarefresh from admin UI, it returns with:
Error adding trust anchors from file: /export/hosting/filesender-test/.curl.caIt's technically correct that this file does not exist. But it has never, and that was never a problem. I checked the prod instance with its 2.4.5 - that one doesn't have a .curl.ca either, but metarefresh works fine.
restena-sw commentedon Mar 18, 2026
Ah, turns out we have a php.ini option set:
php-fpm83.conf:php_value[curl.cainfo] = "/export/hosting/filesender-test/.curl.ca"My best guess is that old Symfony ignored this while the new one doesn't - but it's of course our fault for setting that incorrectly.
And indeed, after removing that bogus line - our entities are fetched correctly.
(The aggregate we use has no AttributeAuthorities)
restena-sw commentedon Mar 18, 2026
This is the only line in Symfony source mentioning curl.cainfo: https://github.com/symfony/symfony/blame/ee4f425c6ce2eb164fe0a4a427a8d3d77c78b30b/src/Symfony/Component/HttpClient/HttpClient.php#L53
But the git blame says it's unchanged since four years. It's a short-circuit OR - maybe SSP had previously set some other condition so that the pertinent one was never evaluated?
tvdijen commentedon Mar 18, 2026
Metadata-files were downloaded using
file_get_contents()before. The Symfony HTTP-client was introduced in SSP 2.5, so that's why your old install worked.tvdijen commentedon Mar 18, 2026
Tagged v1.3.1 of this module and I will make sure that ends up in the full-tarball in the next bugfix-release of SimpleSAMLphp
msalle commentedon Mar 18, 2026
Great, I presume you saw my last comment with the 3 points on AttributeAuthority? So I can assume the code with or without subarray is actually correct and you don't need further tests?
tvdijen commentedon Mar 18, 2026
It's always good if you can verify things :) There shouldn't be any sub-arrays anymore now.
msalle commentedon Apr 26, 2026
I finally managed to get back to this. Just tried the 1.3.1 release and all is well. Do you have plans to also release a new SSP tarball (soonish)?