-
Notifications
You must be signed in to change notification settings - Fork 50
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
PC API login/auth errors starting 11/17/2021 #20
Comments
+1 with the exact same errors starting on 11/17/2021 |
Thx for verifying @khite1983 ... good in a way to know it's not specific/limited to me. Maybe chuck a Support case in as well. (Unfortunately they didn't give me a case # for you to reference ... just an email thread, where I commented just now about your confirmation that this is broken.) I'm dusting off my Plaid credentials & exploring that as an alternative if PC Support doesn't engage. |
Same issue here as well. |
Looks like update in cloudflare, a small homepage structure change, and API payloads. My solution here (new dependency added, cloudscraper): pull request #21 |
same issue. |
Dumb question: how do I incorporate your changes before your PR is approved?
…On Sat, Nov 20, 2021 at 1:36 PM UnusualPi ***@***.***> wrote:
Looks like update in cloudflare, a small homepage structure change, and
API payloads. My solution here (new dependency added, cloudscraper
<https://github.com/VeNoMouS/cloudscraper>) #21
<#21>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEWS5DRVP5DMAWEPA5SYXVTUNAIE7ANCNFSM5IMRH7SQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@ianvanhoven it really depends on your implementation, but you'll definitely have to install cloudscraper. For the code changes in the personalcapital.py file, you could either edit directly in your python site-packages directory or you could just download the file, include in your script directory, and make the modifications on that file. I'd recommend the latter, when you use import in python it looks for files in the same directory before looking in site-packages. Hope that helps! |
Thanks, @UnusualPi. I applied your fix and it resolved the login error issue on my end. I had to upgrade a couple of required package versions to make it fully work though. Thanks again for the solution! |
Was about to come here and make a similar pull request! Thanks for making this. For those coming along trying to fix this for themselves, run the following (assuming you're using requirements.txt):
Note that there are breaking changes, such as |
Thanks @UnusualPi ... still at a loss on this :( Any additional
suggestion/guidance appreciated.
I made your changes directly in...
/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py
...re-confirmed I have cloudscraper...
% sudo pip install cloudscraper
Requirement already satisfied: cloudscraper in
/usr/local/lib/python3.4/site-packages (1.2.58)
Requirement already satisfied: pyparsing>=2.4.7 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (2.4.7)
Requirement already satisfied: requests>=2.9.2 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (2.20.0)
Requirement already satisfied: requests-toolbelt>=0.9.1 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (0.9.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(3.0.4)
Requirement already satisfied: idna<2.8,>=2.5 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(2.7)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(2019.9.11)
...but getting the following error when executing my script...
% tail -0f log/2021/wx.log.202112.ad.err
[Wed Dec 1 09:29:50 2021] ERROR: Package import failure; exiting...
[Wed Dec 1 09:29:50 2021] ERROR: invalid syntax (__init__.py, line 202)
^C
...with __init__.py containing the following...
% cat __init__.py
from .personalcapital import PersonalCapital, RequireTwoFactorException,
TwoFactorVerificationModeEnum
...yet seeing the following (seemingly good) in STDOUT when running script
w/ verbose logging...
% python -v wx.ad.py
[ ... ]
# code object from
/usr/local/lib/python3.4/site-packages/personalcapital/__init__.py
# created
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/__init__.cpython-34.pyc'
# wrote
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/__init__.cpython-34.pyc'
# code object from
/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py
# created
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/personalcapital.cpython-34.pyc'
# wrote
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/personalcapital.cpython-34.pyc'
# destroy cloudscraper
# destroy personalcapital.personalcapital
# destroy personalcapital
[ ... ]
…On Sun, Nov 21, 2021 at 7:14 AM UnusualPi ***@***.***> wrote:
@ianvanhoven <https://github.com/ianvanhoven> it really depends on your
implementation, but you'll definitely have to install cloudscraper. For the
code changes in the personalcapital.py file, you could either edit directly
in your python site-packages directory
<https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory>
or you could just download the file, include in your script directory,
and make the modifications on that file
<https://csatlas.com/python-import-file-module/>. I'd recommend the
latter, when you use import in python it looks for files in the same
directory before looking in site-packages. Hope that helps!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEWS5DXBW63BU7SSFVSLC7LUNEED7ANCNFSM5IMRH7SQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
LOL ... so took a wild guess that my old OpenBSD box where I host this
script is just in some janky state -- and so I ported the script to a very
recently-created AWS EC2 instance.
*Good news: *no more pkg import errors :)
*Bad news:* cloudscraper.exceptions.CloudflareChallengeError: Detected a
Cloudflare version 2 Captcha challenge, This feature is not available in
the opensource (free) version.
Is anyone else seeing this?
…On Wed, Dec 1, 2021 at 10:05 AM Ian Van Hoven ***@***.***> wrote:
Thanks @UnusualPi ... still at a loss on this :( Any additional
suggestion/guidance appreciated.
I made your changes directly in...
/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py
...re-confirmed I have cloudscraper...
% sudo pip install cloudscraper
Requirement already satisfied: cloudscraper in
/usr/local/lib/python3.4/site-packages (1.2.58)
Requirement already satisfied: pyparsing>=2.4.7 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (2.4.7)
Requirement already satisfied: requests>=2.9.2 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (2.20.0)
Requirement already satisfied: requests-toolbelt>=0.9.1 in
/usr/local/lib/python3.4/site-packages (from cloudscraper) (0.9.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(3.0.4)
Requirement already satisfied: idna<2.8,>=2.5 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(2.7)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in
/usr/local/lib/python3.4/site-packages (from requests>=2.9.2->cloudscraper)
(2019.9.11)
...but getting the following error when executing my script...
% tail -0f log/2021/wx.log.202112.ad.err
[Wed Dec 1 09:29:50 2021] ERROR: Package import failure; exiting...
[Wed Dec 1 09:29:50 2021] ERROR: invalid syntax (__init__.py, line 202)
^C
...with __init__.py containing the following...
% cat __init__.py
from .personalcapital import PersonalCapital, RequireTwoFactorException,
TwoFactorVerificationModeEnum
...yet seeing the following (seemingly good) in STDOUT when running script
w/ verbose logging...
% python -v wx.ad.py
[ ... ]
# code object from
/usr/local/lib/python3.4/site-packages/personalcapital/__init__.py
# created
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/__init__.cpython-34.pyc'
# wrote
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/__init__.cpython-34.pyc'
# code object from
/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py
# created
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/personalcapital.cpython-34.pyc'
# wrote
'/usr/local/lib/python3.4/site-packages/personalcapital/__pycache__/personalcapital.cpython-34.pyc'
# destroy cloudscraper
# destroy personalcapital.personalcapital
# destroy personalcapital
[ ... ]
On Sun, Nov 21, 2021 at 7:14 AM UnusualPi ***@***.***>
wrote:
> @ianvanhoven <https://github.com/ianvanhoven> it really depends on your
> implementation, but you'll definitely have to install cloudscraper. For the
> code changes in the personalcapital.py file, you could either edit directly
> in your python site-packages directory
> <https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory>
> or you could just download the file, include in your script directory,
> and make the modifications on that file
> <https://csatlas.com/python-import-file-module/>. I'd recommend the
> latter, when you use import in python it looks for files in the same
> directory before looking in site-packages. Hope that helps!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#20 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEWS5DXBW63BU7SSFVSLC7LUNEED7ANCNFSM5IMRH7SQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>
|
I wonder if @haochi would be willing to assign ownership of this repo to another dev so that we could add this fix? |
Ok, I'm super close to getting this working...Getting the prompt for the verification code from Personal Capital, but when I click the 'Verify' button am getting the response: Any thoughts? thanks EDIT: It's line 74 of sensor.py
|
@elstevega You'll have to update the file you're running the main scripts in to include the additional parameter. UnusualPi's fix added an additional parameter that gets passed in and which is expected by the PersonalCapital parent class in the personalcapital module. In your case above, you're passing in the password that you get with To fix it you can modify your |
@AHARIC - thanks for the info - that did the trick. (I was close...) |
Argh, I spoke too soon. While the initial SMS validation piece now works (thanks @AHARIC ), when I reboot the HA server, it loses the connection info and kicks back the below in the log file:
That bit of code is the update from UnusualPi...code block below - any thoughts? Thanks so much in advance!!
|
@elstevega , I might be overlooking something, but judging by the Traceback infomation you pasted above, it seems like your code is still using the original version of the
That would still cause the issue that we are tracking here in this issue #20. |
No problem & thanks for your response. Uninstalled/re-installed everything just to make sure. |
Sounds good, @elstevega. And I had a brief glance of your other reply in my email inbox and from there I got some hints about what your issue might be. When you get a chance to check it again, you may want to pay attention to the two different python lib paths below:
v.s.
By default, I think pip install the packages into /user/loca/lib/python3.9/.... Make sure you replace this file in the correct lib path. I use virtualenv so my lib file is inside my You can use this command line to check the information about your pip installed personalcapital package:
Then it will give you a Location to your personalcapital package installation on your host. Hope it helps. |
Thanks @willyiwei - looks like I'm surviving reboots & all is well - thanks to all here for lending a hand. |
I was using the fork from @UnusualPi but it looks like they deleted it. I made those same changes in my own fork here: https://github.com/banool/personalcapital.. |
Starting ~2d ago (17-NOV), started getting these Personal Capital API login/auth errors...
% ./wx.ad.py ro
Traceback (most recent call last):
File "./wx.ad.py", line 60, in <module>
pc.login( pc_cred_user , pc_cred_pass ) ;
File "/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py", line 44, in login
raise Exception()
Exception
...on code from this library that has run flawlessly for well over a year...
34 def login(self, username, password):
35 initial_csrf = self.__get_csrf_from_home_page(base_url)
36 csrf, auth_level = self.__identify_user(username, initial_csrf)
37
38 if csrf and auth_level:
39 self.__csrf = csrf
40 if auth_level != AuthLevelEnum.USER_REMEMBERED:
41 raise RequireTwoFactorException()
42 self.__authenticate_password(password)
43 else:
44 raise Exception()
Is anyone else experiencing this and/or have a fix/workaround? Tried disabling 2FA, no dice. Have logged a support case with PC but not holding my breath.
Thanks!
Ian
The text was updated successfully, but these errors were encountered: