Skip to content
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

[Bug]: fetch failed for source Recycle! #1716

Closed
6 of 7 tasks
Gunth opened this issue Jan 24, 2024 · 15 comments · Fixed by #3293
Closed
6 of 7 tasks

[Bug]: fetch failed for source Recycle! #1716

Gunth opened this issue Jan 24, 2024 · 15 comments · Fixed by #3293

Comments

@Gunth
Copy link

Gunth commented Jan 24, 2024

I Have A Problem With:

A specific source

What's Your Problem

Hi,
Since this morning I've an error with the Recycle! source, all entities has the state unknown.
Please look a the logs bellow for more details.

Current installed version 1.15.0

G.

Source (if relevant)

Recycle!

Logs

2024-01-24 11:54:26.937 ERROR (SyncWorker_6) [waste_collection_schedule.source_shell] fetch failed for source Recycle!:
Traceback (most recent call last):
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 134, in fetch
    entries = self._source.fetch()
              ^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/recycleapp_be.py", line 54, in fetch
    r.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.fostplus.be/recycle-public/app/v1/access-token

Relevant Configuration

waste_collection_schedule:
  sources:
    - name: recycleapp_be
      calendar_title: recycle
      args:
        postcode: ----
        street: ----
        house_number: ----
        add_events: ----
      customize:
        - type: PMD
          alias: PMC
        - type: Déchets résiduels
          alias: Résiduels
        - type: Déchets organiques
          alias: Organiques
        - type: Glass
          alias: Verre
        - type: Paper-cardboard
          alias: Papiers-Cartons

Checklist Source Error

  • Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • Checked that the website of your service provider is still working
  • Tested my attributes on the service provider website (if possible)
  • I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@welle
Copy link

welle commented Jan 24, 2024

Same here :(

@Gunth
Copy link
Author

Gunth commented Jan 24, 2024

I think that the X-Secret header value has changed, with the one bellow it's back again...

Op2tDi2pBmh1wzeC5TaN2U3knZan7ATcfOQgxh4vqC0mDKmnPP2qzoQusmInpglfIkxx8SZrasBqi5zgMSvyHggK9j6xCQNQ8xwPFY2o03GCcQfcXVOyKsvGWLze7iwcfcgk2Ujpl0dmrt3hSJMCDqzAlvTrsvAEiaSzC9hKRwhijQAFHuFIhJssnHtDSB76vnFQeTCCvwVB27DjSVpDmq8fWQKEmjEncdLqIsRnfxLcOjGIVwX5V0LBntVbeiBvcjyKF2nQ08rIxqHHGXNJ6SbnAmTgsPTg7k6Ejqa7dVfTmGtEPdftezDbuEc8DdK66KDecqnxwOOPSJIN0zaJ6k2Ye2tgMSxxf16gxAmaOUqHS0i7dtG5PgPSINti3qlDdw6DTKEPni7X0rxM

@5ila5
Copy link
Collaborator

5ila5 commented Jan 27, 2024

Fixed by #1722

This will be part of release 1.46.0 or is available now as master (git) version (3-dot menu -> redownload -> change version to master -> fully restart HA (this will increase update cycle by a lot)

@Clooos
Copy link

Clooos commented Dec 22, 2024

Hi! This issue seems to be back since a few days, can we reopen this issue?

@5ila5
Copy link
Collaborator

5ila5 commented Dec 24, 2024

@Clooos It does work for our tests cases. Does it work again on your side? Maybe a temporary outage?

@Clooos
Copy link

Clooos commented Dec 24, 2024

It's still not working for me, is it possible that I've missed a breaking change or something? I haven't updated it for a long time and I'm now on the latest release.

@5ila5
Copy link
Collaborator

5ila5 commented Dec 24, 2024

What exactly is the error message you're getting (settings -> system -> logs)

There wasn't any major changes to this source, only some handling with streets with . in the name (8 month ago) and some error message changes (5 month ago)

@Clooos
Copy link

Clooos commented Dec 25, 2024

I've already looked and I don't have any error in the logs.

My calendar entity state is off and my sensor state is unknown. I must have done something wrong but I can't find what.

@5ila5
Copy link
Collaborator

5ila5 commented Dec 25, 2024

calendar entity state is off

This only means there is no event now
Do you have any entries in the calendar tab? Did you make sure that the sensors types match the name shown in the calendar? Maybe the names changed for next year

@Clooos
Copy link

Clooos commented Dec 25, 2024

I don't have any events in the calendar tab anymore, the sensor is the correct one. My config is in YAML, but I tried to add a new config in the GUI and it's not working as well.

@5ila5
Copy link
Collaborator

5ila5 commented Dec 26, 2024

What exactly do you mean with "not working" I need more details to help. Do you see collections on the website https://www.recycleapp.be?

@Clooos
Copy link

Clooos commented Dec 26, 2024

Sorry for not having provided more details about the error I had, but by looking for my street/town on recycleapp.be, I see now a message explaining that there was some changes for my town, there is now an "old one" and a "new one", the old one doesn't provide any datas, I will check how to get the new one in HA, this is certainly the cause of my issue!

I couldn't have figured out that without your help, so thank you so much for that and for your work!

@Clooos
Copy link

Clooos commented Dec 26, 2024

I tried again and I'm unable to make it works with the new changes, I get this error: "The source returned an empty response. Please check the provided arguments and try again."

I can share my postcode in private if you want to try yourself.

But it works in recycleapp.be in combination with the town, so "postcode - town" (I just get 2 different choices for my town now, one that works and one that don't works), I realize that it's a bit difficult to explain without providing my postcode 😅

Or is there a way to find a list of all possible values for the postcode?

@5ila5
Copy link
Collaborator

5ila5 commented Dec 26, 2024

I found some post codes with the same behavior but none of them resulted in empty result (first one was the right one) but I understand the issue, and it should be fixed in #3293 which will try all entries for a zip code if multiple entries exists.

This will be part of the next release or is available now as master (git) version

install master/git: Developer tools -> actions -> select update: Install update -> click Coose entity and select WCS -> select version and type master in the input field -> run the action -> restart HA

Older versions of HACS:

install master with HACS version < 2.0: (3-dot menu -> redownload -> change version to master -> fully restart HA (this will increase update cycle by a lot)

@Clooos
Copy link

Clooos commented Dec 27, 2024

Bingo! This is now working! 🎉

Thank you so much for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants