Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

zappa certify => Attribute Error: 'NoneType' on orig_value.split[...] #959

Open yuric opened 7 years ago

yuric commented 7 years ago

This is in reference to running zappa certify and getting the error below.

Possible Fix

Not sure yet. Today I started taking a look at the referred botocore file botocore/handlers.py and working out from there. I might have to set this up manually on AWS's APIGateway and Route53 instead but I would love to have a solution or direction instead. Please advice.

Steps to Reproduce

  1. set certificate_arn (ex:arn:aws:acm:us-east-1:...)
  2. set domain (subdomain.example.com)
  3. zappa certify

Your Environment

Context & Error

Traceback (most recent call last): File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/zappa/cli.py", line 2358, in handle sys.exit(cli.handle()) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/zappa/cli.py", line 459, in handle self.dispatch_command(self.command, stage) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/zappa/cli.py", line 555, in dispatch_command manual=self.vargs['manual'] File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/zappa/cli.py", line 1609, in certify self.zappa.update_route53_records(self.domain, dns_name) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/zappa/core.py", line 1698, in update_route53_records is_apex = self.route53.get_hosted_zone(Id=zone_id)['HostedZone']['Name'][:-1] == domain_name File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/client.py", line 253, in _api_call return self._make_api_call(operation_name, kwargs) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/client.py", line 531, in _make_api_call api_params, operation_model, context=request_context) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/client.py", line 583, in _convert_to_request_dict params=api_params, model=operation_model, context=context) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit return self._emit(event_name, kwargs) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit response = handler(**kwargs) File "/Users/ycosta3987/.virtualenvs/loudmouth-user/lib/python2.7/site-packages/botocore/handlers.py", line 577, in fix_route53_ids params[name] = orig_value.split('/')[-1] AttributeError: 'NoneType' object has no attribute 'split'

bxm156 commented 7 years ago

When this happened to me, I forgot to turn off route53_enabled. Since route53 doesn't manage my domains.

ceefour commented 6 years ago

Happened to me too. I also don't use Route53 but CloudFlare.

(venv) C:\Users\ceefour\git\samara\samaraweb>zappa certify
Calling certify for stage prd..
Are you sure you want to certify? [y/n] y
Certifying domain keluargasamara.com..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\zappa\cli.py", line 2610, in handle
    sys.exit(cli.handle())
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\zappa\cli.py", line 505, in handle
    self.dispatch_command(self.command, stage)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\zappa\cli.py", line 610, in dispatch_command
    manual=self.vargs['manual']
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\zappa\cli.py", line 1816, in certify
    self.zappa.update_route53_records(self.domain, dns_name)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\zappa\core.py", line 1949, in update_route53_records
    is_apex = self.route53.get_hosted_zone(Id=zone_id)['HostedZone']['Name'][:-1] == domain_name
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\client.py", line 312, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\client.py", line 579, in _make_api_call
    api_params, operation_model, context=request_context)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\client.py", line 631, in _convert_to_request_dict
    params=api_params, model=operation_model, context=context)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\hooks.py", line 227, in emit
    return self._emit(event_name, kwargs)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\hooks.py", line 210, in _emit
    response = handler(**kwargs)
  File "c:\users\ceefour\git\samara\venv\lib\site-packages\botocore\handlers.py", line 586, in fix_route53_ids
    params[name] = orig_value.split('/')[-1]
AttributeError: 'NoneType' object has no attribute 'split'

==============

Need help? Found a bug? Let us know! :D
File bug reports on GitHub here: https://github.com/Miserlou/Zappa
And join our Slack channel here: https://slack.zappa.io
Love!,
 ~ Team Zappa!

Python 3.6 on Windows 10:

argcomplete==1.9.2
Babel==2.5.1
base58==0.2.4
boto3==1.4.7
botocore==1.7.39
certifi==2017.11.5
chardet==3.0.4
click==6.7
Django==1.11.7
django-phonenumber-field==1.3.0
docutils==0.14
durationpy==0.5
future==0.16.0
hjson==3.0.1
idna==2.6
jmespath==0.9.3
kappa==0.6.0
lambda-packages==0.19.0
phonenumberslite==8.8.5
placebo==0.8.1
psycopg2==2.7.3.2
python-dateutil==2.6.1
python-slugify==1.2.4
pytz==2017.3
PyYAML==3.12
requests==2.18.4
s3transfer==0.1.11
six==1.11.0
toml==0.9.3
tqdm==4.19.1
troposphere==2.0.2
Unidecode==0.4.21
urllib3==1.22
Werkzeug==0.12
wsgi-request-logger==0.4.6
zappa==0.45.1
jneves commented 6 years ago

So this seems to be either people not using route 53 (and not disabling it with "route53_enabled": false in the settings or a possible duplicate of #1661. Correct?

JorisNinja commented 4 years ago

So this seems to be either people not using route 53 (and not disabling it with "route53_enabled": false in the settings or a possible duplicate of #1661. Correct?

Thanks a lot, solved it by adding to zappa_settings.json: "route53_enabled": false