observerss / pygodaddy

3rd Party Client Library for Manipulating Go Daddy DNS Records.
https://pygodaddy.readthedocs.org/
Other
37 stars 30 forks source link

Can't login anymore #12

Open claneys opened 9 years ago

claneys commented 9 years ago

Hi,

either on python 2.7 or 3, i can not login anymore with pygodaddy module. It return false and i have no more clue why.

Thanks to help.

PointP commented 9 years ago

i too had connection problems for 10 hours. It seems like something to do with godaddy and its unstable services. After 10 hours of agony, module works to normal.

getSurreal commented 9 years ago

Mine started failing yesterday and hasn't recovered yet. It runs hourly.

On 6/17/2015 9:10 PM, PointP wrote:

i too had problems with connection for 10 hours. It seems like it is something to do with godaddy and its unstable services. After 10 hours of agony, module works back as before.

— Reply to this email directly or view it on GitHub https://github.com/observerss/pygodaddy/issues/12#issuecomment-113011380.

xMAC94x commented 9 years ago

My last succesfull Domain Record change was on 2015-06-17 4am, Since 2015-06-18 4am it fails everyday

getSurreal commented 9 years ago

I had mine running from the cron.hourly schedule which was running at 01 minutes of every hour so it's not just 00 they're blocking. I was able to manually run it at other minutes in the hour. Maybe they tracked IPs logging in at the same time over and over and blocked that specific time. Who knows. Hopefully using your random setting will help out a lot. Thanks for that.

On 6/19/2015 12:30 AM, PointP wrote:

@getSurreal https://github.com/getSurreal i experience same thing during 2015-06-18 01:00:09,524 Until now. After I test few things around, i noticed that they cut down 00 minutes connection. Which by the way, very stupid move from goDaddy. I changed my crontab setting to something like following and it works just fine. Try it.

/10 * * * \ sleep $(expr $RANDOM \% 90); /.../godaddy-dyndns.sh

P.S. you don't have to use random delay on.

— Reply to this email directly or view it on GitHub https://github.com/observerss/pygodaddy/issues/12#issuecomment-113379600.

PointP commented 9 years ago

I noticed that many deals with none-working script recently. I told few people about random timing and killing connection from godaddy earier. However, it turns out something little bit different from what I originally thought.

Here is what is going on with script.

When you use login function from client.py, it goes to "r = self.session.get(self.default_url)" default_url is "https://dns.godaddy.com/default.aspx" and if you try to connect this address with anything (web browser and so on...) first connection is always returns the error.

Probably, many already see something like this in their running:

"requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError ..."

This is part where goDaddy just kill your connection.

So how come some of lucky ones able to keep use this script?

If you execute same script one more time right after the first one, it will work just fine. I think "they" store request information and verify it for next connection until around 15 minutes(not fully tested... around that area for sure) or so.

That is why "hourly" people just simply not worked at all... I feel sorry to you guys...

Here is what i come up with

I would do something like this in client.py line 99

    for i in range(0, 10):
        while True:
            try:
                r = self.session.get(self.default_url)
            except:
                time.sleep(1)
                continue
            break

instead of

    r = self.session.get(self.default_url)

As you can see, it is just looping until connection works. That is very much all of it

Good luck to all.

getSurreal commented 9 years ago

Thanks for that update recommendation. Wouldn't it also be better to only login if the record actually needs to be updated?

Thanks, James

On Jun 23, 2015, at 4:22 AM, PointP notifications@github.com wrote:

I noticed that many deals with none-working script recently. I told few people about random timing and killing connection from godaddy earier. However, it turns anout something little bit different from what i originally thought.

Here is what is going on with script.

When you use login function fro client.py, it goes to "r = self.session.get(self.default_url)" and default_url is "https://dns.godaddy.com/default.aspx" and if you try to connect this address with anything (webbrowser and so on...) first connection is always returns the error.

Probably, many already see something like this in their running:

"requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError ..."

This is part where goDaddy just kill your connection.

So how come some of lucky ones able to keep use this script?

If you execute same script one more time right after the first one, it will work just fine. I think they store request infomation and vertify it for next connection for around 10 minutes(not fully tested... around that area for sure) or so.

That is why "hourly" people just simply not worked at all... I feel sorry to you guys...

Here is what i come up with

I would do something like this in client.py line 99

for i in range(0, 10):
    while True:
        try:
            r = self.session.get(self.default_url)
        except:
            time.sleep(1)
            continue
        break

instead of

r = self.session.get(self.default_url)

As you can see, it is just looping until connection works. That is very much all of it

Good luck to all.

— Reply to this email directly or view it on GitHub.

PointP commented 9 years ago

@getSurreal Yeap it does that already. Update suggestion line is connection verification part of login function. Cheers.

getSurreal commented 9 years ago

@PointP when I was getting failures every hour, my IP had not changed so that makes me believe it tries to login every time.

Thanks, James

On Jun 23, 2015, at 8:40 PM, PointP notifications@github.com wrote:

@getSurreal Yeap it does that already. Update suggestion line is connection verification part of login function. Cheers.

— Reply to this email directly or view it on GitHub.

ggogel commented 9 years ago

Hey,

I'm trying to set up an update script for hours until i found this issue thread. I edited the client.py as @PointP suggested, but authentification is still not working for me. Any suggestions to fix this issue? I recently moved to godaddy and dyndns would be really nice.

Thanks in advance

ggogel commented 9 years ago

This is how I solved it: Log into godaddy with a browser on pc with the same external ip as the server and then run the script. Now pygodaddy can login and change the A record. To keep it up working, i think you have to run the script every 5min or so. It's working with and without the suggested fix from @PointP.

PointP commented 9 years ago

@gerrit507 sorry for late reply on your comment. Tour approach is valid as well. For me, validation time is longer than 5 minutes. Well anyway main idea is run script twice in a row

ggogel commented 9 years ago

@PointP run script twice in a row does not work for me. I had to log into godaddy in a browser via the same external ip as the server has, otherwise there was no authentifaction possible via the script, even with 10 attempts in a row. Maybe somebody can reproduce this issue...

dawg6 commented 9 years ago

Even after logging in from web browser, the script is failing. I've tried running multiple times as well, to no avail. This just started happening for me within the last 24 hours (8/21/15).

Edit: here is the output showing where it is failing now.

ERROR:pygodaddy.client:Login routine broken, godaddy may have updated their login mechanism
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pygodaddy/client.py", line 101, in login
    viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
runnerway commented 9 years ago

@dawg6 Same problem here!

antst commented 9 years ago

Same problem. godaddy definitely changed their login mechanism. Does somebody maintain this code nowadays?

iwanttobefreak commented 9 years ago

Same problem

ghost commented 9 years ago

I have updated my code and got it working with the new login mechanism, I've forked the repo and updated the code to work. I am in Australia and I've noticed the URL's I used have region information in them, you may want to update this to use your region in 'client.py'. I've left comments of what has been changed.

https://github.com/BryceGough/pygodaddy

antst commented 9 years ago

Can confirm that it works! Thanks!

iwanttobefreak commented 9 years ago

Thank you BryceGough!!! It works.

claneys commented 9 years ago

Getting the same code as BryceGough... Thanks ! Make a pull request to fix this upstream.

trkadi commented 9 years ago

Well, how to get this to work?

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning

trkadi commented 9 years ago

Ah..

"InsecurePlatformWarning New in version 1.11.

Certain Python platforms (specifically, versions of Python earlier than 2.7.9) have restrictions in their ssl module that limit the configuration that urllib3 can apply. In particular, this can cause HTTPS requests that would succeed on more featureful platforms to fail, and can cause certain security features to be unavailable.

If you encounter this warning, it is strongly recommended you upgrade to a newer Python version, or that you use pyOpenSSL as described in the OpenSSL / PyOpenSSL section.

If you know what you are doing and would like to disable this and other warnings, please consult the InsecureRequestWarning section for instructions on how to handle the warnings."

trkadi commented 9 years ago

Here I post my ipUpdate.py what I refreshed to python3 (because of that "InsecurePlatformWarning").

#!/usr/bin/env python3
# -*- coding:utf8 -*-
import logging
import pif
import pygodaddy
logging.basicConfig(filename='godaddy.log', format='%(asctime)s %(message)s', level=logging.INFO)
GODADDY_USERNAME="egyetemijegyzet"
GODADDY_PASSWORD="pRoVisT@66"
client = pygodaddy.GoDaddyClient()
client.login(GODADDY_USERNAME, GODADDY_PASSWORD)
logging.debug("Started: before 'for'")
for domain in client.find_domains():
    dns_records = client.find_dns_records(domain)
    # Old ip..
    old_ip = list(dns_records)[0].value
    # 'New' ip!
    public_ip = pif.get_public_ip()
    # Some loggings and printing
    logging.debug("Domain '{0}' DNS records: {1}".format(domain, old_ip))
    print("Domain '{0}' DNS records: {1}".format(domain, old_ip))
    if public_ip != old_ip:
        if client.update_dns_record(domain, public_ip):
            logging.info("Domain '{0}' public IP set to '{1}'".format(domain, public_ip))
            print ("Domain '{0}' public IP set to '{1}'".format(domain, public_ip))
        else:
            pass # What to do here? ..
    else:
        logging.info("No update needed.")
        print ("No update needed.")
bodak commented 9 years ago

Remove your password :)

trkadi commented 9 years ago

Yeah thanks, maybe minus zero people want to steal this domain name but yeah :) I changed my pass to a cooler one. I owe you a beer! :P

mitchmania commented 8 years ago

Heads up @adamt1988 your issue is about InsecurePlatformWarning is probably unrelated. You need to pip install requests[security]. That should fix your problem. Depending on your platform you may need dependencies like openssl-devel and libffi-devel (CentOS).

mitchmania commented 8 years ago

Also, Thank you @claneys, you keep my network running and saved me a lot of time!!!!!!

frol commented 8 years ago

@observerss Could you please merge @BryceGough's patch to the upstream and release a new version?

pretyman commented 8 years ago

@observerss :+1: Please merge https://github.com/observerss/pygodaddy/pull/13

denzuko commented 8 years ago

@adamt1988 thanks for your password. btw does it work with your email and fb too?