-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Invalid Extended Type at offset 0 val 7 #62
Comments
Feels that your'e trying to use .gz file. I think I might add a check for this. |
Hi @runk, I updated my script to extract and them override GeoLite2-City.mmdb.
My bet is that the node file watch was trying to open the file as it was being extracted. Makes sense? Will report back tomorrow to close the issue if the fix worked in production. Thanks for the great library by the way! Sun |
I've added a check for gzip format in v2.2.0 - you can check it out. |
Hey @runk, The problem appears to be that Using a tmp file and then calling mv fixed the timing issue.
Have a great day, Sun |
A-ha! Good old race condition. |
Sorry to revive an old thread, I'm putting this as a note in case anyone else faces this issue. Opened an issue on geolite2-redist repo: GitSquared/node-geolite2-redist#5 |
Hey guys,
Using watchForUpdates : true
When I run the following:
My app crashes with errors:
"error": {
"message": "ENOENT: no such file or directory, open './GeoLite2-City.mmdb'",
"stack": "Error: ENOENT: no such file or directory, open './GeoLite2-City.mmdb'\n at Error (native)\n"
}
"error": {
"message": "Invalid Extended Type at offset 0 val 7",
"stack": "Error: Invalid Extended Type at offset 0 val 7\n at Decoder.decode (/node_modules/maxmind/lib/decoder.js:54:13)\n at new Metadata (/node_modules/maxmind/lib/metadata.js:15:26)\n at Reader.load (/node_modules/maxmind/lib/reader.js:27:19)\n at new Reader (/node_modules/maxmind/lib/reader.js:21:8)\n at ***/node_modules/maxmind/index.js:18:18\n at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)\n"
}
Once the app is reloaded, all is good.
Is this a timing issue?
Best,
Sun
The text was updated successfully, but these errors were encountered: