juftin / camply

camply, the campsite finder ⛺️ - a tool to find campsites at sold out campgrounds through sites like recreation.gov
https://juftin.com/camply/
MIT License
468 stars 90 forks source link

cannot search on ReserveCalifornia #264

Closed Liang-KS closed 1 year ago

Liang-KS commented 1 year ago

Describe the bug

I upgraded to 0.24.2 today, but I found out I cannot run the same command to search on Reserve California anymore. Don't know if it's related to my raspberryPi because I tried the same commands on another x86 Ubuntu with Camply 0.24.2, everything worked.

I tried remove camply 0.24.2 and its dependencies and re-installed camply again, problem is still there. Also tried install older version, same issue.

Original Camply Command (with --debug)

pi@raspberrypi:~ $ camply --debug campsites --provider ReserveCalifornia --campground 406 --campground 408 --campground 409 --start-date 2023-06-09 --end-date 2023-07-01 --day Saturday --notifications pushover --polling-interval 5 --search-forever

Expected behavior expect to search the campsites on ReserveCalifornia, the command worked before upgrade.

Console Output (with --debug)

[2023-06-06 15:38:38] CAMPLY camply, the campsite finder ⛺️ [2023-06-06 15:38:38] DEBUG Setting up camply debugging [2023-06-06 15:38:38] DEBUG Camply Version: 0.24.2 [2023-06-06 15:38:38] DEBUG Python Version: 3.9.2 [2023-06-06 15:38:38] DEBUG Platform: linux [2023-06-06 15:38:38] INFO Using Camply Provider: "ReserveCalifornia" [2023-06-06 15:38:38] INFO 3 booking nights selected for search, ranging from 2023-06-10 to 2023-06-24 [2023-06-06 15:38:38] INFO Searching for booking nights on Saturday [2023-06-06 15:38:39] ERROR No Campsites Found Matching Your Search Criteria [2023-06-06 15:38:39] CAMPLY Exiting camply 👋

Additional context

Don't know if it's related to my raspberryPi because I tried the same commands on another x86 Ubuntu with Camply 0.24.2, everything worked.

juftin commented 1 year ago

hmm... 🤔 I made big changes very recently to ReserveCalifornia in versions >= 0.23.0 so I'm very cautious about bugs, it's possible. The test here would be to try it with camply<0.23.0

But I'm not able to replicate this. Camply searches as expected, doesn't find a site, and waits 5 minutes.

