Open joshmanders opened 3 months ago
Thanks for the report Josh
Looks like the library is failing to download a database update, are you running behind a firewall by any chance? If so, you might have to whitelist some IPs so it can reach the GitHub mirror – see the last bit of this section of the README
Let me know if that fix things up!
Affected code is here for ref: https://github.com/GitSquared/node-geolite2-redist/blob/acf9b7e98f949f9930ae44da0af52b4f4542d4c8/src/download-helpers.ts#L141
Nope no firewall afaik, it happens periodically both locally in development and in production.
+1 started getting this error today we've been working with the package for several years
@natanavra could you give me a bit more info about the environment you're running the package in?
Possible root causes include bad network access, missing write permissions on disk. I checked and the redist tarballs are properly formatted.
Today was the first redist update in 3 months, so anything that might have changed in your infra since 3 months ago might be a good lead to follow
@GitSquared No changes in infra whatsoever Amazon Linux / Ubuntu 20 + NodeJS 16-18 (several environments)
Been getting this error on several projects starting this morning
Specifically:
ENOENT: no such file or directory, rename '.../node_modules/geolite2-redist/dbs.geodownload/GeoLite2-City.mmdb' -> '.../node_modules/geolite2-redist/dbs/GeoLite2-City.mmdb'
Something very bad is going on with the db download
Getting more errors:
Checksum mismatch for GeoLite2-City
ENOENT: Cannot cd into '/home/ubuntu/server/node_modules/geolite2-redist/dbs.geodownload
@GitSquared Can you rollback the deployed version?
This is breaking the whole process right, and there isn't much that can be done, it's throwing unhandled promise rejections The whole auto-update operation should be wrapped and send out warnings instead
@natanavra I just released https://github.com/GitSquared/node-geolite2-redist/releases/tag/v3.1.0 which should improve error and filesystem handling.
Let me know if that improves stuff on your end. I couldn't manage to reproduce the issue you're having while doing some tests locally.
@GitSquared Thanks! I worked around it in the meantime by manually updating the db file in the dist folder
May I suggest adding an event listener instead of throwing an error? Or even adding a callback parameter that could be passed and called instead of throwing an error. If there's a callback - great call it If not - throw an error
Yes that's a good idea! Will implem whenever I have time.
I keep periodically getting this error. Using
geolite2-redist@3.0.4
.