Skip to Content.
Sympa Menu

geteduroam - Re: Issues using the geteduroam IoS app with self-hosted letswifi service

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


Chronological Thread  
  • 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
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=reannz.co.nz; dmarc=pass action=none header.from=reannz.co.nz; dkim=pass header.d=reannz.co.nz; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ub4lTpbVIQibUW3H5WYsHRIqax5P5zA4IAfmSlKNWqg=; b=M9DUbOq8YdmZspb8UomfDDqpbFi8m824kkmlaLVSXkm3Sg7cDO1DVq8lrjuwi4dZkK8+alCUhDp79hgA7kbToqbtzq5alXFoWgwSQg8zXL1Dfa6zf4YlA693/E0CxGGjZYNGQr5BTva4QiJEHmqfYBsaqAXkMqMvSi1y/q665IEManCShCGsw1gsbCs/qgL8ckPUPKtKw/w9KchBRCWHL0JWYTageJ0Tx2P2gg61PBJJJ7XZUCtMuQByf5E6V6+HFNNhm47OT4ZjRncrBGc0vcY0o5S5Uwqv/7W3/k9cR8wK2limEYLWtFT6MJKNVU2RO0CmgBEIjGrpu0RjPhh31g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ydx5ctsF9tCmkCJdhMagezms6CP0EsQ6ry/8QzkJPiM4INNIC53kGcVM6BNOX4zTgGKzRzaJ51QawnGVOLGVVVgNBVRrm49MdUrGtUhYZNvrC1YtXl9mQxa05qzyNmVOraSfXIIPHBRYtjQSvWZr9miuv7xX+2HJNentUWC9Bl3R6CtxJ/ACWm7BDmNgCBQoofOvJHQJNFgFh/Rm/3/0GTV5WIkDuqJ1hZT5UUfTV/VnSM6J6H6FvGtcgxjm6fR8qW104k4CAsvMKhCBb2Wj0hEnqEHrzJzxKUCR8mxkUTVI35zjcC1cuIX6Xxjv86EPGFbTI2x2sEfmPy49XcnsqQ==
  • Authentication-results: mail.geant.org; dkim=pass (1024-bit key; unprotected) header.d=reannz.co.nz header.i= AT reannz.co.nz header.a=rsa-sha256 header.s=selector1 header.b=Sz3AxdVK; dkim-atps=neutral
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=reannz.co.nz;

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!



— 

Jamie Getty

DevOps Engineer

 

 

Image

 

Jamie.Getty AT reannz.co.nz

                 

Research and Education
Advanced Network New Zealand

    


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

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.

— 

Jamie Getty

DevOps Engineer

 

 

Image

 

Jamie.Getty AT reannz.co.nz

                 

Research and Education
Advanced Network New Zealand

    


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

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.

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?

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.

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 Its 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.


— 

Jamie Getty

DevOps Engineer

 

 

Image

 

Jamie.Getty AT reannz.co.nz

                 

Research and Education
Advanced Network New Zealand

    


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

[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




Archive powered by MHonArc 2.6.19+.

Top of Page