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

AttributeError: 'Client' object has no attribute 'provider' #10

Open
dogsbody opened this issue Dec 20, 2023 · 5 comments
Open

AttributeError: 'Client' object has no attribute 'provider' #10

dogsbody opened this issue Dec 20, 2023 · 5 comments

Comments

@dogsbody
Copy link

I am getting this error when trying to backup our DNS from ClouDNS and I've run out of things to try.

Any help would be very gratefully received.

Firstly, I have lexicon installed and working correctly...

$ export LEXICON_CLOUDNS_AUTH_PASSWORD=<REDACTED>
$ export LEXICON_CLOUDNS_AUTH_ID=<REDACTED>
$ lexicon cloudns list example.com AAAA
ID        TYPE NAME             CONTENT            TTL   
--------- ---- ---------------- ------------------ ------
391600939 AAAA host1.example.com  2001:db8:5::1     172800
391600999 AAAA host2.example.com  2001:db8:6::1     172800
391601009 AAAA host3.example.com  2001:db8:7::1     172800

But I can't get OctoDNS to do it's thing...

$ cat ./config/cloudns_test.yaml
---
providers:
  config:
    class: octodns.provider.yaml.YamlProvider
    directory: ./zones
    default_ttl: 3600
    enforce_order: True
  cloudns:
    class: octodns_lexicon.LexiconProvider
    lexicon_config:
      provider_name: cloudns
      cloudns:
        auth_id: "<REDACTED>"
        auth_password: "<REDACTED>"
zones:
  example.com.:
    sources:
      - cloudns
    targets:
      - config

... and when I run it...

$ octodns-sync --config-file=./config/cloudns_test.yaml
2023-12-20T23:06:02  [140369002215232] INFO  Manager __init__: config_file=./config/cloudns_test.yaml, (octoDNS 1.4.0)
2023-12-20T23:06:02  [140369002215232] INFO  Manager _config_executor: max_workers=1
2023-12-20T23:06:02  [140369002215232] INFO  Manager _config_include_meta: include_meta=False
2023-12-20T23:06:02  [140369002215232] INFO  Manager _config_auto_arpa: auto_arpa=False
2023-12-20T23:06:02  [140369002215232] INFO  Manager __init__: global_processors=[]
2023-12-20T23:06:02  [140369002215232] INFO  Manager __init__: global_post_processors=[]
2023-12-20T23:06:02  [140369002215232] INFO  Manager __init__: provider=config (octodns.provider.yaml 1.4.0)
2023-12-20T23:06:02  [140369002215232] INFO  LexiconProvider[cloudns] __init__: id=cloudns, token=***, account={}
2023-12-20T23:06:02  [140369002215232] INFO  Manager __init__: provider=cloudns (octodns_lexicon 0.1.dev4)
2023-12-20T23:06:02  [140369002215232] INFO  Manager sync: eligible_zones=[], eligible_targets=[], dry_run=True, force=False, plan_output_fh=<stdout>
2023-12-20T23:06:02  [140369002215232] INFO  Manager sync:   zone=example.com.
2023-12-20T23:06:02  [140369002215232] INFO  Manager sync:   sources=['cloudns']
2023-12-20T23:06:02  [140369002215232] INFO  Manager sync:   targets=['config']
Traceback (most recent call last):
  File "/home/octodns/OctoDNS-Backup/venv/bin/octodns-sync", line 8, in <module>
    sys.exit(main())
  File "/home/octodns/OctoDNS-Backup/venv/lib/python3.8/site-packages/octodns/cmds/sync.py", line 57, in main
    manager.sync(
  File "/home/octodns/OctoDNS-Backup/venv/lib/python3.8/site-packages/octodns/manager.py", line 697, in sync
    ps, d = future.result()
  File "/home/octodns/OctoDNS-Backup/venv/lib/python3.8/site-packages/octodns/manager.py", line 60, in result
    return self.func(*self.args, **self.kwargs)
  File "/home/octodns/OctoDNS-Backup/venv/lib/python3.8/site-packages/octodns/manager.py", line 442, in _populate_and_plan
    source.populate(zone, lenient=lenient)
  File "/home/octodns/OctoDNS-Backup/venv/lib/python3.8/site-packages/octodns_lexicon.py", line 90, in populate
    lexicon_client.provider.authenticate()
AttributeError: 'Client' object has no attribute 'provider'

Any leads at all as to what I am doing wrong would be VERY appreciated.

Thank you in advance

@olafz
Copy link

olafz commented Dec 28, 2023

I ran into this very same issue. It turns out that Lexicon v3.14.0 made some very significant changes. These are not (yet?) reflected in octodns-lexicon. When I downgrade dns-lexicon to version 3.13 or lower, it works.

@dogsbody
Copy link
Author

dogsbody commented Jan 3, 2024

Thank you. That fixes that error but now I have the issue of CAA records not being supported :-(

I think I'll just write my own parser for the API, this has gotten too big with OctoDNS, octodns-lexicon & Lexicon :-)

Thank you for all your hard work on making this 👍

@olafz
Copy link

olafz commented Jan 3, 2024

Thank you. That fixes that error but now I have the issue of CAA records not being supported :-(

I think I'll just write my own parser for the API, this has gotten too big with OctoDNS, octodns-lexicon & Lexicon :-)

In that case, you probably want to take a look at https://gist.github.com/olafz/9660d6275a80155da0719739d866ce42 and save yourself some time ;) That gist contains a patch for the cloudns.py file from the Python dns-lexicon package to properly support CAA, MX and SRV records.

@dogsbody
Copy link
Author

You are a star. You are right, this fixes everything for me. Thank you very much 🥇

@doddo
Copy link
Owner

doddo commented Feb 15, 2024

yeah sorry this hasn't really kept up with the latest development

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

No branches or pull requests

3 participants