Subject: An open discussion list for topics related to the geteduroam service
List archive
Re: Issues using the geteduroam IoS app with self-hosted letswifi service
- From: Jamie Getty <Jamie.Getty AT reannz.co.nz>
- To: "geteduroam AT lists.geant.org" <geteduroam AT lists.geant.org>
- Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
- Date: Fri, 21 Nov 2025 02:28:01 +0000
I have found the cause of the issue.
It turns out that when I call this:
$app = new letswifi\LetsWifiApp();
It outputs the additional newline that causes the issue.
Then I found it was this line:
$this->config = $config ?? new Config();
And then I checked my config file. It was because I had a newline at the beginning of my letswifi.conf.php file.
This meant that every time the config was loaded, it would output a newline.
This was captured by the eap-config API (which loads your config when it calls LetsWifiApp()), and thus was prepended to the XML output.
So make sure your PHP configs start with <?php and nothing else!
—
|
From: geteduroam-request AT lists.geant.org <geteduroam-request AT lists.geant.org> on behalf of Jamie Getty <geteduroam AT lists.geant.org>
Date: Friday, 21 November 2025 at 12:59 PM
To: geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
Date: Friday, 21 November 2025 at 12:59 PM
To: geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
I have used the dumpio apache module to log the data being sent by Apache. Here is part of the line detailing what is returned:
mod_dumpio: dumpio_out (data-HEAP): \n<?xml version="1.0" encoding="utf-8”?> ...
So you can see that there is indeed a newline before the the returned XML.
Since this is happening between the PHP script returning the payload and apache sending the data, that narrows things down a bit.
—
|
From: geteduroam-request AT lists.geant.org <geteduroam-request AT lists.geant.org> on behalf of Jamie Getty <geteduroam AT lists.geant.org>
Date: Friday, 21 November 2025 at 11:56 AM
To: Jørn Åne de Jong <jorn.dejong AT letswifi.eu>, geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
Date: Friday, 21 November 2025 at 11:56 AM
To: Jørn Åne de Jong <jorn.dejong AT letswifi.eu>, geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
|
You don't often get email from geteduroam AT lists.geant.org.
Learn why this is important
|
> Please confirm with `git status` that all PHP files in letswifi-portal
are unmodified.
are unmodified.
I ran git status and I can confirm that there are no modifications to any PHP files in our letswifi-portal copy.
> Can you download an eap-config file
from the web UI (it's the same effect as with the shell script) and see
if it has the same problem?
from the web UI (it's the same effect as with the shell script) and see
if it has the same problem?
I have tried that, and I have confirmed that the downloaded file has the same issue. This means that the file is being
returned with an additional line no matter how it is downloaded.
> However, are you sure it's a newline at the start? It could also be a
UTF8 BOM.
UTF8 BOM.
I checked the bytes of the downloaded file
with the command
“od -c <file>”.
There is a “\r” and
a “\n” character
before the first XML tag, so It’s
a carriage return and a newline causing the issue.
This was the first line of the output:
0000000 \r \n < ? x m l v e r s i o n =
I also re-tried my test where I log what the sap-config api endpoint is returning in PHP, taking extra care to print just the first character. And the value of $payload returned by the API endpoint definitely starts with an XML tag, as it should.
So that means that the issue is likely introduced by apache.
I will continue to troubleshoot.
—
|
From: geteduroam-request AT lists.geant.org <geteduroam-request AT lists.geant.org> on behalf of Jørn Åne de Jong <geteduroam AT lists.geant.org>
Date: Friday, 21 November 2025 at 6:44 AM
To: geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
Date: Friday, 21 November 2025 at 6:44 AM
To: geteduroam AT lists.geant.org <geteduroam AT lists.geant.org>
Subject: Re: Issues using the geteduroam IoS app with self-hosted letswifi service
[You don't often get email from geteduroam AT lists.geant.org. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]
On 20/11/2025 06:18, "Jamie Getty" (via geteduroam Mailing List) wrote:
> I assume this is because of an issue with the generated XML
>
> So my next step was to capture the output of geteduroam.sh into a file, then
> validating that file against the eap-metadata.xsd, and it had a blank line at
> the start.
> This caused this error:
>
> output.xml:2: parser error : XML declaration allowed only at the start of the
> document
> <?xml version="1.0" encoding="utf-8"?>
>
> Is this the reason that the geteduroam app is failing to parse our XML?
It is indeed required to have the document start with <?xml, without any
whitespace in front.
However, are you sure it's a newline at the start? It could also be a
UTF8 BOM.
> I also added an extra log to the file www/api/eap-config/index.php to see what
> the XML output is, but there was no empty line as the start of the output.
> So I suspect this means that somewhere between the index.php script generating
> output and our apache2 server returning it, a starting newline is added.
>
> This is a new issue that was a result of me trying to recreate the deployed
> letswifi-portal a second time, so I would assume this is an issue with our
> deployment.
> How should I troubleshoot this?
Please confirm with `git status` that all PHP files in letswifi-portal
are unmodified. If any of the PHP files was modified to include a BOM
before <?php, it could cause errors.
If the PHP code is unmodified and the error still occurs, I'm at a loss
on what could have happened here. Can you download an eap-config file
from the web UI (it's the same effect as with the shell script) and see
if it has the same problem?
--
Jørn Åne de Jong
geteduroam
On 20/11/2025 06:18, "Jamie Getty" (via geteduroam Mailing List) wrote:
> I assume this is because of an issue with the generated XML
>
> So my next step was to capture the output of geteduroam.sh into a file, then
> validating that file against the eap-metadata.xsd, and it had a blank line at
> the start.
> This caused this error:
>
> output.xml:2: parser error : XML declaration allowed only at the start of the
> document
> <?xml version="1.0" encoding="utf-8"?>
>
> Is this the reason that the geteduroam app is failing to parse our XML?
It is indeed required to have the document start with <?xml, without any
whitespace in front.
However, are you sure it's a newline at the start? It could also be a
UTF8 BOM.
> I also added an extra log to the file www/api/eap-config/index.php to see what
> the XML output is, but there was no empty line as the start of the output.
> So I suspect this means that somewhere between the index.php script generating
> output and our apache2 server returning it, a starting newline is added.
>
> This is a new issue that was a result of me trying to recreate the deployed
> letswifi-portal a second time, so I would assume this is an issue with our
> deployment.
> How should I troubleshoot this?
Please confirm with `git status` that all PHP files in letswifi-portal
are unmodified. If any of the PHP files was modified to include a BOM
before <?php, it could cause errors.
If the PHP code is unmodified and the error still occurs, I'm at a loss
on what could have happened here. Can you download an eap-config file
from the web UI (it's the same effect as with the shell script) and see
if it has the same problem?
--
Jørn Åne de Jong
geteduroam
-
Issues using the geteduroam IoS app with self-hosted letswifi service,
Jamie Getty, 11/20/2025
- Re: Issues using the geteduroam IoS app with self-hosted letswifi service, Stefan Paetow, 11/20/2025
-
Re: Issues using the geteduroam IoS app with self-hosted letswifi service,
Jørn Åne de Jong, 11/20/2025
-
Re: Issues using the geteduroam IoS app with self-hosted letswifi service,
Jamie Getty, 11/20/2025
-
Re: Issues using the geteduroam IoS app with self-hosted letswifi service,
Jamie Getty, 11/20/2025
- Re: Issues using the geteduroam IoS app with self-hosted letswifi service, Jamie Getty, 11/21/2025
-
Re: Issues using the geteduroam IoS app with self-hosted letswifi service,
Jamie Getty, 11/20/2025
-
Re: Issues using the geteduroam IoS app with self-hosted letswifi service,
Jamie Getty, 11/20/2025
Archive powered by MHonArc 2.6.24.
