New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
visit:locate has stopped working #1002
Comments
Hey @cnxsoft Inside your |
@acelaya thanks for looking into it. |
I'm not being able to reproduce the issue. Using your file (and others I have tried) the buildEpoch param comes as an integer, and therefore, it doesn't fail. Can you try opening the file $meta = $this->geoLiteDbReader->metadata();
if ($this->buildIsTooOld($meta->buildEpoch)) {
$this->downloadNewDb(true, $mustBeUpdated, $handleProgress);
} And change it like this? $meta = $this->geoLiteDbReader->metadata();
+ var_dump($meta);
if ($this->buildIsTooOld($meta->buildEpoch)) {
$this->downloadNewDb(true, $mustBeUpdated, $handleProgress);
}
Then run the command again. It should print something like this, together with the regular command output:
Then share that output here. |
This is what the output looks like:
` |
I'm wondering why the GeoLite2 library is parsing the buildEpoch as a string. According to their docs it's an integer. I'll report it to them. Thanks for your help 🙂 |
@cnxsoft since I'm not sure when will we hear from MaxMind, I would suggest this workaround for now: Add an explicit cast to int in the line I shared above: - if ($this->buildIsTooOld($meta->buildEpoch)) {
+ if ($this->buildIsTooOld((int) $meta->buildEpoch)) {
$this->downloadNewDb(true, $mustBeUpdated, $handleProgress);
} In next version I will include something similar with a bit of validation and error handling, but in your case, this should solve the problem until next release is available. |
How Shlink is set-up
Summary
Current behavior
When I run the command to update the location it returns an error.
sudo -u www-data php7.4 /srv/www/cnx-software.com/shlink/bin/cli visit:locate
Argument 1 passed to
Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater::buildIsTooOld() must be
of the type int, string given, called in
/srv/www/cnx-software.com/shlink/module/CLI/src/Util/GeolocationDbUpdat
er.php on line 55
Expected behavior
It should update the location without error.
How to reproduce
Run the command above. I have a cron job, and it stopped working after January 31st, 12:00.
Thank you.
The text was updated successfully, but these errors were encountered: