problems with Install GeoLite2 database

Windows related discussion about netjukebox
Post Reply
1islandguy
User
Posts: 7
Joined: Wed Jan 02, 2019 12:46 pm

problems with Install GeoLite2 database

Post by 1islandguy » Sat Jan 05, 2019 1:15 am

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

User avatar
wbartels
netjukebox developer
Posts: 810
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: problems with Install GeoLite2 database

Post by wbartels » Sat Jan 05, 2019 10:14 am

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 ;-)

User avatar
wbartels
netjukebox developer
Posts: 810
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: problems with Install GeoLite2 database

Post by wbartels » Sat Jan 05, 2019 1:02 pm

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);

1islandguy
User
Posts: 7
Joined: Wed Jan 02, 2019 12:46 pm

Re: problems with Install GeoLite2 database

Post by 1islandguy » Sat Jan 05, 2019 1:41 pm

that done the trick

Post Reply