❯ camply --debug campsites --provider ReserveCalifornia --campground 406 --campground 408 --campground 409 --start-date 2023-06-09 --end-date 2023-07-01 --day Saturday --notifications pushover --polling-interval 5 --search-forever
[2023-06-06 17:10:00] CAMPLY   camply, the campsite finder ⛺️
[2023-06-06 17:10:00] DEBUG    Setting up camply debugging
[2023-06-06 17:10:00] DEBUG    Camply Version: 0.24.1
[2023-06-06 17:10:00] DEBUG    Python Version: 3.9.16
[2023-06-06 17:10:00] DEBUG    Platform: darwin
[2023-06-06 17:10:00] INFO     Using Camply Provider: "ReserveCalifornia"
[2023-06-06 17:10:00] INFO     3 booking nights selected for search, ranging from 2023-06-10 to 2023-06-24
[2023-06-06 17:10:00] INFO     Searching for booking nights on Saturday
[2023-06-06 17:10:00] INFO     Searching for campsites every 5 minutes.
[2023-06-06 17:10:00] INFO     Notifications active via: <SilentNotifications>, <PushoverNotifications>
[2023-06-06 17:10:00] INFO     Searching across 3 campgrounds
[2023-06-06 17:10:00] INFO         ⛰  Angel Island SP (#614) - 🏕  East Bay (sites 1-3) (#406)
[2023-06-06 17:10:00] INFO         ⛰  Angel Island SP (#614) - 🏕  Ridge (sites 4-6) (#408)
[2023-06-06 17:10:00] INFO         ⛰  Angel Island SP (#614) - 🏕  Sunrise (sites 7-9) (#409)
[2023-06-06 17:10:00] INFO     Searching East Bay (sites 1-3), Angel Island SP (406) for availability: June, 2023
[2023-06-06 17:10:00] DEBUG    Starting new HTTPS connection (1): calirdr.usedirect.com:443
[2023-06-06 17:10:00] DEBUG    https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None
[2023-06-06 17:10:00] INFO             ⛺️      2 total sites found in month of June
[2023-06-06 17:10:00] INFO     Searching Ridge (sites 4-6), Angel Island SP (408) for availability: June, 2023
[2023-06-06 17:10:00] DEBUG    https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None
[2023-06-06 17:10:00] INFO             ❌       0 total sites found in month of June
[2023-06-06 17:10:00] INFO     Searching Sunrise (sites 7-9), Angel Island SP (409) for availability: June, 2023
[2023-06-06 17:10:01] DEBUG    https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None
[2023-06-06 17:10:01] INFO             ⛺️      3 total sites found in month of June
[2023-06-06 17:10:01] INFO     ❌ ❌ ❌ ❌ 0 Reservable Campsites Matching Search Preferences
[2023-06-06 17:10:01] INFO     No Campsites were found, we'll continue checking
Liang-KS commented 1 year ago

Hi Juftin,

thanks for the comment, may I ask if there is a way to fully reinitialize the camply environment on my raspberryPi just like a fresh deployment? I was thinking about maybe some cache files somewhere were affecting my search, so I removed the packages and reinstalled them but no luck.

juftin commented 1 year ago

pipx uninstall camply + pipx install camply is the best option I can think of. Can you just paste your entire terminal output, I'm interested in the command and output.

There actually are "cache" files for ReserveCalifornia. They're saved alongside the package so should disappear during a re-install. They would be in the providers/usedirect folder. So in my case they're at ~/.local/pipx/venvs/camply/lib/python3.11/site-packages/camply/providers/usedirect/ReserveCalifornia/ since I use pipx to run camply. Those files contain all the campgrounds / rec area data for ReserveCalifornia - and they would refresh every 24 hours.

Liang-KS commented 1 year ago

Hi Juftin,

thanks for letting me know the cache file location. Please see below, after I removed all the cache files, I was able to perform the search without ERROR. I think something went wrong during the data refresh. Don't know if it was a website issue or my network issue.

Again, thanks a lot for your help!!!


pi@raspberrypi:~ $ camply --debug campsites --provider ReserveCalifornia --campground 406 --campground 408 --campground 409 --start-date 2023-06-09 --end-date 2023-07-01 --day Saturday --notifications pushover --polling-interval 5 --search-forever [2023-06-06 16:54:46] CAMPLY camply, the campsite finder ⛺️ [2023-06-06 16:54:46] DEBUG Setting up camply debugging [2023-06-06 16:54:46] DEBUG Camply Version: 0.24.2 [2023-06-06 16:54:46] DEBUG Python Version: 3.9.2 [2023-06-06 16:54:46] DEBUG Platform: linux [2023-06-06 16:54:46] INFO Using Camply Provider: "ReserveCalifornia" [2023-06-06 16:54:46] INFO 3 booking nights selected for search, ranging from 2023-06-10 to 2023-06-24 [2023-06-06 16:54:46] INFO Searching for booking nights on Saturday [2023-06-06 16:54:46] ERROR No Campsites Found Matching Your Search Criteria [2023-06-06 16:54:46] CAMPLY Exiting camply 👋 pi@raspberrypi:~ $

pi@raspberrypi:~/.local/lib/python3.9/site-packages/camply/providers/usedirect/ReserveCalifornia $ rm cityparks.json facilities.json filters.json places.json

pi@raspberrypi:~/.local/lib/python3.9/site-packages/camply/providers/usedirect/ReserveCalifornia $ camply --debug campsites --provider ReserveCalifornia --campground 406 --campground 408 --campground 409 --start-date 2023-06-09 --end-date 2023-07-01 --day Saturday --notifications pushover --polling-interval 5 --search-forever [2023-06-06 16:58:04] CAMPLY camply, the campsite finder ⛺️ [2023-06-06 16:58:04] DEBUG Setting up camply debugging [2023-06-06 16:58:04] DEBUG Camply Version: 0.24.2 [2023-06-06 16:58:04] DEBUG Python Version: 3.9.2 [2023-06-06 16:58:04] DEBUG Platform: linux [2023-06-06 16:58:04] INFO Using Camply Provider: "ReserveCalifornia" [2023-06-06 16:58:04] INFO 3 booking nights selected for search, ranging from 2023-06-10 to 2023-06-24 [2023-06-06 16:58:04] INFO Searching for booking nights on Saturday [2023-06-06 16:58:04] DEBUG Refreshing UseDirect Metadata: filters.json [2023-06-06 16:58:04] DEBUG Starting new HTTPS connection (1): calirdr.usedirect.com:443 [2023-06-06 16:58:04] DEBUG https://calirdr.usedirect.com:443 "GET /rdr/rdr/search/filters HTTP/1.1" 200 None [2023-06-06 16:58:04] DEBUG Refreshing UseDirect Metadata: cityparks.json [2023-06-06 16:58:04] DEBUG https://calirdr.usedirect.com:443 "GET /rdr/rdr/fd/citypark HTTP/1.1" 200 None [2023-06-06 16:58:05] DEBUG Refreshing UseDirect Metadata: places.json [2023-06-06 16:58:05] DEBUG https://calirdr.usedirect.com:443 "GET /rdr/rdr/fd/places HTTP/1.1" 200 None [2023-06-06 16:58:05] DEBUG Refreshing UseDirect Metadata: facilities.json [2023-06-06 16:58:05] DEBUG https://calirdr.usedirect.com:443 "GET /rdr/rdr/fd/facilities HTTP/1.1" 200 None [2023-06-06 16:58:05] INFO Searching for campsites every 5 minutes. [2023-06-06 16:58:06] INFO Notifications active via: , [2023-06-06 16:58:06] INFO Searching across 3 campgrounds [2023-06-06 16:58:06] INFO ⛰ Angel Island SP (#614) - 🏕 East Bay (sites 1-3) (#406) [2023-06-06 16:58:06] INFO ⛰ Angel Island SP (#614) - 🏕 Ridge (sites 4-6) (#408) [2023-06-06 16:58:06] INFO ⛰ Angel Island SP (#614) - 🏕 Sunrise (sites 7-9) (#409) [2023-06-06 16:58:06] INFO Searching East Bay (sites 1-3), Angel Island SP (406) for availability: June, 2023 [2023-06-06 16:58:06] DEBUG https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None [2023-06-06 16:58:06] INFO ⛺️ 2 total sites found in month of June [2023-06-06 16:58:06] INFO Searching Ridge (sites 4-6), Angel Island SP (408) for availability: June, 2023 [2023-06-06 16:58:07] DEBUG https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None [2023-06-06 16:58:07] INFO ❌ 0 total sites found in month of June [2023-06-06 16:58:07] INFO Searching Sunrise (sites 7-9), Angel Island SP (409) for availability: June, 2023 [2023-06-06 16:58:08] DEBUG https://calirdr.usedirect.com:443 "POST /rdr/rdr/search/grid HTTP/1.1" 200 None [2023-06-06 16:58:08] INFO ⛺️ 3 total sites found in month of June [2023-06-06 16:58:08] INFO ❌ ❌ ❌ ❌ 0 Reservable Campsites Matching Search Preferences [2023-06-06 16:58:08] INFO No Campsites were found, we'll continue checking

juftin commented 1 year ago

Oh! That's great news. Did you happen to see if they looked like legit json files? Maybe it was just a network hiccup when the files were being generated in the first place. Still, that's frustrating. Sorry about that, I'll try to come up with a better way to identify that and resolve it automatically in the future.

Liang-KS commented 1 year ago

oops, I deleted via command line, so I'm not able to recover those json files anymore.

but I will check again once I hit the issue again!!

one idea can be shared is maybe add "--force-refresh-metadata" as an option for debug.

thanks for your hard work, this project is absolutely awesome!!!

juftin commented 1 year ago

Closing this as resolved for now - will reopen later if it comes up.