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

KeyError: 'domops' #32

Closed
secretkloud opened this issue Aug 12, 2019 · 28 comments
Closed

KeyError: 'domops' #32

secretkloud opened this issue Aug 12, 2019 · 28 comments
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@secretkloud
Copy link

[2019-08-12 14:51:00,396] fb2cal INFO (main) Fetching all Birthdays via async endpoint...
[2019-08-12 14:51:04,866] fb2cal INFO (get_async_birthdays) Processing birthdays for month August.
[2019-08-12 14:51:07,053] fb2cal ERROR (parse_birthday_async_output) KeyError: 'domops'
Traceback (most recent call last):
File "./fb2cal.py", line 437, in parse_birthday_async_output
birthday_card_html = json_response['domops'][0][3]['__html']
KeyError: 'domops'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./fb2cal.py", line 770, in
main()
File "./fb2cal.py", line 111, in main
birthdays = get_async_birthdays(browser)
File "./fb2cal.py", line 395, in get_async_birthdays
birthdays_for_month = parse_birthday_async_output(browser, response.text)
File "./fb2cal.py", line 445, in parse_birthday_async_output
raise SystemError
SystemError

@mobeigi mobeigi added the question Further information is requested label Aug 13, 2019
@mobeigi
Copy link
Owner

mobeigi commented Aug 13, 2019

Hmm somebody else had this issue too. Could you please rerun the tool with DEBUG level logging in config.ini and email me the results please?

@secretkloud
Copy link
Author

Sure. Will send to you ASAP...

@mobeigi mobeigi added the bug Something isn't working label Aug 13, 2019
@mobeigi
Copy link
Owner

mobeigi commented Aug 13, 2019

Thanks for debug logs. It seems your browser prefers web.facebook.com over www.facebook.com. Redirects using requests are followed but sometimes the AJAX endpoints return one object with a redirect which should be followed.

Redirect example:

for (;;);{"redirect":"https:\/\/www.facebook.com\/async\/birthdays\/?date=1572591600&fb_dtsg_ag=SNIP"}

Should be an easy fix but it would be nice for you to test it also!

@mobeigi mobeigi added this to the 1.0.3 milestone Aug 13, 2019
@secretkloud
Copy link
Author

I'm not very good with coding. Basically still a noob. What steps should I take to test your suggestion?

@mobeigi
Copy link
Owner

mobeigi commented Aug 15, 2019

I can create a custom version for you that follows the redirect links for you but it would be good for you to test it. When I have some spare time of course :)

@secretkloud
Copy link
Author

I can test it, definitely, when you have time. I appreciate it...

@secretkloud
Copy link
Author

So, I edited your script by changing all the FB www to web and it works now.

Thanks for this script. I can finally leave FB...

@mobeigi mobeigi modified the milestones: 1.0.3, 1.0.4 Aug 24, 2019
@mobeigi mobeigi modified the milestones: 1.0.4, 1.1.0 Jan 25, 2020
@cggaurav
Copy link

cggaurav commented Apr 9, 2020

Same

[2020-04-09 19:49:52,040] fb2cal INFO (get_async_birthdays) Processing birthdays for month April.
[2020-04-09 19:49:53,498] fb2cal ERROR (parse_birthday_async_output) KeyError: 'domops'
Traceback (most recent call last):
  File "src/fb2cal.py", line 443, in parse_birthday_async_output
    birthday_card_html = json_response['domops'][0][3]['__html']
KeyError: 'domops'

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Hi @mobeigi

Attached is a DEBUG log for you to help assist with the problem. Appreciate what you are doing to solve this for all users.

fb2cal.log

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

Hi @mobeigi

Attached is a DEBUG log for you to help assist with the problem. Appreciate what you are doing to solve this for all users.

fb2cal.log

Can you try this workaround suggested by @secretkloud?

So, I edited your script by changing all the FB www to web and it works now.

Thanks for this script. I can finally leave FB...

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Hi @mobeigi

Already tried that. Attached debug after running the program with the changes suggested.

fb2cal.log

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

@Link2Adi It looks like your username/password is not correct? Make sure your username/password is correct.

When you visit https://www.facebook.com/login.php do you get redirected to another Facebook subdomain?

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Hi @mobeigi

The username/password is correct. I have also tried using a app specific password to try and both of these password work for authenticating Facebook login.

However when I change www.facebook.com to web.facebook.com, I get authentication error.

I get redirected to https://web.facebook.com/login.php?_rdc=1&_rdr when trying to login through the link you shared.

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

@Link2Adi

I say that because I saw this in your error logs:
fb2cal ERROR (facebook_authenticate) Failed to authenticate with Facebook with email 8099282428. Please check provided email/password.

However, I see you've logged in successfully but other calls are failing. You need to change all occurrences of www.facebook.com to web.facebook.com in the script. There should be 6 changes in total. I think you didn't change them all which meant you were not authenticated for some of the http requests.

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

It seems for some users, it forces them to use web.facebook.com instead of www.facebook.com. I should probably update the script to autodetect this.

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Thanks let me know if there is anything I need to test for you.

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

