zachowj / xfinity-data-usage

Fetch Xfinity data usage and serve it via an HTTP endpoint, publish it to MQTT or post it to an URL.
https://hub.docker.com/r/zachowj/xfinity-data-usage
MIT License
54 stars 14 forks source link

Unable to pull data usage Browser Error: Error: Execution context was destroyed, most likely because of a navigation. #14

Closed ltloopy closed 3 years ago

ltloopy commented 3 years ago

Fetches appeared to stop working a few days ago, It looks like comcast updated their pages. When I log into my xfinity account i am greeted with a message "Welcome to the new Xfinity account! We're continually improving to make things easier, faster, and more personalized so you get the most value out of your services every day."

docker log output:

-- Config -- Xfinity Update every 240 mins Http server will be started Will publish to MQTT (Home Assistant) on new data

Fetching Data Loading (https://customer.xfinity.com) http server started Browser Error: Error: Execution context was destroyed, most likely because of a navigation. Next fetch in 240 minutes @ 10:19:31 PM

Config file I am using

xfinity: username: password: interval: 240

http:

mqtt: host: port: 1883 topic: xfinity homeassistant: prefix: "homeassistant"

genem2 commented 3 years ago

As well... Xfinity may be making this more trouble than it's worth...

-- Config --
Xfinity Update every 480 mins
Http server will be started
Will publish to MQTT (Home Assistant) on new data
--------
Fetching Data
Loading (https://customer.xfinity.com)
http server started
Browser Error: Error: Execution context was destroyed, most likely because of a navigation.

Next fetch in 480 minutes @ 4:23:19 PM
rousslabs commented 3 years ago

Waiting for the page title to load has fixed this issue. I have submitted a pull request #15 with the updates.

mitchatmcc commented 3 years ago

Xfinity has hit me up for password resets on this a few times in the past few weeks. I can't tell if it's because the interval is steady (I have mine set to 739 minutes) or if the script does something funny that sets them off.

Any insight into how I can either tell them it's fine, or modify something in the container to offset?

genem2 commented 3 years ago

Side note: I noticed the password reset stuff this morning, too, then noticed this issue in the log. I reset my pwd (to the same), and so far today, it's been holding. Let's get this fix in; maybe we'll be ok.

janssenjones commented 3 years ago

I pulled the latest image with I think what had the "wait" merged, and I still have the same "Browser Error: Error: Execution context was destroyed, most likely because of a navigation." error, so I don't think that fixed it. I haven't had a successful query in over a week.

genem2 commented 3 years ago

So far, the lastest looks good:

Fetching Data
Loading (https://customer.xfinity.com)
http server started
Page Title: Manage My Xfinity Account
Loading Usage https://customer.xfinity.com/apis/services/internet/usage
Page Title: Manage My Xfinity Account
Loading Usage https://customer.xfinity.com/apis/services/internet/usage
Data updated
Updating MQTT
Next fetch in 480 minutes @ 4:45:06 PM

Maybe that double "Page Title: Manage My Xfinity Account" entry is an indication of this fix at work. Time will tell. When the next password-reset request shows up, I'm likely giving up with them.

zachowj commented 3 years ago

https://github.com/zachowj/xfinity-data-usage/pull/15#issuecomment-827293312

janssenjones commented 3 years ago

Actually, I just restarted my Docker host for patching, and when this ran on the next cycle, it successfully pulled data for the first time in over a week, so I guess this did work for me after all. :) Fingers crossed that Comcast doesn't break it again.

janssenjones commented 3 years ago

Well, I'm back to just getting failures on the 0.9.1 Docker image:

--------
Fetching Data
Loading (https://customer.xfinity.com)
http server started
Browser Error: Error: Execution context was destroyed, most likely because of a navigation.
Next fetch in 60 minutes @ 11:41:55 AM

Not sure why it briefly worked, but it now just throws that error every time.

genem2 commented 3 years ago

Not great here, either.

-- Config --
Xfinity Update every 480 mins
Http server will be started
Will publish to MQTT (Home Assistant) on new data
--------
Fetching Data
Loading (https://customer.xfinity.com)
http server started
Browser Error: Error: Protocol error (DOM.resolveNode): Node with given id does not belong to the document

Next fetch in 480 minutes @ 5:05:22 PM
mitchatmcc commented 3 years ago

Restarting the container sometimes works, sometimes doesn't. I haven't been able to pin down what the discrepancy is. From what's reported here, it doesn't seem to be the wait times for loading, but that honestly couldn't hurt.

zachowj commented 3 years ago

Give v0.9.2 a try, it's still throwing errors but seems to work more often than not.

janssenjones commented 3 years ago

Still not working for me. Tried 4 restarts of the container. First time, I got:

Fetching Data
Loading (https://customer.xfinity.com)
http server started
Page Title:  XFINITY | My Account | EcoBill® Online Bill Pay
Loading Usage https://customer.xfinity.com/apis/services/internet/usage
Browser Error: Error: net::ERR_ABORTED at https://customer.xfinity.com/apis/services/internet/usage
Next fetch in 720 minutes @ 1:47:16 AM

Then back to

Browser Error: Error: Execution context was destroyed, most likely because of a navigation.

Also had to do the password reset overnight. :( Thanks for the continued work on it, though!

genem2 commented 3 years ago

Seems to have worked ok for me:

--------
Fetching Data
Loading (https://customer.xfinity.com)
http server started
Page Title: Sign in to Xfinity
Loading Usage https://customer.xfinity.com/apis/csp/account/me/services/internet/usage?filter=internet
Not logged in
Loading (https://customer.xfinity.com)
Page Title: Manage My Xfinity Account
Loading Usage https://customer.xfinity.com/apis/csp/account/me/services/internet/usage?filter=internet
Data updated
Updating MQTT
Next fetch in 480 minutes @ 6:54:09 PM
janssenjones commented 3 years ago

Actually, maybe I was still stuck on the 0.9.1 image, as I wasn't able prune it. I restarted Docker, and re-ran, and this time it processed, so maybe things are looking up! Thanks again!

mitchsurp commented 3 years ago

0.9.2 ran and successfully updated usage. So far so good.

zachowj commented 3 years ago

I have been running 0.9.2 for over 24 hours on a 20-minute cycle and it hasn't failed once. I am going to close this, for now. Create a new issue for new errors.