Page 1 of 1
problems with Install GeoLite2 database
Posted: Sat Jan 05, 2019 1:15 am
by 1islandguy
everything seems to work flawlessly i can transcode and zip so im not sure why i get this error
Exec error
Command: E:\bin\unzip -oj "E:\server\htdocs\box\temp\geolite2\GeoLite2-Country-CSV.zip" -d "E:\server\htdocs\box\temp\geolite2\"
System output: Archive: E:/server/htdocs/box/temp/geolite2/GeoLite2-Country-CSV.zip
PHP Version 5.6.39
mysqlnd 5.0.11
Re: problems with Install GeoLite2 database
Posted: Sat Jan 05, 2019 10:14 am
by wbartels
I can reproduce the error with Windows 10 on VirtualBox.
When pasting the unzip command on the CMD prompt you see an invalid double quote!
Code: Select all
C:\Users\test>C:\bin\unzip -oj "C:\xampp\htdocs\netjukebox\temp\geolite2\GeoLite2-Country-CSV.zip" -d "C:\xampp\htdocs\netjukebox\temp\geolite2\"
Archive: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-CSV.zip
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-de.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/COPYRIGHT.txt
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-en.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-zh-CN.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/README.txt
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-ja.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/LICENSE.txt
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-es.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-fr.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Blocks-IPv6.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-pt-BR.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Locations-ru.csv
error: cannot create C:/xampp/htdocs/netjukebox/temp/geolite2"/GeoLite2-Country-Blocks-IPv4.csv
The last backslash is seen as an escape character for double quote.
When removing the last backslash everything works, see below.
Code: Select all
C:\Users\test>C:\bin\unzip -oj "C:\xampp\htdocs\netjukebox\temp\geolite2\GeoLite2-Country-CSV.zip" -d "C:\xampp\htdocs\netjukebox\temp\geolite2"
Archive: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-CSV.zip
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-de.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/COPYRIGHT.txt
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-en.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-zh-CN.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/README.txt
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-ja.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/LICENSE.txt
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-es.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-fr.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Blocks-IPv6.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-pt-BR.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Locations-ru.csv
inflating: C:/xampp/htdocs/netjukebox/temp/geolite2/GeoLite2-Country-Blocks-IPv4.csv
I will come with a bugfix later
Re: problems with Install GeoLite2 database
Posted: Sat Jan 05, 2019 1:02 pm
by wbartels
Here is a dirty workaround, I will come with a better solution later.
Replace line 299 from geolite2.php
Code: Select all
$cmd = str_replace('%destination', escapeCmdArg(NJB_GEOLITE2_DIR), $cmd);
With
Code: Select all
// $cmd = str_replace('%destination', escapeCmdArg(NJB_GEOLITE2_DIR), $cmd);
$cmd = str_replace('%destination', escapeCmdArg(rtrim(NJB_GEOLITE2_DIR, '/')), $cmd);
Re: problems with Install GeoLite2 database
Posted: Sat Jan 05, 2019 1:41 pm
by 1islandguy
that done the trick