Core 153 - no output from country.cgi


After upgrading to Core 153, ‘country.cgi’ shows only a blank list of ‘Country Codes and Flags’:

And each time /var/log/httpd/error_log tells me:

Usage: Location::database_countries(db) at /srv/web/ipfire/cgi-bin/country.cgi line 56.

Can anyone confirm?



Hi Matthias,

i can confirm the blank list and the error in the httpd log.


+1. confirmed.

I am curious, what WebGUI page gets you to country.cgi?   EDIT: found it!

FYI - history repeats!

Same here.


Usage: Location::database_countries(db) at /srv/web/ipfire/cgi-bin/country.cgi line 56.


Hi all,

for the records: I can confirm this as well and will take care of it…

EDIT #1: This issue is tracked as bug #12560.

EDIT #2: There is a patch available solving this issue for me. It would be great if anybody could confirm. :slight_smile:

Thanks, and best regards,
Peter Müller


Hi @pmueller,

Confirmed I have the same problem, applied the patch and can confirm that the problem is solved. :+1:


Confirmed. Your patch solves it. Thanks!

[But why did this take so long…!? :joy: ]

Serious: I didn’t expect that someone would fix this bug so fast. Respect!

@jon: its tricky to find, but… :wink:

Regardless of everything else, I wish everyone a peaceful merry chrismas.
Take care!


1 Like

For the less informed, can you help me apply the patch through an ssh connection?


This is relatively simple:

  1. Open IPFire-GUI - Choose SYSTEM / SSH access
  2. Choose Stop SSH demon in 15 minutes
  3. Start PuTTY or similar SSH-program.
  4. Connect to your IPFire-PC: root + YOUR_PASSWORD
  5. cd to /srv/web/ipfire/cgi-bin
  6. Choose an editor - e.g., nano (available as addon)
  7. Start (e.g.) nano country.cgi
  8. Change line 56 from my @countries = &Location::database_countries(); to my @countries = &Location::Functions::get_locations();
  9. Save and exit (for nano: CTRL-X, Yes, ENTER)
  10. Done.


1 Like

Disco. I was trying to use the patch function. This was a simpler way. Thanks for the assist! :vulcan_salute:

You’re welcome! :wink:

Hi @eggman,

Just for future use, especially if the diff has more lines with changes, here is the patch command to use.

patch -b /srv/web/ipfire/cgi-bin/country.cgi -i /tmp/country.cgi-fix-location-function-call.diff 
  • The -b tells patch to make a backup of the file before patching it.
  • The next part is the original file location. This can be missed out and patch will use the information from the patch file but in this case the patch had the build location in it. So specifying the original file location solves that. This only works if there is only one file to be patched in the diff file.
  • the -i path/file specifier is where you have placed the diff file. I used scp to copy it into the /tmp directory on my IPFire.
1 Like

Much appreciated. That makes sense. This community is always so supportive. I am thankful to have joined.

1 Like

Hello, I applied the patch and country.cgi is working as intended; however, my rules which involve country filtering still fail.
Is this related?
Removing the country restriction on the firewall rule reinstates the services as intended,

Sorry for my ignorance, but which menu item will lead me to this faulty webpage?

I’ve entered it manually but so far I could not spot a menu path that uses the URL:

It works of course after applying the path path, did it manually, though, but I’m stil lcurious to find the menu :wink:

1 Like

Forget it, found the soultion in another thread: I’ve to click on the flag Icon in firewall logs by country…


I can confirm this issue as well.


This worked for me. Many thanks

Its works well now. Thanks.Matthias.


thanks, Roberto - but the main credits go to Peter - he wrote the patch.

1 Like