@Link2Adi

I say that because I saw this in your error logs:
fb2cal ERROR (facebook_authenticate) Failed to authenticate with Facebook with email 8099282428. Please check provided email/password.

However, I see you've logged in successfully but other calls are failing. You need to change all occurrences of www.facebook.com to web.facebook.com in the script. There should be 6 changes in total. I think you didn't change them all which meant you were not authenticated for some of the http requests.

I opened the script and did a replace al forl www.facebook.com to web.facebook.com

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

I don't think you've done it properly @Link2Adi . Either you didn't replace all the occurrences or you didn't put your email/password in the settings correctly. Please check again carefully, the logs show either the login failing or the links not being updated.

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Hi @mobeigi

I tried again. Rechecked that all 6 of the www.facebook.com references in code has been replace with web.facebook.com.

With the app specific password, I get the same error as earlier.

[2020-05-05 13:53:58,819] fb2cal ERROR (facebook_authenticate) Failed to authenticate with Facebook with email Link2Adi.Singh@gmail.com. Please check provided email/password.

With original account password, I get the following error before it fails:

[2020-05-05 13:50:20,447] fb2cal ERROR (facebook_authenticate) Hit Facebook security checkpoint. Please login to Facebook manually and follow prompts to authorize this device.

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

Hi @Link2Adi

App specific passwords will not work, this tool does not use Facebook API. It has to be your original Facebook password. Also it looks like you have had too many failed log in attempts and you will have to manually log out and into Facebook in your browser and reset your password.

See:
https://github.com/mobeigi/fb2cal#caveats

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

Hi @mobeigi

I assume the problem is that Facebook is not showing me any option to authorize the device for logging in.

After every unsuccessful attempt, I get a security login, I provide the necessary details and that's it. No option to authorize the device.

Am I missing something here?

@mobeigi
Copy link
Owner

mobeigi commented May 5, 2020

@Link2Adi
If you get the security checkpoint, you simply have to login. Are you running this script on the computer you usually access Facebook with? Avoid running it on a server or with a VPN etc as that will trigger the Facebook checkpoint more often as a security measure.

Another thing to try is wait a few days (i.e. 3 days) and try again. Some people have had success with that after many failed login attempts with the script.

@Link2Adi
Copy link

Link2Adi commented May 5, 2020

@mobeigi

Yes I am running the on the same PC I use to access my FB account daily.

Will try to wait 3 days and run the script again. Will keep you informed on how it goes.

Thanks

@Allen0620
Copy link

hi @mobeigi
i encountered same situation, and i have tried changing all www to web, but it didnt work.
[2020-05-07 11:40:24,924] fb2cal INFO () Starting fb2cal v1.0.4 (Production) [https://git.io/fjMwr]
[2020-05-07 11:40:24,924] fb2cal INFO () This project is released under the GPLv3 license.
[2020-05-07 11:40:24,925] fb2cal INFO (main) Attemping to parse config file config.ini...
[2020-05-07 11:40:24,925] fb2cal INFO (main) Config successfully loaded.
[2020-05-07 11:40:24,926] fb2cal INFO (main) Logging level set to: INFO
[2020-05-07 11:40:24,926] fb2cal INFO (main) Attemping to authenticate with Facebook...
[2020-05-07 11:40:29,604] fb2cal INFO (main) Successfully authenticated with Facebook.
[2020-05-07 11:40:29,604] fb2cal INFO (main) Fetching all Birthdays via async endpoint...
[2020-05-07 11:40:29,606] fb2cal INFO (get_async_birthdays) Processing birthdays for month May.
[2020-05-07 11:40:30,887] fb2cal ERROR (parse_birthday_async_output) KeyError: 'domops'
Traceback (most recent call last):
File "src/fb2cal.py", line 443, in parse_birthday_async_output
KeyError: 'domops'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "src/fb2cal.py", line 815, in
File "src/fb2cal.py", line 117, in main
File "src/fb2cal.py", line 401, in get_async_birthdays
File "src/fb2cal.py", line 451, in parse_birthday_async_output
SystemError
fb2cal.log

@mobeigi
Copy link
Owner

mobeigi commented May 18, 2020

Hey @Allen0620, I'm not too sure how to fix this as it never occurs for me. I need someone to help me test this properly.

I've added a debug line to the latest version of the code:
da812fd

I need people to run this version with DEBUG logging enabled. See Troubleshooting section in readme for details.

@TeaWolf
Copy link

TeaWolf commented Jul 5, 2020

I had this same problem. Without changing any of the www.facebook.com occurrences in the script. It was removing 2-factor authentication on my account which did the trick. (Reactivated it after running)

@mobeigi mobeigi modified the milestones: 1.1.0, 1.2.0 Jul 7, 2020
@mobeigi
Copy link
Owner

mobeigi commented Nov 12, 2020

@Link2Adi @Allen0620 Hello, I just want to say the script is updated now using a completely new method for data retrieval. This issue should not happen again. I'm not sure if you ever solved the problem so just letting you know.

@secretkloud
Copy link
Author

secretkloud commented Nov 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants