[3.3][RC] Filter by country - version 1.0.18

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

MarkDHamill wrote:
Wed Jul 31, 2019 2:41 pm
That is strange. Does the unknown line show in the report?
You mean the "by adding "echo"? That shows nothing, just an empty space.

I also have lots of error in the error log since this morning.

Code: Select all

[Wed Jul 31 09:18:15.729638 2019] [proxy_fcgi:error] [pid 19480:tid 139785205102336] [client 2a02:a44d:e962:1:5db8:d86f:419a:3b6c:44604] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: internal corruption of phar "/var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz" (truncated entry) in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:182\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(182): PharData->__construct('./store/phpbbse...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/cron/task/update_country_database.php(60): phpbbservices\\filterbycountry\\core\\common->download_maxmind(true)\n#2 [internal function]: phpbbservices\\filterbycountry\\cron\\task\\update_country_database->run()\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/phpbb/cron/task/wrapper.php(104): call_user_func_array(Array, Array)\n#4 /var/www/vhosts/solidjeuh.be/httpdocs/cron.php(78): phpbb\\cron\\task\\wrapper->__call('run', Array)\n#5 {main}\n  thrown in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbb...\n', referer: https://www.solidjeuh.be/arcade.php?mode=play&g=6932
[Wed Jul 31 12:41:33.724566 2019] [proxy_fcgi:error] [pid 19586:tid 139785247061760] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:36068] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./store/phpbbse...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n'
[Wed Jul 31 13:18:50.821984 2019] [proxy_fcgi:error] [pid 19990:tid 139785247061760] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:35784] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: internal corruption of phar "/var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz" (truncated entry) in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:182\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(182): PharData->__construct('./store/phpbbse...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/cron/task/update_country_database.php(60): phpbbservices\\filterbycountry\\core\\common->download_maxmind(true)\n#2 [internal function]: phpbbservices\\filterbycountry\\cron\\task\\update_country_database->run()\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/phpbb/cron/task/wrapper.php(104): call_user_func_array(Array, Array)\n#4 /var/www/vhosts/solidjeuh.be/httpdocs/cron.php(78): phpbb\\cron\\task\\wrapper->__call('run', Array)\n#5 {main}\n  thrown in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbb...\n', referer: https://www.solidjeuh.be/
[Wed Jul 31 14:24:29.524857 2019] [proxy_fcgi:error] [pid 30564:tid 139785414899456] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:53614] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/index.php
[Wed Jul 31 14:26:11.483409 2019] [proxy_fcgi:error] [pid 19990:tid 139785278531328] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:56342] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: internal corruption of phar "/var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz" (truncated entry) in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:182\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(182): PharData->__construct('./store/phpbbse...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/cron/task/update_country_database.php(60): phpbbservices\\filterbycountry\\core\\common->download_maxmind(true)\n#2 [internal function]: phpbbservices\\filterbycountry\\cron\\task\\update_country_database->run()\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/phpbb/cron/task/wrapper.php(104): call_user_func_array(Array, Array)\n#4 /var/www/vhosts/solidjeuh.be/httpdocs/cron.php(78): phpbb\\cron\\task\\wrapper->__call('run', Array)\n#5 {main}\n  thrown in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbb...\n', referer: https://www.solidjeuh.be/
[Wed Jul 31 16:09:24.600691 2019] [proxy_fcgi:error] [pid 30564:tid 139785289021184] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:58042] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/
[Wed Jul 31 16:14:35.362271 2019] [proxy_fcgi:error] [pid 19480:tid 139785194612480] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:38858] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/viewonline.php
[Wed Jul 31 16:14:40.534731 2019] [proxy_fcgi:error] [pid 19990:tid 139785310000896] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:39278] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/
[Wed Jul 31 16:17:34.569427 2019] [proxy_fcgi:error] [pid 19481:tid 139785215592192] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:44086] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:183\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(183): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/
[Wed Jul 31 16:42:28.334764 2019] [proxy_fcgi:error] [pid 19990:tid 139785247061760] [client 2a02:a03f:54ed:c600:49a3:1f1:a374:1fd6:51826] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: internal corruption of phar "/var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz" (truncated entry) in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:182\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(182): PharData->__construct('./store/phpbbse...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/cron/task/update_country_database.php(60): phpbbservices\\filterbycountry\\core\\common->download_maxmind(true)\n#2 [internal function]: phpbbservices\\filterbycountry\\cron\\task\\update_country_database->run()\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/phpbb/cron/task/wrapper.php(104): call_user_func_array(Array, Array)\n#4 /var/www/vhosts/solidjeuh.be/httpdocs/cron.php(78): phpbb\\cron\\task\\wrapper->__call('run', Array)\n#5 {main}\n  thrown in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbb...\n', referer: https://www.solidjeuh.be/arcade.php
And cron is not running
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

Okay, so this is a clue. It's failing here in /core/common.php:

Code: Select all

		$p = new \PharData($database_gz_file_path);
So the .gz file downloaded from MaxMind looks corrupt or maybe not wholly received.

If the short term you can removed the entire /store/phpbbservices/filterbycountry folder and try again, after first resetting the cron. There may be a .lock file in the /store folder that will have to be removed.

I may need to add logic to check for the UnexpectedValueException exception.

I'm also curious what you get from this query (assuming phpbb_ is your table prefix):

Code: Select all

SELECT distinct country_code FROM `phpbb_fbc_stats` WHERE 1 
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

I removed the folder and file, cron still not running. Tried manual, also nothing, It's always in the "crons ready to start".

Database give:

Code: Select all

Displaying records 0 - 24 (41 total, Query took 0.0011 seconds.)
SELECT distinct country_code FROM `phpbb_fbc_stats` WHERE 1 
And a few others that wont start because of it ...
Image

Image
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

Okay, I think I see the issue. Some lines of code got duplicated. Must have pasted twice.

Try this bug fix:

https://github.com/MarkDHamill/filterby ... f7c826bb2a

To unfreeze the crons, I think you need to remove any .lock files in the /store directory, set the value of cron_lock in the phpbb_config table to 0 then purge the cache.

Also remove the /store/phpbbservices/filterbycountry folder.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

Done everything. The same crons from previous image are still on hold. Even when I click "run", they are still on hold.
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

I wish I was more of a help on unlocking crons. I think they are locked if the config_value is not zero:

Code: Select all

SELECT * FROM `phpbb_config` WHERE `config_name` LIKE '%lock%' 
Changing them to 0 and purging the cache has worked for me in the past. It seems like .lock files can also be an issue if they are in the /store folder and not removed.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

Looking into this some more, I think one issue is that whenever a cron is run, if a cron does not report that it was run successfully, it locks up all crons, with the symptom being that in the phpbb_config table, the row with cron_lock in it won't be 0. I created a download_maxmind() function that returns true if it succeeds and false if it doesn't. If it doesn't succeed, appropriate error messages are either displayed, logged, or both. So I think run() function in /cron/task/update_country_database.php needs to be something like this:

Code: Select all

	public function run()
	{

		// Updates the MaxMind country database via a phpBB cron

		// Destroy current database, then download, ungzip, untar and stage an updated database. In cron mode, errors are placed in the admin log
		// and the function will return true if it succeeds and false if an error happened.
		$this->helper->download_maxmind(true);

		// If for some reason downloading MaxMind fails, let's not lock up crons. So let's always return true.
		return true;

	}
More testing is needed.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

You can see my changes to the cron program here:

https://github.com/MarkDHamill/filterby ... 3521d5cb63

I accidentally published the .idea/workspace.xml file, so the one to look at is cron/task/update_country_database.php at the bottom of the page.

If cron errors are happening, you should do the following in phpMyAdmin (change the table prefix if needed):

Code: Select all

UPDATE `phpbb_config` set config_value = 0 where config_name = 'cron_lock' 
Afterward purge the cache. I think this will unfreeze crons and others should start running.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

That's not working here. I needed to set Run periodic tasks of system cron to NO in server settings, and then run the cron manually via /bin/phpbbcli.php cron:run. All crons are active again. I now installed your ext again, let's see what it does now.... :D
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

That makes sense. Sorry for all the hassles!
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

I'll try to release version 1.0.5-RC today. There is one small language change in /language/en/common.php:

From:

Code: Select all

	'ACP_FBC_REQUIREMENTS'				=> 'To install this extension, both the PHP curl extension and the allow_url_fopen directive must be enabled. The following PHP extensions are required: curl, dom and Phar. This extension works with phpBB 3.2 only.',
to:

Code: Select all

	'ACP_FBC_REQUIREMENTS'				=> 'To install this extension, the allow_url_fopen directive must be enabled. The following PHP extensions are required: curl, dom and Phar. This extension works with phpBB 3.2 only.',
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.5

Post by MarkDHamill »

New release candidate. See the first post for download instructions.

Thanks for the testing. You found some new and undiscovered bugs!

Relevant changes since version 1.0.4. Full list of changes can be seen here.
  • Bug fix affecting showing of flags on the statistics report. The country code had to be lowercased to find the flag image in many web servers.
  • The .tar.gz file from Maxmind is decompressed in one step. No intermediate .tar file is created.
  • If the configuration variable containing the date that Maxmind was last downloaded is reset to 0, it is refetched
  • The cron always returns true, hopefully alleviating issues with a general phpBB cron lock if it fails.
  • If the country code returned by the Maxmind database is blank it is treated as an exception.
Last edited by MarkDHamill on Sat Aug 03, 2019 7:55 pm, edited 1 time in total.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
janus_zonstraal
Registered User
Posts: 4885
Joined: Sat Aug 30, 2014 1:30 pm

Re: [RC] Filter by country - version 1.0.5

Post by janus_zonstraal »

Thanks Mark
Sorry! My English is bat ;) !!!
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.5

Post by </Solidjeuh> »

Thank you for the update and all the work!
But it seems the GeoLite2-Country.tar.gz is still not being created

Code: Select all

[Sat Aug 03 22:23:47.074982 2019] [proxy_fcgi:error] [pid 18424:tid 139732950488832] [client 2a02:a03f:54ed:c600:70d2:344:9c1e:bd5b:44942] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Invalid argument, /var/www/vhosts/solidjeuh.be/httpdocs/store/phpbbservices/filterbycountry/GeoLite2-Country.tar.gz cannot be found in /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php:163\nStack trace:\n#0 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/core/common.php(163): PharData->extractTo('./../../../../s...')\n#1 /var/www/vhosts/solidjeuh.be/httpdocs/ext/phpbbservices/filterbycountry/event/main_listener.php(139): phpbbservices\\filterbycountry\\core\\common->download_maxmind()\n#2 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(184): phpbbservices\\filterbycountry\\event\\main_listener->filter_by_country(Object(Symfony\\Component\\EventDispatcher\\Event), 'core.user_setup...', Object(phpbb\\event\\dispatcher))\n#3 /var/www/vhosts/solidjeuh.be/httpdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\\Component\\EventDispatcher\\Event...\n', referer: https://www.solidjeuh.be/index.php?sid=4e5a67a7c377a0fd0420fd6df447fa33
The crons seems to run at the moment. I keep monitoring it
User avatar
MarkDHamill
Registered User
Posts: 4295
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.5

Post by MarkDHamill »

One thing that I haven't done is delete the /store/phpbbservices/filterbycountry/ folder when the extension is both disabled and its data is deleted. It shouldn't matter. If you delete the folder manually and go to the index or to either the extension's settings or statistics page it should force a refresh of the database. I'd try that and let me know if you still are getting an error.

Looks like I need to look for an exception though, which I am not doing, as InvalidArgumentException is being thrown in your case.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Post Reply

Return to “Extensions in Development”