stephanlensky / hyacinth

A Discord bot to send notifications for marketplace (Craigslist, Facebook) postings based on complex matching rules.
https://slensky.com/hyacinth
GNU Affero General Public License v3.0
45 stars 8 forks source link

Could not find local geospatial data. Please download gadm36_USA.gpkg and cities1000.txt to use local geocoding. #63

Closed Andreww9 closed 10 months ago

Andreww9 commented 10 months ago

I have the bot running and showing that it is online on discord. But when I create a new search and un-pause notifications, I still never get a notification for a new listing. Any info on how to get it working properly would be greatly appreciated.

KenwoodFox commented 10 months ago

Im also not seeing any more notifications on the latest build in main, do you see anything at all in your logs?

Andreww9 commented 10 months ago

The following is my most recent log. Bare with me as I am not an experienced with this program.

Traceback (most recent call last): File "/app/hyacinth/monitor.py", line 95, in __safe_poll_search listings = await search_spec.plugin.get_listings(search_spec.search_params, after_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/plugins/marketplace/plugin.py", line 38, in get_listings return await get_listings(search_params, after_time, limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/plugins/marketplace/client.py", line 27, in get_listings async for listing in search: File "/app/plugins/marketplace/client.py", line 78, in _search await _enrich_listing(listing) File "/app/plugins/marketplace/client.py", line 94, in _enrich_listing location = reverse_geotag((listing.latitude, listing.longitude)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/hyacinth/util/geo.py", line 41, in reverse_geotag return _reverse_geotag_local(geotag) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/hyacinth/util/geo.py", line 151, in _reverse_geotag_local geolocator = get_local_geolocator() ^^^^^^^^^^^^^^^^^^^^^^ File "/app/hyacinth/util/geo.py", line 147, in get_local_geolocator return LocalReverseGeocoder() ^^^^^^^^^^^^^^^^^^^^^^ File "/app/hyacinth/util/geo.py", line 82, in init self.ensure_geospatial_datasets_downloaded() File "/app/hyacinth/util/geo.py", line 114, in ensure_geospatial_datasets_downloaded raise FileNotFoundError( FileNotFoundError: Could not find local geospatial data. Please download gadm36_USA.gpkg and cities1000.txt to use local geocoding.

stephanlensky commented 10 months ago

👋 Hi, thanks for providing those logs.

I forgot to include a section for this part of the setup in the documentation, but I just updated it with some new instructions. Could you give it a look here and let me know if that resolves the issue?

Andreww9 commented 10 months ago

I am now getting another error after updating these things. It is as follows:

[+] Building 0.0s (0/0) docker:default [+] Running 3/0 ✔ Container hyacinth-db-1 Running 0.0s ✔ Container hyacinth-browserless-1 Running 0.0s ✔ Container hyacinth-service-1 Created 0.0s Attaching to hyacinth-service-1 hyacinth-service-1 | hyacinth-service-1 | Current Python version (3.11.4) is not allowed by the project (>=3.12,<3.13). hyacinth-service-1 | Please change python executable via the "env use" command. hyacinth-service-1 | error: Recipe run failed on line 37 with exit code 1 hyacinth-service-1 exited with code 1

I have python 3.12.0 installed. So not sure why it is giving me the error. Also I believe you need to update the code in "Configuring your environment" section on your website. I believe the .env file code does not have the two following lines.

HYACINTH_USE_LOCAL_GEOCODER=true HYACINTH_GOOGLE_GEOCODING_API_KEY=

Thank you for working through this.

stephanlensky commented 10 months ago

Also I believe you need to update the code in "Configuring your environment" section on your website. I believe the .env file code does not have the two following lines.

The section I linked you to is on the same page as that "Configuring your environment" section (directly below actually) - I'm hoping that makes it clear that it is a mandatory setup step.

It's not as simple as just adding those two lines to the .env file shown above, since different people may want to configure this differently.

If anyone else ends up here because they are confused about this though, maybe I can revisit and rearrange the docs.

I am now getting another error after updating these things. It is as follows:

[+] Building 0.0s (0/0) docker:default [+] Running 3/0 ✔ Container hyacinth-db-1 Running 0.0s ✔ Container hyacinth-browserless-1 Running 0.0s ✔ Container hyacinth-service-1 Created 0.0s Attaching to hyacinth-service-1 hyacinth-service-1 | hyacinth-service-1 | Current Python version (3.11.4) is not allowed by the project (>=3.12,<3.13). hyacinth-service-1 | Please change python executable via the "env use" command. hyacinth-service-1 | error: Recipe run failed on line 37 with exit code 1 hyacinth-service-1 exited with code 1

I have python 3.12.0 installed. So not sure why it is giving me the error.

This is related to the version of Python in the Hyacinth Docker container, not on your host machine. I updated the container recently to include Python 3.12, but you will need to rebuild it in order to see the change. Try

docker-compose build service

before running the container again. In general, you should rebuild the container every time you update the code.

To keep this issue focused on a single topic, let's open a new issue if you run into any other problems. I'll close this one for now.